geomoose / gm3

GeoMoose 3.0 Development. Please submit pull requests to the 'main' branch.
https://www.geomoose.org
MIT License
58 stars 60 forks source link

Add catch error for undefined layers in mapbook #844

Open chughes-lincoln opened 1 year ago

chughes-lincoln commented 1 year ago

If there's an undefined layer in your map, the entire map will fail to load, rather than just that layer (similar to how the map wouldn't load if a layer was favorited that no longer exists - https://github.com/geomoose/gm3/issues/812).

This is most commonly an issue when the admin makes a typo adding a new layer, and the name in the catalog doesn't match the name in the map-source.

This is more of an issue if you're trying to remove a layer that already exists. For example, if I have the demo open and the admin removes the parcels layer, refreshing my browser causes the catalog, map, and toolbar to not load. In this case there's also no obvious way for the user to fix the issue because the Start Over button doesn't load.

It would be very helpful if some sort of safety check could be added so that the undefined layer doesn't load, but the rest of the site works as expected.

klassenjs commented 1 year ago

And maybe a ! or something in the catalog next to the bad layer? Or maybe a console.error/console.warning with more info for the admin of what happened.