Convert Leaflet LatLng for overlaying x, y pixel images

I have an elevator map created using an image using imageOverlay for the purpose of rendering an internal map. I am wondering how to set the latitude and longitude of the flyers, how to get the x, y pixels of the image.

+4
source share
2 answers

The simplest conversion for setting and obtaining pixel coordinates from the Lat / Lng system is to use:

  • Project: to convert from lat / lng to pixels project(<LatLng> latlng, <Number> zoom)
  • Unproject: to convert from pixels to lat / lng unproject(<Point> point, <Number> zoom)

You can always link to the Link to the sheets

PS: consider that the CRS card is set to Simple

+6
source

CRS . , lat-long-, x-y .

+1

Source: https://habr.com/ru/post/1675079/


All Articles