SSR-safe setup
Leaflet runs only on the client, so the map initializes inside `onMount`.
SSR-safe map initialization with cleanup, icon fixes, and a lightweight default tile layer.
Preview
Initialized on the client with `onMount`, cleaned up on destroy, and configured with OpenStreetMap tiles.
Leaflet runs only on the client, so the map initializes inside `onMount`.
The map removes itself when the component unmounts to avoid retained listeners.
Next step
Switch to a custom tile provider and inject your data-driven markers on load.