Select to view content in your preferred language

Issue with JS API 4.11 ImageryLayer redraw()

4290
3
06-04-2019 06:08 PM
MatthewLangley
Emerging Contributor

Hi,

 

I've been using the Javascript 4.11 API and one of the primary use cases is to consume images from an ImageServer and perform client side filtering. This is a very similar use case in the v3 API sample (3), and has been previously implemented. The updated application is now using the Javascript 4.11 API and I found that the ImageryLayer redraw() function doesn't update the canvas with the newly filtered data (it does in fact run the pixelfilter). This has been causing quite a bit of grief as it is a core requirement and we also need to avoid caching of the images (as they're time enabled and update very often). 

 

I've linked to a minimal example showing this issue in (1), just download the pastebin and open the html. It's based off the Javascript 4 pixelfilter example, but extended to match our use case and the v3 api's sample more closely.

 

I suspect either there is a simple fix to this I'm missing, or is it a bug in the API. Hopefully someone here can clarify.

 

1) Minimal Example showing issue

https://pastebin.com/Fs0WFWzd 

 

2) Base Sample from Javascript API 4

https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-pixelvalues/index.html

 

3) Similar Use case in Javascript API 3

https://developers.arcgis.com/javascript/3/samples/layers_raster/ 

 

 

Thankyou in advance

0 Kudos
3 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

We have verified that it is a bug in the API. Thank you for bringing this issue to our attention. We will get it fixed as soon as possible. 

Thanks,

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

This issue will be fixed at JS API version 4.12 which will be released beginning of July.

JohnGrayson
Esri Regular Contributor

...for 4.11, this is the workaround I've previously used:

//layer.redraw();
 view.extent = view.extent;
0 Kudos