Hide graphics using ArcGIS JS API 4.7

336 views Asked by At

With ArcGIS JS API 4.7, is there a way to show/hide graphics per attribute? There is a property for the graphics called visible, but when I do set it to false myGraphic.visible = false no change occurs.

Any ideas? Thank you.

1

There are 1 answers

2
GeoAstronaute On

Can you share an example that reproduces your issue. I just did a test, and I do not see any problem with graphic visibility in v4.7. Here is an example plunkr:

Live example: Plunker

`function changeGraphicVisibility() {
      polygonGraphic.visible = !polygonGraphic.visible;
      var spanElement = document.getElementById("visibility");
      spanElement.innerHTML = polygonGraphic.visible;
    }....`