Closed wodor closed 12 years ago
You could consider adding an option to map (?) , to allow only one info window to be opened.
this can be done by changing the way event is created instead of
var event_4f07735701880 = google.maps.event.addListener(marker_4f077356f28a6, "click", function(){info_window_4f077356f2a9b.open(tripsmap, marker_4f077356f28a6);});
you could create something like this
var event_4f0772ee84f28 = google.maps.event.addDomListener(marker_4f0772ee84ce0, "click", function() { if(openedInfoWindow !== undefined) { openedInfoWindow.close(); } info_window_4f0772ee84e10.open(tripsmap, marker_4f0772ee84ce0); openedInfoWindow = info_window_4f0772ee84e10; }, false);
(this code is not state-of-the-art but works)
the drawback is that there must exist 'openedInfoWindow' somewhere in global javascript scope , this is why I think that this should be option of Map.
and maybe there are cleaner solutions....
The commit resolves this issue. Give me some feedbacks !
Works like charm.
You could consider adding an option to map (?) , to allow only one info window to be opened.
this can be done by changing the way event is created instead of
you could create something like this
(this code is not state-of-the-art but works)
the drawback is that there must exist 'openedInfoWindow' somewhere in global javascript scope , this is why I think that this should be option of Map.
and maybe there are cleaner solutions....