Google Maps: Auto close open InfoWindows?

前端 未结 12 717
终归单人心
终归单人心 2020-12-02 05:30

On my site, I\'m using Google Maps API v3 to place house markers on the map.

The InfoWindows stay open unless you explicitly click the close icon. Meaning, you can h

12条回答
  •  没有蜡笔的小新
    2020-12-02 06:28

    From this link http://www.svennerberg.com/2009/09/google-maps-api-3-infowindows/:

    Teo: The easiest way to do this is to just have one instance of the InfoWindow object that you reuse over and over again. That way when you click a new marker the infoWindow is “moved” from where it’s currently at, to point at the new marker.

    Use its setContent method to load it with the correct content.

提交回复
热议问题