Hi
Within a function, I create several markers and I need to assign them
a specific ID.
var marker = new google.maps.Marker({
position: latlng,
icon: image,
map: map,
title: name,
draggable: true
});
marker.myid = markerid;
gmarkers.push(marker);
Now I have another function from which I want to 'click' a link that
contains the marker id and fire a click event
function spotClick(markerId) {
google.maps.event.trigger(gmarkers[markerId],"click");
}
This obviously does not work. How am I supposed to refer to marker by
the ID I assigned to it earlier?
Thanks in advance!
--
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 [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.