gpt4 book ai didi

google-maps - 在 Google map 窗口中查找角落的经纬度

转载 作者:行者123 更新时间:2023-12-03 20:49:48 24 4
gpt4 key购买 nike

使用Google Maps API,如何获取 map 显示区域角点的经纬度?

也就是说,如果我的 map 宽 300 像素,高 400 像素,我如何找到 (0,0) 和 (300,400) 点的经纬度?

最佳答案

使用 getBounds() .从文档:

Returns the the visible rectangular region of the map view in geographical coordinates.



该函数准确返回您想要的内容: map 的西南角和东北角。第一对坐标是左下(西南)坐标,第二对是右上(东北)坐标。

关于google-maps - 在 Google map 窗口中查找角落的经纬度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1083472/

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