I’m adding markers to my Google Map like this:
function createMarker(location, info) {
var marker = new google.maps.Marker({
map: map,
position: location
});
google.maps.event.addListener(marker, "click", function () {
if (infowindow) infowindow.close();
infowindow = new google.maps.InfoWindow({ content: info, title: 'test' });
infowindow.open(map, marker);
});
}
How can I access and open the markers without a manual click on the map?
I tried to save the marker object and do a marker.click() but it doesn’t seem to work.
Any ideas?
Added:
Modified:
Some event on the page executes the following: