gpt4 book ai didi

google-maps - 确定坐标是否在 Google map 范围内?

转载 作者:行者123 更新时间:2023-12-02 04:32:09 26 4
gpt4 key购买 nike

我有一张已经缩放和定位的 Google map 。如何确定某些坐标是否在当前 map 的 map 边界或视口(viewport)内?仅当我提供的坐标位于当前范围内时,我才想有条件地删除图钉。

最佳答案

google.maps.LatLngBounds.contains()

(来自documentation):

contains
contains(latLng)
Parameters:
latLng: LatLng|LatLngLiteral
Return Value: boolean
Returns true if the given lat/lng is in this bounds.

关于google-maps - 确定坐标是否在 Google map 范围内?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22794824/

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