21
Views
7
Comments
Solved
How to use Google Maps Library for Reactive Web App?
Question

Hi everyone!

I'm a building a reactive web app and I want to use Google Map Library in my app. 

Can I use address instead of latitude and longitude? Because I only have address field in my database.

If yes, how can I use it?  I have a "Street Address" attribute in the "Site" table

Also do I have to use API Key? when I copy my API key to the field it's throwing following error.

It's my first time using google map and I'm really confused...

Thank you!

Rank: #647
Solution

Check the example in this file and let me know if you can make sense of this.

GoogleMaps.oml

Rank: #647

Hi Elsie,

Regarding the API key, you should use quotation marks ("") before and after your API Key, like this: "API_Value".

About the address, you can indeed use it instead of the coordinates. You have to create a variable that is a list of  "MapMarker" (see below) and you should add a record to that list with the address you want to display and then use that variable in the "Markers" property you have highlighted.

Let me know if this helps,

Pedro

Rank: #647
Solution

Check the example in this file and let me know if you can make sense of this.

GoogleMaps.oml

mvp_badge
MVP
Rank: #18

Hi Elsie,

If you only need to show one location you can use the SingleLocationMap from the Google Maps Library that can directly receive an Address as input as well...

Also, for future reference, you may get better/faster replies if you post your issue in the right forum, in this case, since you are facing difficulties with the Google Maps Library, nothing better than creating the discussion topic directly in that component's Support Forum. This has an added benefit to the community, as others may face the same issue and typically would check there first.

Hope this helps!

Rank: #647

Hi Elsie,

You are trying to access data that has not been fetched yet. 

If you want to use that data, you need to do it in the "On After Fetch" event of your data source.

Check this link for more info: https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Screen_and_Block_Lifecycle_Events 


Hope this helps, 

Pedro