Leafletjs-svelte
Svelte component for LeafletJS.
- Written in TypeScript.
- Supports skipping initializing Leaflet in SSR environments but instead only hydrate maps on the client-side.
- Vector drawing support (coming soon...)
Installation
Node 16 or higher is required.
$ npm install leaflet leafletjs-svelte
Import stylesheet for Leaflet in your app entry point:
import 'leaflet/dist/leaflet.css';
Component Import:
<script>
import { Leaflet } from 'leafletjs-svelte';
</script>
Components:
UI layers:
- [x] Marker
- [x] Popup
- [x] Tooltip
Raster layers:
- [x] TileLayer
- [x] TileLayer.WMS
- [x] ImageOverlay
- [x] VideoOverlay
Vector layers:
- [x] Polyline
- [x] Polygon
- [x] Circle
- [x] CircleMarker
- [x] Rectangle
Other layers:
- [x] LayerGroup
- [x] FeatureGroup
- [x] GeoJSON
Supported Plugins:
Vector Drawing:
- [x] Circle
- [x] CircleMarker
- [x] Marker
- [x] Polyline
- [x] Polygon
- [x] Rectangle
- [ ] Multi-Rectangle