@geoql/v-mapkit
v1.0.0
Published
Vue 3 components for Apple MapKit JS - annotations, overlays, Look Around, search & geocoding, with full TypeScript support
Maintainers
Readme
@geoql/v-mapkit 🌎
⚠️ Note ⚠️ This project is still under heavy development and is missing features. Contributions are welcome!
Power of Vue 3 with awesomeness of Mapkit!
Features
- 💪 Built with TypeScript.
- 🌠 Built with the all new Vue 3
Table of Contents
Installation
pnpm add @geoql/v-mapkit @vueuse/core vueUsage
Drop a <VMap> into your template and nest annotations or overlays as child
components. You need an Apple MapKit JS JWT token; see Apple's
MapKit JS docs for
generating one.
<script setup lang="ts">
import { VMap, VMarkerAnnotation } from '@geoql/v-mapkit';
</script>
<template>
<VMap :access-token="token">
<VMarkerAnnotation
:coordinates="[37.3349, -122.009]"
:annotation="{ title: 'Apple Park' }"
/>
</VMap>
</template>Prefer global registration? Install the default plugin:
import { createApp } from 'vue';
import VMapkit from '@geoql/v-mapkit';
createApp(App).use(VMapkit).mount('#app');API
Components
VMap— the map container. Props:access-token(required),version,language,init-options,map-options. Emits:map,map-loaded,map-initialized,map-destroyed, plus MapKit map events (region, rotation, scroll, zoom, select, drag, user-location, tap, etc.).VMarkerAnnotation,VImageAnnotation— annotations. Takecoordinatesplus their MapKit options.VCircleOverlay,VPolygonOverlay,VPolylineOverlay,VTileOverlay— overlays. Takecoordinatesplus their MapKit options.
Composables
loadMapKit/initMapKit— load and initialize the MapKit JS runtime.useMapChild— register an annotation or overlay with its parentVMap.
Build Setup
# install dependencies
$ pnpm install
# start the Vite playground (local dev sandbox)
$ pnpm run dev
# package the library
$ pnpm run build
# run the docs site locally
$ pnpm run docs:devBuilt with
Contributing
- Fork it ( https://github.com/geoql/v-mapkit/fork )
- Create your feature branch (
git checkout -b feat/new-feature) - Commit your changes (
git commit -Sam 'feat: add feature') - Push to the branch (
git push origin feat/new-feature) - Create a new Pull Request
Note:
- Please contribute using GitHub Flow
- Commits & PRs will be allowed only if the commit messages & PR titles follow the conventional commit standard, read more about it here
- PS. Ensure your commits are signed. Read why
License
MIT © Vinayak Kulkarni
