Hi,
I have markers that get shown by clicking on the sidebar, but I'd like
to have only one marker showing at a time - ie, when you bring up a
new one, the previous one disappears.
I found this bit of code:
var current_marker = null;
GEvent.addListener(map, "click", function(marker, point){
if (current_marker) map.removeOverlay(current_marker);
current_marker = new GMarker(point);
map.addOverlay(current_marker);
}
which I converted to this:
var current_marker = null;
GEvent.addListener(marker, "click", function() {
if (current_marker) map.removeOverlay(current_marker);
current_marker = new GMarker(point);
map.addOverlay(current_marker);
marker.show();
marker.openInfoWindowHtml(html)
});
but it seems to have no effect. Can somebody tell me if I'm on the
right track, or if there is an easier way to do this? Here's my map:
http://www.xelawho.com/map/collapse.htm
(I had a similar problem with polygons a while ago, but that solution
doesn't appear to work here).
cheers,
Lucas
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.