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.
在 Google Maps API v3 中,可以使用 open 方法将 InfoWindow 附加到锚点。有没有办法检索该锚对象?
我认为在当前的 API 中这是不可能的,或者至少不方便。显而易见的选择是 (a) 自己跟踪哪个 InfoWindow 与哪个锚点一起使用,或者 (b) 调用getPosition()InfoWindow 并找到在调用它时返回相同值的锚点getPosition()。请注意,如果您在同一位置有多个锚点/标记对象,则 (b) 会出现问题。
getPosition()