I have a google map set up to find the user\'s current location, and center the map at that closest marker to their location. The markers, when clicked, open up an infobox (
i see that this question has been sitting for quite awhile, but, just in case, this answer may be helpful: trigger google maps marker click
The code would look like this:
var marker = new google.maps.Marker({});
new google.maps.event.trigger( marker, 'click' );
Good luck!
I found I needed to attach a click event to the marker like so
var marker = new google.maps.Marker({});
marker.addListener('click', function() {
infowindow.open(map, marker);
});
new google.maps.event.trigger( marker, 'click' );