Skip to content

Vue3 MapTiler SDKInteractive Maps for Vue 3

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

Quick Start ​

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

<script setup>
import { ref } from 'vue';
import {
  MapTiler,
  GeoJsonSource,
  FillLayer,
  CircleLayer,
  Marker,
} from 'vue3-maptiler-gl';
import '@maptiler/sdk/dist/maptiler-sdk.css';
import 'vue3-maptiler-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 MapTiler SDK? ​

Feature
Vue 3 NativeBuilt for Composition API with full reactivity
Single Runtime@maptiler/sdk is a peer β€” one copy, on a version you pick
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