Skip to content

Naimikan/vue2-mapboxgl-component

Repository files navigation

version license

vue2-mapboxgl-component | Wiki

VueJS component for Mapbox GL

Installation

NPM

npm install vue2-mapboxgl-component --save

Usage

<template>
  <v-mapboxgl :access-token="accessToken"></v-mapboxgl>
</template>

<script>
  import vMapboxgl from 'vue2-mapboxgl-component'

  export default {
    data () {
      return {
        accessToken: '<YOUR_ACCESS_TOKEN>'
      }
    },

    components: {
      vMapboxgl
    }
  }
</script>

Developing

Install dependencies, build the source files and preview

# Clone repo
git clone https://github.com/Naimikan/vue2-mapboxgl-component.git

# Install dependencies
npm install

# Serve with hot reload at localhost:8080
npm run dev

# Build for production with minification
npm run build

For detailed explanation on how things work, consult the docs for vue-loader.