Svelte wrapper for the maplibre mapping library.
--- This library is functional, but I'm still experimenting with extra features to make advanced functionality easier to use. It also needs proper documentation. In the meantime, the [demo site](https://svelte-maplibre.vercel.app) includes code for all the examples, and is a good place to start. [Changelog](./CHANGELOG.md) ## Installation ``` npm install svelte-maplibre ``` ## Usage If you use Vite, import the MapLibre worker URL and set it before you create the first map: ```js import * as maplibregl from 'maplibre-gl'; import maplibreWorkerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'; maplibregl.setWorkerUrl(maplibreWorkerUrl); ``` The `?worker&url` import tells Vite to emit the worker as an asset. Call `setWorkerUrl` in the page component that creates the map or anything else that loads before the map. ```svelte