1397
Views
4
Comments
Solved
[Google Maps Web] Trigger Google map Marker click Event
Question
google-maps-web
Web icon
Forge asset 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

2020-03-05 14-29-02
José Costa
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é

2017-12-01 10-04-32
Tjaart Swanepoel

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

MapMarker-1.0.0.oml
2024-03-25 06-19-08
Harlin Setiadarma

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...

MapMarker.oml
2019-03-08 16-57-05
Mauro Caiado

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');"


Cheers,

Mauro Caiado.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.