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?
ArcGIS API for JavaScript Sandbox
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,
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.
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?
Have you seen the circle geometry class?
https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.