require(["esri/smartMapping/renderers/support/rendererUtils"], (rendererUtils) => { /* code goes here */ });
import * as rendererUtils from "@arcgis/core/smartMapping/renderers/support/rendererUtils.js";
esri/smartMapping/renderers/support/rendererUtils
This module provides a function for regenerating renderers based on the current state of the layer and view. This is useful when you want to update a renderer based on changes to the layer's data, the data visible in the view, binning configuration, or the view's scale.
- See also
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<Renderer> | Regenerates the renderer for a layer based on the current state of the layer and view. | rendererUtils |
Method Details
-
regenerateRenderer
regenerateRenderer(params){Promise<Renderer>}
-
Regenerates the renderer for a layer based on the current state of the layer and view.
ParametersSpecificationparams ObjectAn object containing the following properties.
Specificationlayer FeatureLayerThe layer for which to regenerate the renderer.
view MapViewThe view in which the layer is rendered.
renderer RendereroptionalThe renderer to update. If not provided, the renderer will be derived from the layer or feature reduction object.
forBinning BooleanoptionalIndicates whether to regenerate the binning renderer or the renderer set on the layer.
filter FeatureFilteroptionalWhen defined, only features included in the filter are considered in the attribute and spatial statistics calculations when determining the final renderer. This is useful when a lot of variation exists in the data that could result in undesired data ranges. A common use case would be to set a filter that only includes features in the current extent of the view where the data is most likely to be viewed. Currently, only geometry filters with an
intersects
spatial relationship are supported. All other filter types (includingwhere
) are ignored. This parameter is only supported whenforBinning
isfalse
.ReturnsType Description Promise<Renderer> Returns a promise that resolves with the updated renderer.