AnsweredAssumed Answered

api 4.x geometry fromJson

Question asked by sanmolhec on May 28, 2018
Latest reply on May 29, 2018 by rscheitlin

Hi, there.

I'm having a problem representing a polygon with a different system spatial reference than the view.

 

I have a polygon in ESRI JSON format and when I try to paint it on the map I can't get it to appear, I do so:

 

 

 

let laSimbologia = ...;

let migeom = Polygon.fromJSON(esriJSON);

let elGrafico = new Graphic({
geometry: migeom,
symbol: laSimbologia
});
view.graphics.add(elGrafico);


When debugging the polygon looks well created and the spatialReference is the same as the one the ESRI JSON had, the execution ends correctly but does not paint the polygon.

 

Do I have to convert it to the CRS of the view beforehand? If so, what is fromJSON for?

 

Thank you very much.

Greetings, Hector.

Outcomes