Skip to content

Instantly share code, notes, and snippets.

@donSchoe
Created July 9, 2015 12:08
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 donSchoe/a68540247adc172868ed to your computer and use it in GitHub Desktop.
Save donSchoe/a68540247adc172868ed to your computer and use it in GitHub Desktop.
Where is EPSG:3857 in Leaflet?
map.getBounds().getNorthEast(); // LatLng(52.5262, 13.44907)
map.getPixelBounds().getTopRight(); // Point(2253845, 1375425) ???
map.getPixelOrigin(); // Point(2252165, 1375425) ???
L.Projection.SphericalMercator.project(
map.getBounds().getNorthEast()
); // Point(0.23473, 1.08117) !?!
L.point(
L.Projection.SphericalMercator.project(
map.getBounds().getNorthEast()
).x * 6378137.0,
L.Projection.SphericalMercator.project(
map.getBounds().getNorthEast()
).y * 6378137.0
); // Point(1497143.40914, 6895833.38915)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment