I am trying to add and display graphics to a map post load.
My code is able to add it to the graphicslayer, and it advises me that it has added it.
Yet it doesn't show it on the map.
I've just spent over a day on documentation and i cannot figure it out.
watchUtils.on(this.graphicsLayer, "graphics", "change", () => {console.log('Graphics added!');});
let polygon = {
type: "polygon", // autocasts as Polygon
rings: this.fromLATLONGtoXY(bigPolygon),
};
const simSymbol = {
type: "simple-fill",
color: [138, 43, 226, 0.5],
style: "solid",
outline: {
color: "blue",
width: 1
}
}
let graphic = new Graphic({
geometry: polygon as Polygon,
symbol: simSymbol
});
this.graphicsLayer.add(graphic);
After running the function i get a "Graphics added!" in console, but no graphic is shown on map.