AnsweredAssumed Answered

How to remove a renderer from FeatureLayer?

Question asked by ibroad on Jan 15, 2020
Latest reply on Jan 15, 2020 by rscheitlin

I want to have a render to exaggerate the symbology at a very small scale so the features can be seen, but when the zoom level gets above 14,  I want to switch back to the regular map service symbology.

 

watchUtils.watch(view, "zoom", function(zoom){

    if (zoom > 14) {
        map.remove(featureLayer);
        featureLayer.renderer = null;
        map.add(featureLayer);
    }
});

watchUtils.watch(view, "zoom", function(zoom){

    if (zoom > 14) {

        featureLayer.renderer = null;
        featureLayer.refresh()
    }
});

 

I've tried both of these approaches just to see if it works, but neither worked - the renderer still persisted.

 

Any idea how I can remove the renderer?

Outcomes