NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
42 stars 24 forks source link

Keep layer set as "hidden" when the layer fails to load #2466

Open robyngit opened 1 week ago

robyngit commented 1 week ago

Describe the bug When a layer in a Cesium map fails to load for some reason, e.g. there's a 404 error, we show a little warning sign next to the layer to indicate that there was a problem. However, the user is still able to toggle the layer and make it appear visible, even though it is not in fact visible on the map. They broken layer also shows up in the legend view, which might be confusing. I believe we used to prevent broken layers from being switched to visible, so this is probably a bug introduced somewhere in the last few releases.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://demo.arcticdata.io/portals/permafrost
  2. Click on the " Infrastructure 3D Tiles" layer in the layer list
  3. See that the icon on the left appears blue to indicate it's visible, even though the layer is not in fact visible

You can also reproduce locally by ensuring there's no Cesium token set, and trying to load any of the layers hosted on Cesium Ion

Expected behavior I think that the layer should remain set to "hidden" when it's not shown on the map

Screenshots

Screenshot 2024-06-24 at 1 57 55 PM