# Quickstart

# Using as ES module

# Installation

You can install v-mapbox via npm. Take note that you need to install mapbox-gl as peer dependency:

npm install --save v-mapbox mapbox-gl

Add Mapbox JS and CSS files to the files where you need them:

import 'mapbox-gl/dist/mapbox-gl.css'
import Mapbox from "mapbox-gl"
import { MglMap } from "v-mapbox"

# Using in browser

# Installation

Add Vue, MapboxGL and v-mapbox scripts on your page:

<!DOCTYPE html>
    <!-- ... -->
    <!-- Mapbox GL CSS -->
    <!-- v-mapbox CSS -->
    <!-- Mapbox GL JS -->
    <script src="https://api.tiles.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.js"></script>
    <!-- VueJS -->
    <script src="https://cdn.jsdelivr.net/npm/vue@latest/dist/vue.min.js"></script>
    <!-- v-mapbox -->
    <!-- ... -->

All components will be placed in global VueMapbox object (VueMapbox.MglMap etc.)

# Migration from version 0.1.x

In version 0.2 you don't need to register VueMapbox as Vue plugin.

So you don't need this code anymore:

import VueMapbox from "v-mapbox";
import Mapbox from "mapbox-gl";

Vue.use(VueMapbox, { mapboxgl: Mapbox });

Now you're ready for mapping. See how to create a map.