geomoose/gm3

Add catch error for undefined layers in mapbook

Closed this issue · 2 comments

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 - #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.

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.

Fixed by #875