You are using an outdated browser and will encounter some problems with our website. Please consider upgrading.
Upgrade Now
Docs
Maps SDKs
  • for iOS
  • for Android
  • for Unity
  • for Qt
  • Mapbox GL JS
  • Mapbox Studio
  • Mapbox Style Spec
  • Vector tiles
  • Maps APIs
Navigation SDKs
  • for iOS
  • for Android
  • Directions APIs
  • Geocoding API
All docs
  • How Mapbox works
  • Tutorials
  • Troubleshooting
  • Glossary
  • Account FAQ
  • API playground
Docs
Docs
Maps
SDK for iOS
SDK for Android
SDK for Unity
SDK for Qt
Mapbox GL JS
Mapbox Studio
Mapbox Style Spec
Vector tiles
Maps APIs
Navigation
SDK for iOS
SDK for Android
Directions APIs
Search
Geocoding API
Help
How Mapbox works
Tutorials
Troubleshooting
Glossary
Account FAQ
API playground
All docs
API v2.1.2
Map Object L.mapbox.map
Layers L.mapbox.tileLayer L.mapbox.gridLayer L.mapbox.featureLayer
Geocoding L.mapbox.geocoder
Controls L.mapbox.infoControl L.mapbox.legendControl L.mapbox.gridControl L.mapbox.geocoderControl L.mapbox.shareControl
Markers L.mapbox.marker.icon L.mapbox.marker.style
Simplestyle L.mapbox.simplestyle.style
Utility L.mapbox.sanitize L.mapbox.template
Configuration L.mapbox.accessToken L.mapbox.config.FORCE_HTTPS L.mapbox.config.HTTP_URL L.mapbox.config.HTTPS_URL
Guides API access tokens Upgrading from Mapbox.js v1 Mobile Theming
Leaflet L.Map L.Marker L.Popup L.TileLayer L.TileLayer.WMS L.TileLayer.Canvas L.ImageOverlay L.Path L.Polyline L.MultiPolyline L.Polygon L.MultiPolygon L.Rectangle L.Circle L.CircleMarker L.LayerGroup L.FeatureGroup L.GeoJson L.LatLng L.LatLngBounds L.Point L.Bounds L.Icon L.DivIcon L.Control L.Control.zoom L.Control.Attribution L.Control.Layers L.Control.Scale Events methods Event objects L.Class L.Browser L.Util L.Transformation L.LineUtil L.PolyUtil L.DomEvent L.DomUtil L.PosAnimation L.Draggable L.IHandler L.ILayer L.IControl L.IProjection L.ICRS Global Switches L.noConflict L.version
Mapbox.js
APIExamplesPlugins
You are viewing an older version of Mapbox.js. Check out v3.1.1 for the latest.

Theming

Dark theme

Mapbox.js implements a simple, light style on all interaction elements. A dark theme is available by applying class="dark" to the map div.

Example:

<div id="map" class="dark"></div>
© MapboxTermsPrivacySecurity