[OutSystems Maps] [ Outsystems Map ] Event OnClick
Question
Forge component by OutSystems R&D

Hello, 

I'm new with Outsystems and I try to implement the official Outsystems Maps. 

I can find many supports on "Google Maps" but not so much related to "Outsystems Map" (both are based on Google Maps, but they don't seem to work in the same way).


First, I added the widget to my screen : 

=> OK

Then, I use the "On After Fetch" Aggregate event  to build a marker list, and I sent this list as parameter "Markers" of the Widget map.

=> OK, all markers are displayed in the map.


Now I want to manage the click on a marker, and display a text on the map 

Use cases:

1/ display an info windows on the marker

2/ display an info even if there is no marker)


I created a Client Action on the event "Markers_OnClick" of the Map Widget.

In this Client Action, I tried in many ways, but nothing is working. I saw on Community informations regarding "addListener" but as we already have the "Markers_OnClick", I guess we don't need a listener(?).


My main issue seems to be the something like the "getMap" function, as we need to push the map object into the infowindow.open function, and I can only create new map, and not use the current MapId to get the Map object.


One example of my code :


Thank you for your help :)


Sources :

(related to Mobile version or Library version)

https://www.outsystems.com/forums/discussion/20425/google-map-mobile-on-marker-click/

https://www.outsystems.com/forums/discussion/46524/click-event/ 

Google Maps doc

https://developers.google.com/maps/documentation/javascript/examples/event-simple 

https://developers.google.com/maps/documentation/javascript/reference/info-window?hl=fr 

Solution

Hello @Julien Guillot ,

This requirement is related with Info Windows, which is an advanced use case not supported by this map version.

We are working to allow to achieve this using just OutSystems code.

For now, you'll need to use JavaScript.

We've created a sample to help you:

Please mind that you need to have the id of div that contains the map to use the Google Maps API methods:

 In this case it is "b3-MapContainer".

Please keep in mind, that this is an advanced use case and it is not supported, this is an attempt to unlock you.

You can check the OML in attachment.

Please let us know if this helped.

Bruno Martinho

Hello @Bruno Martinho ,

Thank you for your interesting reply, it works well ! 

Do you have the release date of the final Outsystem Map version ? 

Note : In your .oml you added an API Key, just in case it's not on purpose, you should remove it :)


Thank you  ! 



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