我正在尝试将我的点在 map 上的正确位置作为 Latlng:
let point = L.point(0,0) // x=0,y=0
let latlng = map.unproject(point)
但是 latlng
值不是真实位置!
我错过了什么?
最佳答案
函数:unproject
不正确。
你应该使用:layerPointToLatLng
:
let point = L.point(0,0); // x=0,y=0
let latlng = map.layerPointToLatLng(point);
问候
雷切尔
关于leaflet - 在 Leaflet 上将点转换为 LatLng,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41614804/