https://github.com/anzhi0708/svelte-5-leaflet-example
An Example of Drawing a Map with Svelte + Leaflet
https://github.com/anzhi0708/svelte-5-leaflet-example
css example example-code example-project geocoding geolocation hello-world leaflet leafletjs map npm svelte svelte-template sveltekit
Last synced: 3 months ago
JSON representation
An Example of Drawing a Map with Svelte + Leaflet
- Host: GitHub
- URL: https://github.com/anzhi0708/svelte-5-leaflet-example
- Owner: anzhi0708
- Created: 2024-01-10T13:10:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T13:24:46.000Z (about 2 years ago)
- Last Synced: 2024-01-25T22:15:45.913Z (about 2 years ago)
- Topics: css, example, example-code, example-project, geocoding, geolocation, hello-world, leaflet, leafletjs, map, npm, svelte, svelte-template, sveltekit
- Language: JavaScript
- Homepage:
- Size: 952 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Svelte 5 - Leaflet.js Example

An Example of Drawing a Map with Svelte + Leaflet
## Key Points
- You need to place the `map`'s initialization in the `onMount` hook to ensure that `Leaflet` is rendered on the client side, not the server side.
- Also, you need to import the `leaflet/dist/leaflet.css` file and specify the element's `height` in the `` block in order for the map to display correctly.