Google maps: infowindow is not closing

前端 未结 2 1954
盖世英雄少女心
盖世英雄少女心 2020-12-07 05:48

My infowindows are not closing automatically when i click on the other marker.. here the code : http://pastebin.com/PvCt2z7W here is the code for markers with infowindows

2条回答
  •  猫巷女王i
    2020-12-07 06:33

    The other option to using function closure (which basically involves using a createMarker function) is to save the content of the infowindow in a property of the marker. It still is simplest with a single infowindow. You haven't provided enough context in your pastebin to give you a working example that does that.

    Here is an example that uses function closure to associate the infowindow content with the marker and has a single infowindow (translated from Mike Williams' v2 tutorial).

    http://www.geocodezip.com/v3_MW_example_map3.html

    Mike Williams' description of function closure

    Here is an example that doesn't use function closure (it stores the infowindow content in a property of the marker object):

    http://www.geocodezip.com/v3_MW_example_map3_noclosure.html

提交回复
热议问题