AnsweredAssumed Answered

Hide/Show graphic with 4.3 API

Question asked by cmbrule on May 16, 2017
Latest reply on Sep 1, 2017 by TSolow-esristaff

3.2 has a hide and show method for a graphic. Is there a way to do this with the 4.3 API? I've tried setting the visible property to false but the features still show on the map. What is the proper way to do this?

 

 

Example of how I'm trying to hide certain graphics based on attribute. All features still show on map.

 

    view.whenLayerView(layerID).then(function (lyrView) {
        lyrView.watch("updating", function (val) {
            if (!val) {
                lyrView.queryFeatures().then(function (results) {
                    for (var i = 0; i < results.length; i++) {
                        if (results[i].attributes.dow = "Tuesday") {
                            results[i].visible = false;
                        }            
                    }
                });
            }
        });
    });

Outcomes