vue-mapkit

0.0.4 • Public • Published

vue-mapkit

A Vue library for Apple Mapkit. Inspired by thomas-alrek/MapkitVue.

Plugin doesn't contain any component wrappers. You should use mapkit directly.

Installation

# Yarn 
yarn add vue-mapkit
# or NPM 
npm install vue-mapkit --save

Usage

Initialization

Please follow the official MapkitJS documentation to setup your API credentials.

import Vue from 'vue'
import VueMapkit from 'vue-mapkit'
 
Vue.use(VueMapkit, {
    authorizationCallback(done) {
        // provide mapkit jwt here
        done(process.env.VUE_APP_MAPKIT_JWT)
    },
    // you can use options from mapkit documentation as well
    language: 'ja',
})

Draw a map

Now you can draw a map in a component.

import { createMapkit } from 'vue-mapkit'
 
export default {
  computed: {
      map_id() {
          return `map-${this._uid}`
      },
    },
    mounted() {
      createMapkit(this.map_id, { language: 'ja' }).then(map => {
        // use `map` to perform any changes
      })
    }
  }
 
}

Readme

Keywords

Package Sidebar

Install

npm i vue-mapkit

Weekly Downloads

63

Version

0.0.4

License

MIT

Unpacked Size

9.33 kB

Total Files

9

Last publish

Collaborators

  • progand