[Google Maps] Trigger Google map Marker click Event

[Google Maps] Trigger Google map Marker click Event

  
Forge Component
(20)
Published on 18 Oct (5 days ago) by Labs
20 votes
Published on 18 Oct (5 days ago) by Labs

Hi,

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

Solution

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.

Cheers,

José

Solution

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.

Thanks

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.

Cheers...