We have found this issue where if have multiple layers (including a vector layer) on the map and if we do the following, the current map extents are not applied to the vector layer:
Here is a JS fiddle where you can try this out: JSFiddle
Is there a workaround/fix to this issue?
As we require multiple layers that can be enabled/disabled on the map for our project, it is critical for our project that we get this working.
Solved! Go to Solution.
This would be a bug in 4.0. You can currently work around the issue by setting the view.extent to itself immediately after setting the visibility.
on(layersElement, ".layers-item:click", function(e) { var node = document.querySelector(".layers-item"); node.classList.toggle("visible-layer"); tileLyr.visible = !tileLyr.visible; // add this line view.extent = view.extent; });
Thanks!
This would be a bug in 4.0. You can currently work around the issue by setting the view.extent to itself immediately after setting the visibility.
on(layersElement, ".layers-item:click", function(e) { var node = document.querySelector(".layers-item"); node.classList.toggle("visible-layer"); tileLyr.visible = !tileLyr.visible; // add this line view.extent = view.extent; });
Thanks!
Thank You! That worked!