Close open InfoBubble when open a new (gMap v3)

守給你的承諾、 提交于 2019-12-07 03:01:28

The simplest approach to only have one infoBubble open is to only have one infoBubble and open it with different contents depending on the marker that is clicked.

InfoWindow example with custom markers (same concept applies to InfoBubble)

The InfoBubble is an OverlayView. As far as I can see, an overlaycomplete event is emitted when an overlay is added. Maybe all your InfoBubbles could listen to that event and close if the added overlay is a different one than "this".

It's just a thought, though, I haven't tried it myself. Feedback appreciated if you try it out!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!