I want to raise a click event on a marker so that the infobox will appear.
I am able to successfully do it with this:
$(marker.getServiceObject().content).click()
This however doesn't work on mobile. Not sure why.
I tried with a mousedown event, but this doesn't work either:
if $('html.no-touch').length
$(m.getServiceObject().content).click()
else
$(m.getServiceObject().content).mousedown()
I was thinking there was a more elegant solution of making the infobox appear.
If anyone has any suggestions, I'd greatly appreciate it. Thanks!
You must proceed this way:
google.maps.event.trigger(m.getServiceObject(), 'click');