[Google Maps] Example of the new Polyline function

[Google Maps] Example of the new Polyline function

  
Forge Component
(20)
Published on 9 Oct (7 days ago) by Labs
20 votes
Published on 9 Oct (7 days ago) by Labs

Is it possible to provide an example of the new polyline function working?

im putting a Coordinate List throught JSON Serialize, and then inputting that into the AddPolylineToMap but it does not work, how should i do it?


cheers,


Miguel Pereira

Hi Miguel,

Here's an example screenshot of the JSON input to the CoordinatesJSON parameter to AddPolylineToMap.



You can view the output here

https://stevecollins-demos-dev.outsystemscloud.com/Waypoints/


Also, make sure you have a correctly configured API Key in your Google Map that you are associating the AddPolylineToMap action to

https://developers.google.com/maps/documentation/javascript/get-api-key

and then make sure that the Google Maps JavaScript API is enabled in the Google API console

https://console.developers.google.com/apis/

Click on Library on the left to search and enable APIs or go straight to

https://console.developers.google.com/apis/library


Steve Collins wrote:

Hi Miguel,

Here's an example screenshot of the JSON input to the CoordinatesJSON parameter to AddPolylineToMap.



You can view the output here

https://stevecollins-demos-dev.outsystemscloud.com/Waypoints/


i have it working if i input the string by hand(as a test), but i can't by using the serialize on a Coordinate List Local Variable


the Output of the serialize in this instance is:


[{"Lat":38.710327,"Lng":-9.176256},{"Lat":38.713240,"Lng":-9.173874},{"Lat":38.704123,"Lng":-9.168145}]


the API key and configurations are all good since i've been using this component for a few months now with no problems


I have the same issue, if I use Google Map "Coordinate" structure, the json does not have "Coordinate" -element in it and polyline cannot be drawn.

Hello guys!

I was with the same problem. What I did was create a list of records where each record was the type coordinate (the structure provided by Google). After it, I use this list as the data for JSON Serialize. Finally, my input for the Polylines are: MapId (you get from the widget) and the JSON the output of JSON Serialize.

I hope to help you.