JSPM

mapbox-gl

0.13.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1366392
  • Score
    100M100P100Q192831F
  • License BSD-3-Clause

A WebGL interactive maps library

Package Exports

  • mapbox-gl
  • mapbox-gl/dist/mapbox-gl
  • mapbox-gl/dist/mapbox-gl-dev
  • mapbox-gl/dist/mapbox-gl-dev.js
  • mapbox-gl/dist/mapbox-gl.css
  • mapbox-gl/dist/mapbox-gl.js
  • mapbox-gl/js/geo/lng_lat
  • mapbox-gl/js/geo/transform
  • mapbox-gl/js/ui/control/control
  • mapbox-gl/js/util/ajax.js
  • mapbox-gl/js/util/browser.js
  • mapbox-gl/js/util/browser/ajax.js
  • mapbox-gl/js/util/browser/browser.js
  • mapbox-gl/js/util/browser/canvas.js
  • mapbox-gl/js/util/browser/dispatcher.js
  • mapbox-gl/js/util/browser/dom.js
  • mapbox-gl/js/util/canvas.js
  • mapbox-gl/js/util/dispatcher.js
  • mapbox-gl/js/util/dom.js
  • mapbox-gl/js/util/evented
  • mapbox-gl/js/util/util
  • mapbox-gl/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mapbox-gl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

A WebGL JavaScript interactive maps library that can render Mapbox Vector Tiles.

Using mapbox-gl-js

Include the source via HTML tags:

<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.13.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.13.1/mapbox-gl.css' rel='stylesheet' />

For more information, see the API documentation and examples.

Alternatively, you can npm install mapbox-gl and use it as a bundled dependency with browserify.

Developing mapbox-gl-js

The following tools are required on any platform to develop mapbox-gl-js. Mac users are advised to use Homebrew unless they want to build these packages manually. APT install steps are relevant to Ubuntu Linux users.

  • git
    • OSX: brew install git
    • APT: sudo apt-get install git
  • node.js
  • GNU Make
  • imagemagick
    • OSX: brew install imagemagick
    • APT: sudo apt-get install imagemagick

On Linux, libglew-dev is required in order to run rendering tests:

$ sudo apt-get install libglew-dev

To install dependencies and build the source files:

$ npm install

To serve the debug page:

$ npm start &
$ open "http://localhost:9966/debug/?access_token="`echo $MapboxAccessToken`

This assumes you have the MapboxAccessToken environment variable set to a Mapbox API token from https://www.mapbox.com/account/apps/. This command uses mattdesl/budo to watch source files, rebuild the browserify bundle, and trigger LiveReload updates.

Running Tests

There are two test suites associated with Mapbox GL JS

  • npm test runs quick unit tests
  • npm run test-suite runs slower rendering tests from the mapbox-gl-test-suite repository

Running Benchmarks

The FPS benchmarking page compares the performance of your local copy of GL JS against previously released versions. Benchmarking configuration is within bench/fps/site.js.

To serve the FPS benchmark page:

$ npm start &
$ open "http://localhost:9966/bench/fps/?access_token="`echo $MapboxAccessToken`

Writing Documentation

See docs/README.md.

Releasing

To prepare a release:

  • Run git checkout master && git merge origin/mb-pages to merge mb-pages into master
  • Update CHANGELOG.md with all changes since the last release. A list of commits is available on the GitHub Releases page through a link that says "X commits to master since this release"
  • Update the version number in package.json, README.md, bench/fps/site.js, _config.yml, and _config.mb-pages.yml
  • Run git commit -a -m vX.Y.Z to commit changes
  • Run git tag vX.Y.Z to tag the release
  • Run git push origin && git push origin --tags to push the new commit and tag to GitHub
  • Create a GitHub release using the tag you just pushed and the text in CHANGELOG.md
  • The CI server will automatically publish tagged builds to the Mapbox CDN. Wait for this build to finish successfully before proceeding.
  • Run git checkout mb-pages && git merge master && git push origin mb-pages && git checkout master to merge master into mb-pages and publish documentation.
  • Run npm install && npm publish to publish the release to npm.

Style Reference

Learning WebGL

GL performance

Misc