forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
151 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
/js/shaders.js | ||
/dist | ||
/editor/dist | ||
/node_modules | ||
/tiles-original | ||
/tiles | ||
/ARCHIVE | ||
/deploy.sh | ||
*.sublime-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env node | ||
|
||
var path = require('path'); | ||
|
||
if (process.argv.length < 4) { | ||
console.warn('Usage: %s %s [positions.json] [metadata.json]', process.argv[0], path.basename(__filename)); | ||
process.exit(1); | ||
} | ||
|
||
var sprite = require(path.join(process.cwd(), process.argv[2])); | ||
var maki = require(path.join(process.cwd(), process.argv[3])); | ||
|
||
var result = {}; | ||
|
||
for (var i = 0; i < maki.length; i++) { | ||
var name = maki[i].icon; | ||
result[name] = { | ||
'name': maki[i].name, | ||
'tags': maki[i].tags, | ||
'sizes': { | ||
'12': { x: sprite[name + '-12'].x, y: sprite[name + '-12'].y }, | ||
'18': { x: sprite[name + '-18'].x, y: sprite[name + '-18'].y }, | ||
'24': { x: sprite[name + '-24'].x, y: sprite[name + '-24'].y } | ||
} | ||
} | ||
} | ||
|
||
console.log(JSON.stringify(result)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env node | ||
var Protobuf = require('../js/protobuf.js'); | ||
var VectorTile = require('../js/vectortile.js'); | ||
|
||
|
||
// Script for displaying tags/frequency in a vector tile | ||
|
||
var fs = require("fs"); | ||
var zlib = require("zlib"); | ||
|
||
if (process.argv.length < 3) { | ||
console.warn('Usage: %s %s [file.vector.pbf]', process.argv[0], process.argv[1]); | ||
process.exit(1); | ||
} | ||
|
||
var data = fs.readFileSync(process.argv[2]); | ||
|
||
zlib.inflate(data, function(err, data) { | ||
if (err) throw err; | ||
|
||
var tile = new VectorTile(new Protobuf(new Uint8Array(data))); | ||
|
||
var stats = {}; | ||
for (var layer_name in tile.layers) { | ||
var layer = tile.layers[layer_name]; | ||
var types = stats[layer_name] = { fill: 0, line: 0, point: 0, other: 0 }; | ||
for (var i = 0; i < layer.length; i++) { | ||
var feature = layer.feature(i); | ||
switch (feature._type) { | ||
case 1: types.point++; break; | ||
case 2: types.line++; break; | ||
case 3: types.fill++; break; | ||
default: types.other++; break; | ||
} | ||
} | ||
console.warn(layer_name, types); | ||
} | ||
|
||
console.warn(stats.road); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env node | ||
var Protobuf = require('../js/protobuf.js'); | ||
var VectorTile = require('../js/vectortile.js'); | ||
|
||
|
||
// Script for displaying tags/frequency in a vector tile | ||
|
||
var fs = require("fs"); | ||
var zlib = require("zlib"); | ||
|
||
if (process.argv.length < 3) { | ||
console.warn('Usage: %s %s [file.vector.pbf]', process.argv[0], process.argv[1]); | ||
process.exit(1); | ||
} | ||
|
||
var data = fs.readFileSync(process.argv[2]); | ||
|
||
zlib.inflate(data, function(err, data) { | ||
if (err) throw err; | ||
|
||
var tile = new VectorTile(new Protobuf(new Uint8Array(data))); | ||
|
||
|
||
var stats = {}; | ||
for (var layer_name in tile.layers) { | ||
var layer = tile.layers[layer_name]; | ||
var tags = stats[layer_name] = {}; | ||
for (var i = 0; i < layer.length; i++) { | ||
var feature = layer.feature(i); | ||
for (var key_name in feature) { | ||
if (['osm_id', 'name', 'name_en', 'name_de', 'name_es', 'name_fr', 'maki', 'website', 'address', 'reflen', 'len', 'area'].indexOf(key_name) >= 0) continue; | ||
if (feature.hasOwnProperty(key_name) && key_name[0] !== '_') { | ||
if (!(key_name in tags)) tags[key_name] = {}; | ||
var val = feature[key_name]; | ||
if (tags[key_name][val]) tags[key_name][val]++; | ||
else tags[key_name][val] = 1; | ||
} | ||
} | ||
} | ||
} | ||
|
||
console.warn(stats.road); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
module.exports = DataFilterView; | ||
function DataFilterView(list) { | ||
var view = this; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
App: require('./app.js') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// source: http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript | ||
exports.titlecase = titlecase; | ||
function titlecase(str) { | ||
return str.replace(/\w\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); }); | ||
} |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.