Select to view content in your preferred language

Heatmaps - How to reference all the data, not just the view

198
4
a month ago
AndrewMurdoch1
Occasional Contributor II

Good Day

I have a large network that I want to view as a heatmap.   I have the following heatmap render settings:

const heatmapParams = {
    layer: layer,
    view: view,
    field: field,
    colorStops: this.colourStops,
};

heatmapRendererCreator.createRenderer(heatmapParams).then((response) => {
    this.heatmapRenderSetting = response.renderer.clone();
    r(this.heatmapRenderSetting)
}).catch((error) => {
    console.log('Error');
    console.log(error);
    j(error);
})

 

If I'm zoomed out and view the data, the heatmap looks great, the problem, if I load the map being zoomed in with no data in the view, the heatmap is completely washed out.    Is there a way to generate the heat map using the data in the map view, what's in the current view extent?  Or, can I set the zoom dynamically before loading the Heatmap, so the data is in the view?

Thanks

0 Kudos
4 Replies
AndrewMurdoch1
Occasional Contributor II

Good Afternoon

Thanks for the suggestion, but I don't think that works with a dynamic renderer.  I found a way to get the view to zoom to the layer extent, but now when zooming in everything goes too far the other way and disappears.

Thanks

0 Kudos
KristianEkenes
Esri Regular Contributor

> Is there a way to generate the heat map using the data in the map view, what's in the current view extent?

This is how this method works. It only takes into account what is in the view.

> if I load the map being zoomed in with no data in the view, the heatmap is completely washed out. 

That's because there is no data in the view. You will only see anything meaningful if you zoom to the area where you have data and want to create a heatmap.

Or, can I set the zoom dynamically before loading the Heatmap, so the data is in the view?

Yes. You can set this with the goTo method or by setting the view extent.

AndrewMurdoch1
Occasional Contributor II

Good Day

Thanks for the reply, I ended up calling goTo() to "zoom out", which allows the data to render properly. 

Thanks

0 Kudos