var next = function (index) { if (!index) { console.log('All done!') return } else { var features = tylr.tileStore[index] var xyz = index.split('-') var geojson = tylr.buildGeoJSON(features) if (tylr.options.t === 'geojson') { tylr.createJSONTile(xyz, geojson, function () { next(tiles.pop()) }) } else { tylr.createPBFTile(xyz, geojson, function () { next(tiles.pop()) }) } } }