Hi,
I have a polygon geometry and am trying to get the centroid. im using "esri/geometry/Polygon" Property:centroid
When I run the code the centroid is located outside the polygon.
here is part of some test code I wrote to as a check:
var polygon = new Polygon ({
rings: [[[153.01608192200001,-27.474277019999988],[153.01597542299999,-27.47412221899998], [153.01636757699998,-27.473908833999985],[153.01647393400003,-27.474062405999973],[153.01608192200001,-27.474277019999988]]],
spatialReference: {wkid: 4283}
});
var pointGraphic = new Graphic({
geometry: polygon.centroid,
symbol: markerSymbol,
spatialReference: {wkid: 4283}
});
var polygonGraphic = new Graphic({
geometry: polygon,
symbol: fillSymbol
});
view.graphics.addMany([pointGraphic, polygonGraphic]);
is there somthing im doing wrong.
attached is the point and the poly.