Skip to content

Instantly share code, notes, and snippets.

@rocaiguina
Created November 4, 2019 15:13
Show Gist options
  • Save rocaiguina/bcb91f5aacc269d9a3062a27b08a29a5 to your computer and use it in GitHub Desktop.
Save rocaiguina/bcb91f5aacc269d9a3062a27b08a29a5 to your computer and use it in GitHub Desktop.
to vector tiles
var fs = require('fs');
var geojson2mvt = require('geojson2mvt');
const filePath = 'grids.json';
var options = {
rootDir: 'grids',
bbox : [17.896877,-67.298786,18.602453,-65.199024],//[south,west,north,east]-67.298786,17.896877,-65.199024,18.602453
zoom : {
min : 6,
max : 14,
},
layerName: 'grids',
};
var geoJson = JSON.parse(fs.readFileSync(filePath, "utf8"));
// build the static tile pyramid
geojson2mvt(geoJson, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment