[OutSystems Maps] How to get Draw polygon coordinates?
Question
outsystems-maps
Reactive icon
Forge component by Platform Maintenance
Application Type
Mobile

Hi,

In Outsystems Maps,

I want to get Lat long while i Draw Polygon in Map. But in OutSystems Maps unable to get a Lat long output.
Just 3 values only  return 1.MaPwidgetId 2.PolygonId 3.IsNewPolygon.

Returned Values

I want to get 3 point of lat and long in output. But OutSystems Maps Only Returned Above values only.

Thanks,

Sathish R

Solution

Good Afternoon @Sathish Kumar R,

Thanks for your feedback, this is a use case that we will discuss in the future. 
In the meanwhile I found a workaround for you.

On the OnDrawingChange you can reach the coords via JavaScript:
MapAPI.MapManager.GetMapById([Your_MapId]).shapes.filter(function(shape){return shape && shape._uniqueId === [Your_PolygonId]})[0].config.locations

Let me know if this helps you,

Best Regards,
João Ferreira

Sample_Reactive_GetPolygonCoords.oml

Hello Sathish, 

Try using the GetShapePath Action and pass it the Widget id you get from the OnChange event. 

Hope it helps!

Paulo Rosário

Hi Paulo Rosário,

I am already tried. GetShapePath Action Use For Shapes flow . Because below blocks only return ShapeId.

In my case returned below parameters only.


Solution

Good Afternoon @Sathish Kumar R,

Thanks for your feedback, this is a use case that we will discuss in the future. 
In the meanwhile I found a workaround for you.

On the OnDrawingChange you can reach the coords via JavaScript:
MapAPI.MapManager.GetMapById([Your_MapId]).shapes.filter(function(shape){return shape && shape._uniqueId === [Your_PolygonId]})[0].config.locations

Let me know if this helps you,

Best Regards,
João Ferreira

Sample_Reactive_GetPolygonCoords.oml

Hi João Ferreira,

Thanks For the Solution  :-) 

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