Skip to content
Mapbox JavaScript API, a Leaflet Plugin
HTML JavaScript CSS Other
Branch: publisher-prod…
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_docs slashes for leflet too Oct 25, 2016
docs Update docs Oct 17, 2019
src Guard against this._controlContainer being undefined (#1310) Nov 13, 2019
test assert documentation exists when mapboxjs version is bumped in produc… Oct 18, 2019
theme update Mapbox logo (#1284) Feb 22, 2019
.artifacts.yml add artifacts yaml for publisher v2 Nov 1, 2018
.eslintrc Upgrade dependencies (#1286) Feb 25, 2019
.gitignore [docs] sitemap (#1280) Feb 12, 2019
.publisher.yml First shot at new-domain staging Jan 15, 2019
.travis.yml more specific publish list; update travis node Feb 25, 2019
API.md update API.md Jul 17, 2019
CHANGELOG.md Update CHANGELOG.md Oct 17, 2019
DEPLOYING.md Remove Bower support (long overdue) (#1281) Feb 22, 2019
DESIGN.md revert rename Dec 10, 2013
DOCUMENTING.md update DOCUMENTING.md Jul 17, 2019
FAQ.md revert rename Dec 10, 2013
Gemfile [docs] adds jekyll-sitemap plugin to generate a sitemap (#1279) Feb 9, 2019
Gemfile.lock [docs] sitemap (#1280) Feb 12, 2019
JS.md update all documentation URLs Jan 18, 2019
LICENSE.md revert rename Dec 10, 2013
Makefile Upgrade dependencies (#1286) Feb 25, 2019
README.md update badges Feb 22, 2019
_config.publisher-production.yml Update _config*.yml: bump to 3.2.1 Oct 17, 2019
_config.publisher-staging.yml Update _config*.yml: bump to 3.2.1 Oct 17, 2019
_config.yml Update _config*.yml: bump to 3.2.1 Oct 17, 2019
deploy.sh fix(cdn): Deploy dark SVG icons Nov 28, 2016
jekyll.sh Fix broken paths to assets Apr 15, 2017
package-lock.json Bumps version in package-lock.json to prepare for v3.2.1 npm publish (#… Oct 17, 2019
package.json assert documentation exists when mapboxjs version is bumped in produc… Oct 18, 2019

README.md

mapbox.js

Build Status

A Mapbox plugin for Leaflet, a lightweight JavaScript library for traditional raster maps.

For the state-of-the-art Mapbox vector maps library, see Mapbox GL JS.

API

Managed as Markdown in API.md, following the standards in DOCUMENTING.md

Examples

Usage

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 as Download

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

Building

Requires node.js installed on your system.

git clone https://github.com/mapbox/mapbox.js.git
cd mapbox.js
npm install
make

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

Tests

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

Requirements:

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

Running documentation locally

Documentation is powered by Jekyll. Running using the following command:

./jekyll.sh
You can’t perform that action at this time.