Hello group,

I'm adding several thousand clickable markers to a map (via the excellent 
markerclusterer). The entire setup takes around 1.5 sec with FF3.6, however 
I found that when reusing listeners, the time goes down to 1.2 sec, so that 
would be roughly:

var singletonListener = function(evt){
...
}

for (var i=0;i<markers.length;i++){
  var marker = markers.get(i);
  Event.addListener(marker, "click", singletonListener);
  }

versus

for (var i=0;i<markers.length;i++){
  var marker = markers.get(i);
  Event.addListener(marker, "click", function(evt){
...
  });
  }

Now, unfortunately the event passed to the function does not contain the 
marker which was clicked which doesn't allow for the singleton listener.
How would you solve this?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to