Skip to content

Instantly share code, notes, and snippets.

@handygeospatial
Created January 14, 2015 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save handygeospatial/9946fd69e839fca5a5a5 to your computer and use it in GitHub Desktop.
Save handygeospatial/9946fd69e839fca5a5a5 to your computer and use it in GitHub Desktop.
GeoJSONタイルのフォーマットの違い(TileLayer.GeoJSON vs Tangram) ref: http://qiita.com/handygeospatial/items/cc0cf63b13e2857c56ee
/**
Mapzen/OSM.US-style GeoJSON vector tiles
@class GeoJSONTileSource
*/
export class GeoJSONTileSource extends NetworkTileSource {
constructor (source) {
super(source);
this.type = 'GeoJSONTileSource';
}
parseTile (tile, response) {
tile.layers = JSON.parse(response);
TileSource.projectTile(tile); // mercator projection
TileSource.scaleTile(tile); // re-scale from meters to local tile coords
}
}
{
"earth": {
"type":"FeatureCollection",
"features": [...],
...
},
"landuse": {
"type":"FeatureCollection",
"features": [...],
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment