>
> marker.myAttribute = myAttributeValue; // if you need this
>
This behavior really shouldn't be recommended. In most cases it's just as 
easy to do:

var markerInfo = createMarker(...); // probably global
markerInfo.myAttribute = myAttributeValue; // if you need this
markers.push(markerInfo);
...
function createMarker(...) {
var marker=new google.maps.Marker(...); // local variable
google.maps.event.addListener(marker, 'click', function() { ... });
return {marker: marker};
}

This way custom properties won't ever collide with pre-existing marker 
properties which can and do change.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-maps-js-api-v3/-/1P3OVgeaTlMJ.
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-js-api-v3?hl=en.

Reply via email to