- Download and install the OutSystems Map component from Forge.
This example demonstrates how to get the coordinates of a location when the user clicks the map.
In Service Studio, in the Toolbox, search for
The Map widget is displayed.
If the UI widget does not display, it may be because you used a ready-made app, which deletes unused widgets from the module. To make additional widgets available in your app:
a. Go to Module > Manage dependencies.
b. Search for and select the relevant Producer, for example OutSystemsUI. Ensure Show All is selected.
c. On the Public elements for the selected Producer displayed on the right, ensure Show All is selected.
d. Search for and select the element you want to add, and click Apply.
e. In Service Studio, in the Toolbox, search for the widget again.
From the Toolbox, drag the Map widget into the Main Content area of your application's screen.
On the Properties tab, enter an API key so that the "For development purposes" watermark is removed.
Drag the Map Event block inside the Events_Placeholder.
On the Properties tab, set the EventName property to Click.
This allows you to handle the event every time the user clicks the map.
Create a handler for the event.
Create two new local variables (Latitude and Longitude) to store the new coordinate values.
Create a handler for the event and assign the new marker coordinates to the variables.
After following these steps and publishing the module, you can test the component in your app.