AnsweredAssumed Answered

How to separate the longitude and latitude and store them in different variables??

Question asked by siyakubeka on Jul 4, 2020
Latest reply on Jul 10, 2020 by rscheitlin

Hi All,

 

I need help with separation the latitude and longitude. I am drawing a polygon and getting the coordinates of each vertex of the polygon. This is what I have done to separate the coordinates but it is not working:

 

for (var i = 0; i < gra.geometry.rings.length; i++){
for (var p = 0; p < gra.geometry.rings[i].length; p++){
crmLatitude = String(gra.geometry.rings[i][p].getLatitude());
crmLongitude = String(gra.geometry.rings[i][p].getLongitude());
var LatLon = String(gra.geometry.rings[i][p]);
console.log(LatLon);
latlon = LatLon;

}

 

The error that I get when I debug I get an error that states that getLatitude() is not a function.

Please assist.

 

Kind Regards

Siyabonga Kubeka

Outcomes