A WebGL JavaScript interactive maps library that can render Mapbox vector tiles.
Install dependencies:
$ npm install
Then build mapbox-gl by running:
$ npm run build # build dist/mapbox-gl-dev.js
$ npm run production # build dist/mapbox-gl.js
To rebuild dist/mapbox-gl-dev.js
continuously while developing, run:
$ npm run watch
To run the debug page with a map, use any static server, for example:
$ npm install -g serve
$ serve
Open http://localhost:3000/debug/?access_token=<token>
, replacing <token>
with a Mapbox API token from https://www.mapbox.com/account/apps/.
Tests are written in tape
and can run on Sauce Labs via zuul.
npm test
: local tests run in nodejs - excludes browser testsnpm run cov
: generate test coverage report - excludes browser testsnpm run test-remote
: run all tests on Sauce Labs. requires Sauce Labs credentials in your environment.npm run test-browser
: run all tests locally in a browser.
master
is auto-published to https://mapbox.s3.amazonaws.com/mapbox-gl-js/master/mapbox-gl.js
to be used in external projects.
- Greggman's WebGL articles
- WebGL reference card