colonel-mercator
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -33,21 +33,16 @@ var r_utils = require('mapnik-omnivore/lib/utils'); | ||
breakZooms = breakZooms.map(function(z) { | ||
var breakZ = Math.min(z + upzoom, validSpatRef.length - 1); | ||
return { | ||
breakZ: breakZ, | ||
z: z, | ||
thresh: validSpatRef[Math.min(z + upzoom, validSpatRef.length - 1)] | ||
thresh: validSpatRef[breakZ] | ||
} | ||
}); | ||
var minThresh = breakZooms[breakZooms.length -1] | ||
breakZooms = breakZooms.filter(function(r) { | ||
if (resolution < r.thresh) { | ||
return r | ||
} | ||
breakZooms = breakZooms.filter(function(r, l) { | ||
// Return if last OR if resolution is under the threshold AND if the next break has a different break | ||
return l === breakZooms.length - 1 || resolution < r.thresh && r.breakZ !== breakZooms[l + 1].breakZ; | ||
}); | ||
if (breakZooms.length) { | ||
return callback(null, breakZooms[0]); | ||
} else { | ||
return callback(null, minThresh); | ||
} | ||
return callback(null, breakZooms[0]); | ||
} |
{ | ||
"name": "colonel-mercator", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"main": "./index", | ||
@@ -16,3 +16,3 @@ "engines": { | ||
"dependencies": { | ||
"mapnik-omnivore": "^7.0.0", | ||
"mapnik-omnivore": "^7.4.0", | ||
"minimist": "^1.1.0", | ||
@@ -19,0 +19,0 @@ "split": "^0.3.3" |
7100
58
Updatedmapnik-omnivore@^7.4.0