@unmap/vue
@unmap/vue
Vue 3 composables over @unmap/sdk: a map bound to a template ref, plus a reactive geocoder and
router. SSR-safe: the map is created on the client after mount, and the geocoder and router never
touch the DOM.
npm i @unmap/vue
<script setup lang="ts">
import { useUnmap } from '@unmap/vue'
import 'maplibre-gl/dist/maplibre-gl.css'
const { mapContainer, map, geocoder, router, ready } = useUnmap({
key: 'um_live_...',
center: [-114.07, 51.05],
})
</script>
<template>
<div ref="mapContainer" style="height: 400px" />
</template>
useUnmap(options) takes the same options as new Unmap() (minus container) and returns
mapContainer, map (a shallow ref, null until mounted), geocoder, router, and ready.
useGeocoder(options) and useDirections(options) wrap the standalone clients and expose
results / result, loading, and error refs that track the most recent call, alongside
the same methods as @unmap/geocoding (search, autocomplete, nearby, reverse) and
@unmap/routing (route, isochrone).
Stylesheet
MapLibre's CSS is needed for controls, attribution, markers, and popups. Import
maplibre-gl/dist/maplibre-gl.css once, near the root of your app. maplibre-gl arrives as a
transitive dependency; under pnpm's strict layout add it as a direct dependency so the import
resolves.
Nuxt users should install @unmap/nuxt, which
auto-imports these composables and reads the key from runtime config.
Requires Vue 3.4 or later. Docs: unmap.dev/docs.
Related Packages
Vue 3 components and composables for MapLibre GL JS - Build interactive maps wit...
A minimalist Vue component wrapping Mapbox GL or MapLibre GL dynamic maps!
Beautiful, production-ready map components for Vue.js. Built on MapLibre GL with...
Version History
| Version | Released | License |
|---|---|---|
| 0.21.0 | MIT | |
| 0.20.0 | MIT | |
| 0.19.0 | MIT | |
| 0.18.0 | MIT | |
| 0.17.0 | MIT | |
| 0.16.0 | MIT | |
| 0.15.0 | MIT | |
| 0.14.0 | MIT | |
| 0.13.0 | MIT | |
| 0.12.0 | MIT | |
| 0.10.0 | MIT | |
| 0.9.1 | MIT | |
| 0.9.0 | MIT | |
| 0.8.0 | MIT | |
| 0.7.0 | MIT | |
| 0.6.0 | MIT | |
| 0.5.0 | MIT | |
| 0.3.0 | MIT | |
| 0.2.0 | MIT | |
| 0.1.3 | MIT | |
| 0.1.2 | ||
| 0.1.1 | ||
| 0.1.0 | ||
| 0.0.3 | ||
| 0.0.2 | ||
| 0.0.1 |