Closed adehner closed 8 years ago
The problem is that the OMS addListener isn't scoped to an individual marker: it runs that listener whenever any marker is clicked, and just passes the event the marker that actually got clicked that time. What's probably happening is that every one of the handlers is being called one after the other, briefly opening the window for each marker, until the last one, which is the only one that stays open.
Basically, the OMS addListener is designed to be called just once, not one time for each marker like our original code that uses the Google Maps addListener is. It also basically requires you to put your content or InfoWindow into the marker data itself, since that's all the context you get passed.
You could try the following things:
marker.infoWindow
instead of infoWindow
within the click handler.Thank you! Your first suggestion did the trick.
This may not belong in issues, but I have a question about bindHtml in map.js
I incorporated mapclusterer and overlapping marker spiderfier into the Geolocation plugin. All is working but the infoWindows. Before I incorporated spiderfier, infoWindows opened as expected, with the correct title, image and description.
After adding spiderfier, the infoWindow doesn't know which title/image/description to open from bindHtml. The same infoWindow content opens for every marker. I think it's the infoWindow for the last marker in bindHtml. Spiderfier asks that I replace the google event listener with a specific spiderfier listener. And I believe this is where my problem lies, but I'm not sure how to correct it. I'm pasting my code for addMarker below, in hopes that you can tell me what I'm doing wrong.