mapbox-svelte

A Svelte component library for Mapbox GL JS, providing easy-to-use components for building interactive maps.

Installation

npm i @napxdd/mapbox-svelte

Usage

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

Requirements

  • Svelte 5.0+
  • Mapbox GL JS 3.13.0+

License

MIT

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes