Google Map V3 - Allow only one infobox to be displayed at a time

后端 未结 2 1452
庸人自扰
庸人自扰 2020-11-29 13:52

I\'m moving from infoWindow to infoBox for better looking info windows.

I have a number of markers on the map. What I want to do is when o

2条回答
  •  有刺的猬
    2020-11-29 14:19

    The usual suggestion for a single infowindow is to only create one, then reuse it for all the markers (changing its content).

    Here is an example that does that with the v3 API (I think of it as "v2 infowindow behavior" because the v2 API only allowed a single infowindow) http://www.geocodezip.com/v3_markers_normal_colored_infowindows.html

    Here is another example based off of Mike Williams' v2 tutorial: http://www.geocodezip.com/v3_MW_example_map1.html

    and your example modified: http://jsfiddle.net/uGnQb/6/

提交回复
热议问题