A Svelte component library for Mapbox GL JS, providing easy-to-use components for building interactive maps.
npm i @napxdd/mapbox-svelte
Add your mapbox key to env
PUBLIC_MAPBOX_KEY=your_key
<script>
import * as Mapbox from 'mapbox-svelte';
let mapComponent: Mapbox.Container;
</script>
<div class="map-container">
<Mapbox.Container></Mapbox.Container>
</div>
<style>
.map-container {
width: 100%;
height: 500px;
}
</style>
For more information visit Mapbox-svelte documentation
MIT