I have a map where I swap marker icons on click. This is working fine
but as soon as I zoom, MarkerClusterer makes the markers revert. I can
add a listener to re-set the icons as soon as the user moves the map -
GEvent.addListener(obj.map,"movestart",function() { - but I'd like to
make it perserve the icons as soon as markerclusterer finishes doing
it's thing. Any suggestions for how to do this? Here is the relevant
part of my code (this is a drupal app, obviously):

Drupal.gmap.addHandler('gmap', function (elem) {
  var obj = this;
  obj.bind('clickmarker', function (marker) {
    // Load info panel on marker click
    jQuery("#change_infopanel").attr("src", "/map/change/detail/" +
marker.title);
    jQuery("#change_infopanel").load();
    // Reset the last "active" marker image
    for (i in obj.vars.markers) {
      if (obj.vars.markers[i].last == 1) {
        var lastmarker = obj.vars.markers[i];
        lastmarker.marker.setImage('/sites/all/modules/gmap/markers/
placetypes/' + lastmarker.markername);
        lastmarker.last = 0;
      }
    }
    // Set the just-clicked marker to active, and mark it as "last"
for next time
    marker.marker.setImage('/sites/all/modules/gmap/markers/placetypes/
selected/' + marker.markername);
    marker.last = 1;
  });
  obj.bind("boot", function() {
    GEvent.addListener(obj.map,"movestart",function() {
      for (i in obj.vars.markers) {
        if (obj.vars.markers[i].last == 1) {
          var lastmarker = obj.vars.markers[i];
          lastmarker.marker.setImage('/sites/all/modules/gmap/markers/
placetypes/selected/' + lastmarker.markername);
        }
      }
    });
  });
});

-- 
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 google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to