2017-06-18 88 views
0

Google map has multiple marker clicks. Each marker has the corresponding info-window to display the content. How do I do that, when I click a marker to display info-window, turn off the last info-window?Google map API Multiple marker click animation

[Chinese — translate] google map API中,有多個marker點擊每一個marker都有對應的info-window來展示內容,請問怎麼實現點擊一個marker展示info-window時把上一個info-window關掉?

回答

0

The point is to new only one infowindow,

and change the content you want to show in the infowindow for each marker.

In that way,while you click the next marker,the previuos one will close automatically.

infowindow.setOptions({ content: content, });       

infowindow.open(map, marker); 
+0

You should put your code on codepan so others can help you out . – Tim