arcgis javascript imagery layer refresh method

Discussion created by PuckettD on Jan 27, 2018
Latest reply on Jan 29, 2018 by jgrayson-esristaff

As of version 4.6, the arcgis javascript API does not support a refresh method on a layer in a 3D scene view (only supported in 2D map view). See 'Known Limitations' here

ImageryLayer | API Reference | ArcGIS API for JavaScript 4.6 


So I thought I'd share what I've found as a workaround. You simply set the layer visibility to false then set a zero length timer to set it back to true (it does not work to set it back to true without the timeout, for whatever reason).


A sample:

activeImageryLayer.visible = false;

window.setTimeout(function() { activeImageryLayer.visible = true; }, 0);


The downside here is that it does visibly 'flicker' the layer when it is turned off. This is acceptable for my project but is still a little janky.


I'd be interested to hear what others have implemented as a workaround for this glaring omission from the API.