geojson-vt
Advanced tools
Comparing version 2.1.7 to 2.1.8
{ | ||
"name": "geojson-vt", | ||
"version": "2.1.7", | ||
"version": "2.1.8", | ||
"description": "Slice GeoJSON data into vector tiles efficiently", | ||
@@ -20,11 +20,11 @@ "homepage": "https://github.com/mapbox/geojson-vt", | ||
"benchmark": "^1.0.0", | ||
"browserify": "^11.1.0", | ||
"browserify": "^12.0.1", | ||
"coveralls": "^2.11.4", | ||
"eslint": "^1.5.0", | ||
"eslint-config-mourner": "^1.0.0", | ||
"eslint": "^1.9.0", | ||
"eslint-config-mourner": "^1.0.1", | ||
"faucet": "0.0.1", | ||
"istanbul": "^0.3.20", | ||
"tape": "^4.2.0", | ||
"uglify-js": "^2.4.24", | ||
"watchify": "^3.4.0" | ||
"istanbul": "^0.4.0", | ||
"tape": "^4.2.2", | ||
"uglify-js": "^2.5.0", | ||
"watchify": "^3.6.0" | ||
}, | ||
@@ -31,0 +31,0 @@ "license": "ISC", |
@@ -79,2 +79,6 @@ ## geojson-vt — GeoJSON Vector Tiles | ||
##### 2.1.8 (Nov 9, 2015) | ||
- Fixed a bug where `getTile` would initially return `null` when requesting a child of a solid clipped square tile. | ||
##### 2.1.7 (Oct 16, 2015) | ||
@@ -81,0 +85,0 @@ |
@@ -64,3 +64,4 @@ 'use strict'; | ||
options = this.options, | ||
debug = options.debug; | ||
debug = options.debug, | ||
solid = null; | ||
@@ -100,5 +101,2 @@ // avoid recursion by using a processing queue | ||
// stop tiling if the tile is solid clipped square | ||
if (!options.solidChildren && isClippedSquare(tile, options.extent, options.buffer)) continue; | ||
// if it's the first-pass tiling | ||
@@ -119,2 +117,8 @@ if (!cz) { | ||
// stop tiling if the tile is solid clipped square | ||
if (!options.solidChildren && isClippedSquare(tile, options.extent, options.buffer)) { | ||
if (cz) solid = z; // and remember the zoom if we're drilling down | ||
continue; | ||
} | ||
// if we slice further down, no need to keep source geometry | ||
@@ -154,2 +158,4 @@ tile.source = null; | ||
} | ||
return solid; | ||
}; | ||
@@ -182,18 +188,21 @@ | ||
if (!parent) return null; | ||
if (!parent || !parent.source) return null; | ||
// if we found a parent tile containing the original geometry, we can drill down from it | ||
if (debug > 1) console.log('found parent tile z%d-%d-%d', z0, x0, y0); | ||
// if we found a parent tile containing the original geometry, we can drill down from it | ||
if (parent.source) { | ||
if (isClippedSquare(parent, extent, options.buffer)) return transform.tile(parent, extent); | ||
// it parent tile is a solid clipped square, return it instead since it's identical | ||
if (isClippedSquare(parent, extent, options.buffer)) return transform.tile(parent, extent); | ||
if (debug > 1) console.time('drilling down'); | ||
this.splitTile(parent.source, z0, x0, y0, z, x, y); | ||
if (debug > 1) console.timeEnd('drilling down'); | ||
if (debug > 1) console.time('drilling down'); | ||
var solid = this.splitTile(parent.source, z0, x0, y0, z, x, y); | ||
if (debug > 1) console.timeEnd('drilling down'); | ||
// one of the parent tiles was a solid clipped square | ||
if (solid !== null) { | ||
var m = 1 << (z - solid); | ||
id = toID(solid, Math.floor(x / m), Math.floor(y / m)); | ||
} | ||
if (!this.tiles[id]) return null; | ||
return transform.tile(this.tiles[id], extent); | ||
return this.tiles[id] ? transform.tile(this.tiles[id], extent) : null; | ||
}; | ||
@@ -200,0 +209,0 @@ |
Sorry, the diff of this file is not supported yet
1810712
8073
138