I want to create a 2d circle like in below example but I want it as static for showing the radius of point. However, I have no idea about how should I write to codes. How can I create a basic circle?
Kutay,
Have you seen the circle geometry class?
https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html
I don't understand of that example. I would like to create a simple 2d static circle just like point.
How can I add to map these ring polygon coordinates?
Kutay,
I’m not sure what is not to understand the Circle geometry takes a point and a radius and units and creates a 2D circle in the map. You add it to the views.graphics or a GraphicsLayer like you would any other Graphic.
var polygon = {
type: "polygon", // autocasts as new Polygon()
rings: [
[32.909550, 40.751906]
]
};
var fillSymbol = {
type: "simple-fill", // autocasts as new SimpleFillSymbol()
color: [227, 139, 79, 0.8],
outline: { // autocasts as new SimpleLineSymbol()
color: [255, 255, 255],
width: 1
}
};
var polygonGraphic = new Graphic({
geometry: polygon,
symbol: fillSymbol
});
view.graphics.add(polygonGraphic);
I understand the other graphics structure but I don't understand circle. Where did I wrong?
Kutay,
So the first part you have in your code where you define a polygon you need to use the Circle class instead and specify the radius, center and radiusUnits properties