This sample demonstrates how to apply a featureEffect to an instance of a FeatureLayer. FeatureEffect is used to draw attention features of interest by highlighting the features that meet the filter requirements or by dimming the features that do not meet the filter requirements.

In this sample, the arcgis-slider-histogram-range component uses bins generated with the histogram() statistics function to highlight block groups in Phoenix, AZ that fall within the age range specified by its thumb values. As users move the thumbs, the application updates the filter property of the layer’s featureEffect and applies the following included and excluded effects.

// this function is called when the map is loaded
// and when user changes the histogram range slider thumbs
function applyFeatureEffect(layer, where) {
layer.featureEffect = {
filter: { where },
includedEffect: "bloom(0.9 0.6pt 0)",
excludedEffect: "blur(2.25pt) opacity(0.5)",
};
}
2DFeatureLayerFeatureEffectfiltercommon-componentsviewOnReadyarcgis-expandarcgis-legendarcgis-maparcgis-slider-histogram-rangearcgis-zoommap-components