There's an enhancement request for GMarker.setIcon()
  http://code.google.com/p/gmaps-api-issues/issues/detail?id=110
Adding your star to that request might possibly improve its chances of
being implemented.


One thing that did work the last time I checked is to change the icon
that's attached to a marker, then removeOverlay and addOverlay the
marker. However the details of that behaviour are not documented, any
other markers that use that icon and are subsequently addOverlay()ed are
also affected, and it doesn't gain you much over the strategy of
creating a new marker with the settings you require:

  // create the new marker
  m = new GMarker(G.marker.getLatLng(), {icon:G.icon});
  map.addOverlay(m);
  // remove the old marker
  map.removeOverlay(G.marker)
  // remember the new marker
  G.marker = m;

You'll also need to re-establish any listeners. If you're going to be
doing a lot of such switching, it's a good idea to clear any listeners
that are attached to the old markers so that the memory can be
recovered.

-- 
Mike Williams
http://econym.org.uk/gmap



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to