AnsweredAssumed Answered

lat/lng from drawn polygon points

Question asked by rojord on May 15, 2014
Latest reply on May 15, 2014 by JGravois-esristaff
I am trying to use the drawing tools to draw a polygon then I would like to retrieve the lat/lng from the points within that polygon in decimal degrees, but they look like this "4630405.768019022; -10001973.29985807", how do I get the decimal degrees lat/lngs?  Here is my JS code I am using to get the values.


toolbar.on("draw-end", addTest);  function addTest(evt) {  var poly = new Polygon(evt.geometry);         for (var i = 0; i < poly.rings.length; i++)         {          var points = poly.rings[i];          for (var j = 0; j < points.length; j++)          {           var point = poly.getPoint(i, j);           console.log(i + ' || ' + point.getLatitude() + "; " + point.getLongitude());           }          } }

Outcomes