Skip to content

Instantly share code, notes, and snippets.

@willwhite
Created January 21, 2011 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save willwhite/790163 to your computer and use it in GitHub Desktop.
Save willwhite/790163 to your computer and use it in GitHub Desktop.
SphericalMercator.prototype.envelope_to_xyz = function(bbox, minzoom, maxzoom) {
var ll0 = [bbox[0],bbox[3]]
var ll1 = [bbox[2],bbox[1]]
var that = this;
_.range(minzoom, maxzoom+1).forEach(function(z) {
px0 = that.ll_to_px(ll0,z);
px1 = that.ll_to_px(ll1,z);
_.range(px0[0]/256.0, px1[0]/256.0+1).forEach(function(x) {
console.log(x);
})
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment