[OutSystems Maps] Coordinate (latitude longitude) text list
outsystems-maps
Forge component by Platform Maintenace
Application Type
Reactive

What is the exact notation of a coordinate (latitude longitude) list for the attribute locations of the Shapes/Polyline?

I have tried "52.1551744,5.38720621" and "52.1551744 5.38720621", but I don't see the polyline.

I have also rebuild the example of Boston, and that one is also not working.


Hello @Jan Hidding,

Thank you for the clarification. Could you please tell me the version number of the component that you are using?

That Data Action might be delaying the creation of the element from the google maps Polyline shape. Have you tried using an If block around the Polyline? You could use the IsDataFetched boolean value from the Data Action as a validation. 

Regarding the auto-zoom, you are correct, right now that feature is only taking into account the markers from the map. We are going to take a look at this functionality that you are asking and I will let you know how to proceed if there are any updates regarding this topic.

Right now, I would suggest the following workaround to solve the issue on the auto-zoom:

(In attachment, you can find a sample OML with this implementation.)


1) On the Map_Initialized event, add a new handler (MapLoaded) 

2) Inside the new handler, add a new JS block.

var bounds = new google.maps.LatLngBounds();

MapAPI.ShapeManager.GetShapeById($parameters.ShapeId).providerPath.forEach(function(point){

    bounds.extend(point);

}); 

MapAPI.MapManager.GetMapById($parameters.MapId).provider.fitBounds(bounds);

Please bear in mind that we didn't make all the necessary tests to ensure that it will work on all cases.

Please let us know if this helps.

 

Best regards,

Tiago Pereira

PolylineCoords.oml

Hello Jan Hidding,

Thanks for bringing this subject to the discussion.

Could you have a look at the sample that was provided by @Márcio Carvalho and check if it meets your expectations? Also, make sure you are providing two or more locations to the list of locations of the polyline.

Hope this answer is useful.

Best regards,

Tiago Pereira

Hello @Tiago Miguel Pereira,

Thanks for your answer. The polyline is working when i put the coordinates hardcoded to the locations attribute or when i filled it hardcoded in a text list variable in the OnInitialize. But when i filled it in a data action, it will not show up on the map. Also the auto zoom functionality of the map is not working with the polyline, that's why i didn't see it before, but it was there.

In the pictures below, the markers are filled with a data action and the map is refreshed when the markers are fetched. Also the auto zoom functionality of the map is working on the marker list.

Below the text list variable is filled hardcoded in the OnInitialize.

Below the text list variable is filled with a data action, but the polyline is not visible on the map.

Maybe you can help me with this. I also looked at the sample application, but there it is also hardcoded and the zoom is fixed on Entities.Zoom.Zoom13.

Best regards,

Jan Hidding




Hello @Jan Hidding,

Thank you for the clarification. Could you please tell me the version number of the component that you are using?

That Data Action might be delaying the creation of the element from the google maps Polyline shape. Have you tried using an If block around the Polyline? You could use the IsDataFetched boolean value from the Data Action as a validation. 

Regarding the auto-zoom, you are correct, right now that feature is only taking into account the markers from the map. We are going to take a look at this functionality that you are asking and I will let you know how to proceed if there are any updates regarding this topic.

Right now, I would suggest the following workaround to solve the issue on the auto-zoom:

(In attachment, you can find a sample OML with this implementation.)


1) On the Map_Initialized event, add a new handler (MapLoaded) 

2) Inside the new handler, add a new JS block.

var bounds = new google.maps.LatLngBounds();

MapAPI.ShapeManager.GetShapeById($parameters.ShapeId).providerPath.forEach(function(point){

    bounds.extend(point);

}); 

MapAPI.MapManager.GetMapById($parameters.MapId).provider.fitBounds(bounds);

Please bear in mind that we didn't make all the necessary tests to ensure that it will work on all cases.

Please let us know if this helps.

 

Best regards,

Tiago Pereira

PolylineCoords.oml

Hello @Tiago Miguel Pereira,

With the if statement around the polyline it works. Thanks for this solution.

I am using version 1.4.0.

Best regards,

Jan Hidding

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