Skip to content

Vue3 MapLibre GLInteractive Maps for Vue 3

10+ components, 15+ composables, full TypeScript support β€” build production-ready maps in minutes

Quick Start ​

bash
bun add vue3-maplibre-gl
bash
npm install vue3-maplibre-gl
bash
yarn add vue3-maplibre-gl
bash
pnpm add vue3-maplibre-gl
vue
<template>
  <Maplibre :options="mapOptions" style="height: 500px">
    <GeoJsonSource :data="geoJsonData">
      <FillLayer :style="fillStyle" />
      <CircleLayer :style="circleStyle" />
    </GeoJsonSource>
    <Marker :lnglat="[0, 0]" :draggable="true" />
  </Maplibre>
</template>

<script setup>
import { ref } from 'vue';
import { Maplibre, GeoJsonSource, FillLayer, CircleLayer, Marker } from 'vue3-maplibre-gl';
import 'vue3-maplibre-gl/dist/style.css';

const mapOptions = ref({
  style: 'https://demotiles.maplibre.org/style.json',
  center: [0, 0],
  zoom: 2,
});

const geoJsonData = ref({
  type: 'FeatureCollection',
  features: [
    { type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0] }, properties: {} },
  ],
});

const fillStyle = ref({ 'fill-color': '#088', 'fill-opacity': 0.8 });
const circleStyle = ref({ 'circle-radius': 6, 'circle-color': '#007cbf' });
</script>

Why Vue3 MapLibre GL? ​

Feature
Vue 3 NativeBuilt for Composition API with full reactivity
Self-Containedmaplibre-gl bundled β€” one install, zero peer deps
SSR SafeWorks with Nuxt SSR/SSG without configuration
Type SafeComprehensive TypeScript definitions and event handler types
Zero LeaksFactory-based cleanup with defense-in-depth patterns
Tiny FootprintTree-shakeable β€” import only what you use

Released under the MIT License.