Can anyone assist with understanding the issue of trying to draw a polygon using the ESRI ArcGIS Javascript API? The image, JSON string, and code snippets provided below outline the code, console output, and expected behavior. Any help would be greatly appreciated!
Here is the JSON String:
{"geometry":{"rings":[[[-91.89013671874848,38.03029444608522],[-91.653930664061,38.00865683368494],[-91.64843749999851,38.00432854459864],[-91.5935058593735,37.93070854451552],[-91.577026367186,37.88303274722063],[-91.577026367186,37.79192956603227],[-91.631958007811,37.73982010276601],[-91.70886230468598,37.73547599031287],[-91.763793945311,37.76587942393493],[-91.85168457031098,37.85701474874939],[-91.88464355468598,37.9956711998967],[-91.89013671874848,38.03029444608522]]],"spatialReference":{"wkid":4326}},"symbol":{"color":[0,0,0,64],"outline":{"color":[0,0,0,255],"width":1,"type":"esriSLS","style":"esriSLSSolid"},"type":"esriSFS","style":"esriSFSSolid"}}
Below is the Code snippet used to add Shape to Map:
function createFromJSON(JSONText){
console.log("In Create Function");
dojo.disconnect(handle);
var jsontext = JSON.parse(JSONText);
var polygon = new esri.geometry.Polygon(jsontext);
console.log("Here is the polygon object:");
console.log(polygon);
console.log("Now drawing polygon");
map.graphics.add(new Graphic(polygon, new SimpleFillSymbol()));
console.log("Polygon should be there");
}