Update/Refresh featureLayer when featureLayer heatmap renderer i.e. field, low/High value changed dynamically

1166
4
Jump to solution
01-05-2022 03:55 AM
ShefaliMantri
New Contributor III

Hello Team,

We are using ArcGIS javascript API 4.13.

In our project requirement is, ability to dynamically change field and low and high value of the heat map Renderer for the feature layer.

When we change the heat map Renderer (any above settings) then layer is not showing updated view. When we turn 'OFF' and again turn 'ON' the heat map toggle button then it is showing correct view.

Question - When heat map is ON and suppose we change field or Low/High value, then how layer show correct heat map effect on map without layer re-create or toggle heat map (ON/OFF).

We try layer refresh method although its not worked.

 

 

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

We had an issue with the HeatMapRenderer not updating when the renderer's field changed at runtime. This issue was fixed at version 4.16. So versions 4.16 and greater, the renderer should change whenever you update the renderer's field. 

Changing maxPixelIntensity/minPixelIntensity values at runtime always worked. I created this simple app for you to showcase that it is working at 4.22: https://codepen.io/U_B_U/pen/eYGjNZG?editors=1000

If you can't still get it to work then can you please provide me with a simple reproducible case?

 

Thanks,

-Undral

View solution in original post

4 Replies
Noah-Sager
Esri Regular Contributor

Hi @ShefaliMantri, the latest version of the API is 4.22. Which is quite a bit further along than 4.13. This issue may have been fixed at a previous release. Can you test with 4.22?

ShefaliMantri
New Contributor III

Thank you Noah, 

I tested to API 4.22 although issue still persist.

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

We had an issue with the HeatMapRenderer not updating when the renderer's field changed at runtime. This issue was fixed at version 4.16. So versions 4.16 and greater, the renderer should change whenever you update the renderer's field. 

Changing maxPixelIntensity/minPixelIntensity values at runtime always worked. I created this simple app for you to showcase that it is working at 4.22: https://codepen.io/U_B_U/pen/eYGjNZG?editors=1000

If you can't still get it to work then can you please provide me with a simple reproducible case?

 

Thanks,

-Undral

ShefaliMantri
New Contributor III

Thank you Undral,

It's working now. Previously without cloning renderer, I am directly trying to overwrite that's why it's not working.

0 Kudos