drecchia/maplibre-layerlibre ? reverse-engineered prompt
Reverse engineered prompt
Build me a compact layer switcher for a MapLibre map that lets users change the base map and turn overlay layers on and off from a simple panel.
I want it to support a few base styles, grouped overlays, opacity sliders, and a clean dark themed UI that works well on smaller screens. Some overlays should be able to load only when the user first turns them on, and if that loading fails, show an error state with a retry option. It should also save the user’s choices in the browser so the map comes back the same way next time.
Please make it easy to plug into a MapLibre GL JS map, and let overlays work with deck.gl layers too. If an overlay needs the map to move somewhere when it is turned on, that should work as well. Expose simple events or callbacks so I can react when the base layer or overlays change. If you need current library docs, look them up online.
Are you gonna build this?
make sure you review the code using coderabbit