--- layout: api title: "v1.6.0 API: L.mapbox.map(element, id|url|tilejson, options)" categories: api version: v1.6.0 permalink: /api/v1.6.0/l-mapbox-map --- {% raw %}
Create and automatically configure a map with layers, markers, and interactivity.
Extends: L.Map
Options | Value | Description |
---|---|---|
element (required) | string | Must be the id of an element, or a DOM element reference. |
id or url or tilejson | string if id or url object if tilejson | url can be
|
options | object | If provided, it is the same options as provided to L.Map with the following additions:
|
Example:
// map refers to a <div> element with the ID map
// examples.map-4l7djmvo is the ID of a map on Mapbox.com
var map = L.mapbox.map('map', 'examples.map-4l7djmvo');
// map refers to a <div> element with the ID map
// This map will have no layers initially
var map = L.mapbox.map('map');
Returns: a map object
{% endraw %}