LeafletJS maps for the SvelteJS reactive framework
npm install svelte-leafletLeafletJS maps for the SvelteJS reactive javascript framework.
There's a small live demo at https://svelte.dev/repl/64f1f65db1e14f79b5261a5766914b5a?version=3.23.2
svelte-leaflet provides a set of Svelte components with a 1-to-1 correspondence to Leaflet classes. The design goal is that properties passed to components should mimic parameters the the constructor of their Leaflet counterpart, with some of those being reactive wherever possible. As of now:
* LeafletMap ←→ L.Map
* LeafletTileLayer ←→ L.TileLayer
* LeafletMarker ←→ L.Marker
* LeafletPopup ←→ L.Popup
e.g.:
``
options={{ attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA' }} />
{#if markerVisible}
{markerName}
{/if}
``