Project Leaflet LatLng to tile pixel coordinates
问题 For canvas layers, how can I access the clicked pixel of a specific tile? Given a LatLng like { lat: 37.68816, lng: -119.76196 } , how can I: #1, retrieve the correct tile clicked, and #2, the pixel coordinates within the tile? Both of these should consider maxNativeZoom . 回答1: A CRS like L.CRS.EPSG3857 is required. The map's CRS is accessible by map.options.crs . The true zoom, tile size (like 256, but could be 512 or higher about maxNativeZoom ) and a pixel origin like map.getPixelOrigin()