Skip to content

Instantly share code, notes, and snippets.

@kdeloach
Created October 30, 2015 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdeloach/3a55e69e7fe67d8da380 to your computer and use it in GitHub Desktop.
Save kdeloach/3a55e69e7fe67d8da380 to your computer and use it in GitHub Desktop.
Display reprojected map bounds
map.on('moveend', function(e) {
var map = e.target;
var bounds = map.getBounds();
var topleft = bounds.getNorthWest();
var bottomright = bounds.getSouthEast();
var a = crs.project(topleft);
var b = crs.project(bottomright);
console.log({
XMin: a.x,
YMin: a.y,
XMax: b.x,
YMax: b.y
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment