How to get linked marker object for infowindow in google maps api v3 with multiple info windows

I have a google map on my page, I show several markers on my map with an infowindow attached to each marker, when I click on a marker, the infowindow associated with it opens and displays information for the marker.

I have a button in infowindow that updates the associated marker status, and changes the markericon when updating.

So, how can I get the exact infowindow marker object in which the button is clicked.

Please note that several info windows open simultaneously.

Thanks.

+6
source share
1 answer

to get the marker that was clicked you should use infoWindow.anchor

+2
source

Source: https://habr.com/ru/post/948679/


All Articles