Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get associated marker object for a infowindow in google maps api v3 with multiple infowindows

I have a google map on my page, i am displaying multiple markers on my map with infowindow attached to each marker, when i click on a marker its related infowindow opens & displays information for the marker.

I have a button in infowindow which updates related status of marker & upon update i change the markericon.

So, how do i get exact marker object of infowindow in which the button is clicked.

Note that there may multiple infowindows open at a time.

Thanks.

like image 344
Nikhil Chavan Avatar asked Jul 04 '13 06:07

Nikhil Chavan


1 Answers

to get marker which was clicked, you should use infoWindow.anchor

like image 91
Błażej Avatar answered Oct 29 '22 00:10

Błażej