Created
February 23, 2018 01:40
-
-
Save dirceu-jr/8dfb066249ded15f3eb309e76e0326c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCoordsInLatLng(latlng) { | |
var tileSize = L.point(256, 256); | |
var pixelPoint = map.project(latlng, map.getZoom()).floor(); | |
var coords = pixelPoint.unscaleBy(tileSize).floor(); | |
coords.z = map.getZoom(); | |
return coords; | |
} | |
var coords = getCoordsInLatLng(latlngs[latlng]); | |
console.log(layer.getTileLayer().getTileUrl(coords)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment