@mapcat/mapcat-glpublic
Mapbox GL JS
Mapbox GL JS is a Javascript & WebGL library that renders interactive maps from vector tiles and Mapbox styles.
It is part of the Mapbox GL ecosystem which includes Mapbox GL Native, a suite of compatible SDKs for native desktop and mobile applications.
Using Mapbox GL JS with a <script>
tag
To use the vector tiles and styles hosted on http://mapbox.com, you must create an account and then obtain an access token. You may learn more about access tokens here.
Using Mapbox GL JS with Browserify
To use the vector tiles and styles hosted on http://mapbox.com, you must create an account and then obtain an access token. You may learn more about access tokens here.
Install the mapbox-gl
npm package
npm install --save mapbox-gl
Instantiate mapboxgl.Map
var mapboxgl = ;mapboxglaccessToken = '<your access token here>';var map = container: '<your HTML element id>' style: 'mapbox://styles/mapbox/streets-v9';
Using Mapbox GL JS with Webpack
To use the vector tiles and styles hosted on http://mapbox.com, you must create an account and then obtain an access token. You may learn more about access tokens here.
Install the mapbox-gl
npm package
and the required loaders.
npm install --save mapbox-glnpm install --save transform-loadernpm install --save json-loadernpm install --save webworkify-webpack
Add the required additional options from webpack.config.example.js to your webpack configuration.
Instantiate mapboxgl.Map
var mapboxgl = ;mapboxglaccessToken = '<your access token here>';var map = container: '<your HTML element id>' style: 'mapbox://styles/mapbox/streets-v9';
Using import
If you're using the ES6 module system, you can import mapboxgl
like so:
;
Third Party Projects
These projects are written and maintained by the GL JS community. Feel free to open a PR add your own projects to this list. We ❤️ third party projects!
Contributing to Mapbox GL JS
See CONTRIBUTING.md.