How to get X Y Z coordinates of tile by click on Leaflet map

后端 未结 3 520
说谎
说谎 2020-12-15 10:46

I want to ask for help to deal with the possible use of non-standard coordinates on the map Leaflet.

I want to use Leaflet to display custom maps with my own tile g

3条回答
  •  清歌不尽
    2020-12-15 11:31

    You can use the mouseEventToLayerPoint and mouseEventToContainerPoint methods in the Leaflet API to convert pixels onscreen to pixels relative to the top-left of the map, and then using a little math, you can derive the location within a tile.

提交回复
热议问题