Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
检查视口中是否有任何标记的最有效方法是什么?
如果它包含在视口中,一个完美的解决方案不需要一一检查所有标记。
我想出的最佳解决方案是
GMap2.getBounds()
使用 GMap2.getBounds() 找到边界框。使用 GLatLngBounds.containsLatLng() 检查每个标记是否可见。
或者,如果每个集群的值以易于访问的方式存储,您可以尝试对标记集群使用相同的方法。(自己没看过)