gpt4 book ai didi

leaflet - 在 Leaflet 上将点转换为 LatLng

转载 作者:行者123 更新时间:2023-12-05 09:19:12 27 4
gpt4 key购买 nike

我正在尝试将我的点在 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com