Hi,
I want to update the cluster radius using a slider in esri api 4.15. Any references
You can use the provided Slider widget with the API, clone the FeatureReductionCluster, and update the clusterRadius.
slider.on(
"thumb-drag",
({ value, state }) => {
if (state !== "stop") return;
const fr = layer.featureReduction.clone();
fr.clusterRadius = value;
layer.featureReduction = fr;
}
);
https://codepen.io/odoe/pen/JjXoaNX?editors=1000
If you try to do it on each tick change, even if you debounce the function, you get some artifacts along the tiles of the cluster calculations. Better to wait for the slider to stop and then update.
Thanks Rene Rubalcava Seems a nice one, will check on this. By the way, dorefresh() on featureReduction is not working(the method which i tried - assigned the new clusterRadius value to the layer and initiated doRefresh()).