Skip to content

MapBox migration guide

This part of the docs is dedicated to the migration from mapbox-gl to mapvina-gl.

The overall migration happens by uninstalling mapbox-gl and installing mapvina-gl in your node packages (or see below for CDN links), and replacing mapboxgl with mapvinagl in your code.

-    var map = new mapboxgl.Map({
+    var map = new mapvinagl.Map({

-    <button class="mapboxgl-ctrl">
+    <button class="mapvinagl-ctrl">

Compatibility branch

MapVina GL JS v1 is completely backward compatible with Mapbox GL JS v1. This compatibility branch (named 1.x) is tagged v1 on npm, and its current version is 1.15.3.

MapVina GL JS is distributed via unpkg.com.

-    <script src="https://api.mapbox.com/mapbox-gl-js/v#.#.#/mapbox-gl.js"></script>
-    <link
-      href="https://api.mapbox.com/mapbox-gl-js/v#.#.#/mapbox-gl.css"
-      rel="stylesheet"
-    />


+    <script src="https://unpkg.com/mapvina-gl@#.#.#/dist/mapvina-gl.js"></script>
+    <link
+      href="https://unpkg.com/mapvina-gl@#.#.#/dist/mapvina-gl.css"
+      rel="stylesheet"
+    />
Sample style URL:

style: 'https://static.mapvina.com/demotiles/style.json'

Don't forget to replace the version above #.#.# with the version you would like to use.