Estoy usando require.js
// output of polygonString is
// {"spatialReference":{"latestWkid":3414,"wkid":3414},"rings":[[[18240.432900000364,43817.389900000766],[18214.047899999656,43880.139900000766],[18303.02390000038,43896.1548999995],[18316.83990000002,43898.6389000006],[18331.732900000177,43815.97389999963],[18247.076899999753,43800.71189999953],[18240.432900000364,43817.389900000766]]]}
var polygon = JSON.parse($parameters.polygonString)
Estoy intentando convertir el objeto JSON en un objeto ESRI Polygon, he intentado lo siguiente:
(1)
//doesn't seems to work
var new_polygon = new window.ArcGIS.Polygon({
fromJSON: polygon
});
(2)
//return fromJSON is not a function
var new_polygon = new window.ArcGIS.Polygon();
console.log(new_polygon.fromJSON(polygon));
¿Cuál es la forma correcta de utilizar fromJSON?