I am aware how to iterate through the graphic.geometry.rings to get each x/y coordinate. However, this yields massive numbers that are obviously not lat/lon values. I have found quite a few examples of people asking the same or very similar questions, but none seem to yield an actual lat/lon result. I only get something like the below for each vertex:
Array [ -12390508.031742427, 3819480.562610634 ]
Assume those are WebMercator, so you can run the polygon through the webmercatorUtils first.
Thanks a million for this!
I spent an entire trying to figure out how to get these converted.
var geo = webMercatorUtils.xyToLngLat(graphic.geometry.rings[i][p][0], graphic.geometry.rings[i][p][1]);
console.log("Lon: "+ geo[0] +", Lat: "+ geo[1]);
You could do the whole thing first too
const latLonPolygonGeometry = webMercatorUtils.webMercatorToGeographic(graphic.goemetry);
Then go over the rings.
Lots of options!