Skip to content
Mapbox JavaScript API, a Leaflet Plugin
HTML JavaScript CSS Other
Branch: publisher-prod…
Clone or download

Latest commit

Latest commit f0811c5 May 28, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_docs slashes for leflet too Oct 25, 2016
docs Update page shell May 29, 2020
src
test ensure logo appears for tileLayers added after map init (#1324) Mar 19, 2020
theme update Mapbox logo (#1284) Feb 22, 2019
.artifacts.yml Update to Node 10, update to Jekyll 3.6.3 (#1319) Feb 6, 2020
.eslintrc Upgrade dependencies (#1286) Feb 25, 2019
.gitignore [docs] sitemap (#1280) Feb 12, 2019
.nvmrc Update to Node 10, update to Jekyll 3.6.3 (#1319) Feb 6, 2020
.publisher.yml First shot at new-domain staging Jan 15, 2019
.travis.yml Update to Node 10, update to Jekyll 3.6.3 (#1319) Feb 6, 2020
API.md fix /tilelayer-setformat/ links (#1325) Mar 30, 2020
CHANGELOG.md update changelog Apr 29, 2020
DEPLOYING.md release v3.3.0 (#1326) Mar 20, 2020
DESIGN.md revert rename Dec 10, 2013
DOCUMENTING.md [docs] correct api usage of plain-leaflet example (#1322) Mar 5, 2020
FAQ.md revert rename Dec 10, 2013
Gemfile Update to Node 10, update to Jekyll 3.6.3 (#1319) Feb 6, 2020
Gemfile.lock Update to Node 10, update to Jekyll 3.6.3 (#1319) Feb 6, 2020
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 docs w/ v3.3.1 May 5, 2020
_config.publisher-staging.yml update docs w/ v3.3.1 May 5, 2020
_config.yml update docs w/ v3.3.1 May 5, 2020
deploy.sh fix(cdn): Deploy dark SVG icons Nov 28, 2016
jekyll.sh Fix broken paths to assets Apr 15, 2017
package-lock.json 3.3.1 Apr 29, 2020
package.json 3.3.1 Apr 29, 2020

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.