let heatmapslider: any = undefined;
//<label class="form-label">Heat Map Slider</label> Heat Map Slider
let divtofind = Array.from(document.querySelectorAll('label'))
.find(el => el.textContent === 'Heat Map Slider');
divtofind!.insertAdjacentHTML('afterend', '<div class="esri-heatmap-slider-div-outer" id="' + uniqueDivId +'"></div>');
if(heatmapWidgetFind){
(heatmapWidgetFind as __esri.Widget).destroy();
}
heatmapslider = new HeatmapSlider({
stops: DEFAULT_STOPS
});
// Typical usage
heatmapslider.container = uniqueDivId;
heatmapWidgetFind = heatmapslider;
// when the user slides the handle(s), update the renderer
// with the updated color stops
heatmapslider.on(["thumb-drag","thumb-change"] , function() {
const heatmapLayer = inputLayer as __esri.FeatureLayer;
if(heatmapLayer){
const renderer = (heatmapLayer?.renderer as __esri.HeatmapRenderer).clone();
renderer.colorStops = DEFAULT_STOPS as __esri.HeatmapColorStop[];
heatmapLayer.renderer = renderer;
}
});
Thanks