[Google Maps] Trigger Google map Marker click Event

Forge Component
Published on 2019-08-06 by Labs
43 votes
Published on 2019-08-06 by Labs


I am using Google Map Forge component. I am able to create multiple marker in map but how can i trigger marker click event on button click outside map to show address info

Thanks & Regards

DM Singh


Hi DM,

You can use this in the onclick advance property of your button:

"google.maps.event.trigger(osGoogleMap.getMap('"+ MyMap.Id + "').markers." + Marker.Id + ".gMarker, 'click');"

Where MyMap and Marker are the names of the Map and of the Marker.

Basically, this will trigger the click event on that marker on that map.

Tell me if this works for you.




Hi there,

I am trying to add a marker to a map by clicking on the map, I am finding it difficult to consolidate the Google API docs with the Outsystems methodology.  Attached is an example of what I am trying, but it is not working. 

I would appreciate it of someone could point me in the right way.  I had a look at the above line, but I still achieve nothing.


Hi Tjaart,

Please check my OML.

I used regular map (not routemap), and have map event set in Preparation Logic, not as UI component.

Since this is slightly off-topic (original poster asks how to trigger marker event from a button), any further question you can pm me or create new topic.


Hi all,

I have tried José Solution and needed to modified it a litle bit in order to work, since his answer was in 2017, probably is due to some update.

So, now you can use this in the onclick Extended Properties of your button:

"google.maps.event.trigger(osGoogleMap.getMap('" + MapId + "').getMarker('" + MarkerId + "').gMarker, 'click');"


Mauro Caiado.