HTML JavaScript CSS PHP Other
Latest commit 46d40da Feb 17, 2017 @lyzidiamond lyzidiamond committed on GitHub Merge pull request #1212 from mapbox/rotate-tokens-feb-2017
Rotate mapbox.js access token
Failed to load latest commit information.
_docs slashes for leflet too Oct 25, 2016
docs Updated docs/_layouts/default.html Feb 16, 2017
src Merge pull request #1196 from calvinmetcalf/no-format Feb 7, 2017
test rotate token Feb 16, 2017
theme Add marker-shadow to theme/images Nov 21, 2016
.eslintrc Switch from jshint to eslint. Fixes #1026 Jun 16, 2015
.gitignore Adds build script to create and publish the bower repo Jul 25, 2014
.travis.yml Implement jsfiddle integration for quickly testing examples Sep 8, 2014 Remove InfoControl Oct 20, 2016 Changelog to 3.0.1 Nov 21, 2016 Update deploying docs for mb-pages Sep 2, 2015 revert rename Dec 10, 2013 how to update Nov 2, 2015 revert rename Dec 10, 2013 Rename markerLayer to featureLayer Feb 19, 2014 revert rename Dec 10, 2013
Makefile Remove script from dist folder Apr 19, 2016 Use SVGs with PNG fallbacks for toolbar icons Apr 19, 2016 Update docs to 3.0.1 Nov 21, 2016
_config.mb-pages.yml rotate token Feb 16, 2017
_config.yml Update docs to 3.0.1 Nov 21, 2016 Adds build script to create and publish the bower repo Jul 25, 2014
bower.json - added 'images/*' to bower.json main section. Feb 15, 2015 Add .map files to future bower releases. Fixes #989 Apr 27, 2015 fix(cdn): Deploy dark SVG icons Nov 28, 2016
package.json docs(changelog): Use commitizen style commit messages Nov 28, 2016


Build Status Average time to resolve an issue

This is the Mapbox Javascript API, version 2.x. It's built as a Leaflet plugin. You can read about its launch.


Managed as Markdown in, following the standards in



Recommended usage is via the Mapbox CDN, with code snippets available on the official documentation page

The mapbox.js file includes the Leaflet library. Alternatively, you can use mapbox.standalone.js, which does not include Leaflet (you will have to provide it yourself).

See the API documentation and Examples for further help.

Usage with Browserify

Install the mapbox.js module and add it to dependencies in package.json:

npm install mapbox.js --save

Require mapbox in your script:

// main.js

require('mapbox.js'); // <-- auto-attaches to window.L

Browserify it:

browserify main.js -o bundle.js

Usage with Bower

You can install mapbox.js with bower by running

bower install mapbox.js

Usage as Download

You can download a built release at the mapbox.js-bower repository.


Requires node.js installed on your system.

git clone
cd mapbox.js
npm install

This project uses browserify to combine dependencies and installs a local copy when you run npm install. make will build the project in dist/.


Test with phantomjs:

npm test

To test in a browser, run a local development server and go to /test.

Version v0.x.x

Version v0.x.x can be accessed in the v0 branch..

Editing Icons


  1. Make edits to theme/images/icons.svg.
  2. Run ./theme/images/ to update sprites from your edits.
  3. Add a CSS reference with the appropriate pixel coordinate if adding a new icon.