https://github.com/kayoshi-dev/svelte-leaflet
Svelte components to use with Leaflet
https://github.com/kayoshi-dev/svelte-leaflet
components leaflet mapbox svelte sveltekit
Last synced: 3 months ago
JSON representation
Svelte components to use with Leaflet
- Host: GitHub
- URL: https://github.com/kayoshi-dev/svelte-leaflet
- Owner: Kayoshi-dev
- License: mit
- Created: 2024-02-03T00:18:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-05T09:13:47.000Z (over 2 years ago)
- Last Synced: 2026-03-31T09:52:02.954Z (3 months ago)
- Topics: components, leaflet, mapbox, svelte, sveltekit
- Language: Svelte
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Svelte-leaflet
Leaflet components bindings for Svelte !
## Installation
Install svelte-leaflet with your favorite package manager
```bash
npm install @kayoshi-dev/svelte-leaflet leaflet
```
## Features
- Map
- TileLayer
- Marker
- And more to come!
## Documentation
> [!NOTE]
> This is still a WIP. API might change.
```ts
import { MapContainer, Marker, TileLayer } from '@kayoshi-dev/svelte-leaflet';
```
For the moment only three components are available :
### MapContainer
This is the main component that will help you create your interactive map.
**All the other components should be used inside the body of that component.**
> [!IMPORTANT]
> Must be used with the component!
#### Props
- Center (mandatory)
- Zoom
- Zoom Options (an object that contains all the additionals properties you can add)
Usage :
```ts
```
### TileLayer
This component allows you to define the tile layer you would like to use.
#### Props
- Attribution (mandatory)
- Url (mandatory)
- TileLayerOptions
Usage :
```ts
OpenStreetMap contributors" url="https://tile.openstreetmap.org/{z}/{x}/{y}.png" />
```
### Marker (WIP)
Add one or multiple markers on your map
#### Props
- Latlng (mandatory)
- PopupText
- MarkerOptions
Usage :
```ts
```
## Authors
- [Kayoshi-dev](https://www.github.com/kayoshi-dev)