The access token that will be used to retrieve data from the Mapbox server.
Optional antialiasIf true, the gl context will be created with MSA antialiasing, which can be useful for antialiasing custom layers. This is false by default as a performance optimization.
Optional bearingOptional bearingSnap to north threshold in degrees.
Optional boundsThe initial bounds of the map. If bounds is specified, it overrides center and zoom constructor options.
Optional boxIf true, enable the "box zoom" interaction (see BoxZoomHandler)
Optional centerinitial map center
Optional clickThe max number of pixels a user can shift the mouse pointer during a click for it to be considered a valid click (as opposed to a mouse drag).
3
Optional collectIf true, Resource Timing API information will be collected for requests made by GeoJSON
and Vector Tile web workers (this information is normally inaccessible from the main
Javascript thread). Information will be returned in a resourceTiming property of
relevant data events.
false
Optional crossIf true, symbols from multiple sources can collide with each other during collision
detection. If false, collision detection is run separately for the symbols in each source.
true
Optional cssThe URL to a mapbox CSS file (not to be confused with the map style). The
CSS URL will be added to the page's <head> element at runtime. An example
URL //api.tiles.mapbox.com/mapbox-gl-js/v1.6.1/mapbox-gl.css.
Optional doubleIf true, enable the "double click to zoom" interaction (see DoubleClickZoomHandler).
Optional dragIf true, enable the "drag to pan" interaction (see DragPanHandler).
Optional dragIf true, enable the "drag to rotate" interaction (see DragRotateHandler).
Optional fadeControls the duration of the fade-in/fade-out animation for label collisions, in milliseconds. This setting affects all symbol layers. This setting does not affect the duration of runtime styling transitions or raster tile cross-fading.
300
Optional failIf true, map creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than expected.
Optional fitA fitBounds options object to use only when setting the bounds option.
Optional hashIf true, the map's position (zoom, center latitude, center longitude, bearing, and pitch) will be synced with the hash fragment of the page's URL.
For example, http://path/to/my/page.html#2.59/39.26/53.07/-24.1/60.
An additional string may optionally be provided to indicate a parameter-styled hash,
e.g. http://path/to/my/page.html#map=2.59/39.26/53.07/-24.1/60&foo=bar, where foo
is a custom parameter and bar is an arbitrary hash distinct from the map hash.
Optional interactiveIf false, no mouse, touch, or keyboard listeners are attached to the map, so it will not respond to input
Optional keyboardIf true, enable keyboard shortcuts (see KeyboardHandler).
Optional localOverrides the generation of all glyphs and font settings except font-weight keywords Also overrides localIdeographFontFamily
null
Optional localIf specified, defines a CSS font-family for locally overriding generation of glyphs in the 'CJK Unified Ideographs' and 'Hangul Syllables' ranges. In these ranges, font settings from the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold). The purpose of this option is to avoid bandwidth-intensive glyph server requests.
null
Optional localeA patch to apply to the default localization table for UI strings, e.g. control tooltips.
The locale object maps namespaced UI string IDs to translated strings in the target language;
see src/ui/default_locale.js for an example with all supported string IDs.
The object may specify all UI strings (thereby adding support for a new translation) or
only a subset of strings (thereby patching the default translation table).
Optional logoA string representing the position of the Mapbox wordmark on the map.
"bottom-left"
Optional mapThe mapbox style to use when rendering the map (not to be confused with
the CSS file). A Style object, ID, or URL. Commonly a URL like
mapbox://styles/mapbox/outdoors-v11.
Optional maxIf set, the map is constrained to the given bounds.
Optional maxMaximum pitch of the map.
Optional maxThe maximum number of tiles stored in the tile cache for a given source. If omitted, the cache will be dynamically sized based on the current viewport.
null
Optional maxMaximum zoom of the map.
Optional minMinimum pitch of the map.
Optional minMinimum zoom of the map.
Optional optimizeIf true, map will prioritize rendering for performance by reordering layers If false, layers will always be drawn in the specified order
true
Optional pitchThe initial pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-60).
0
Optional pitchIf false, the map's pitch (tilt) control with "drag to rotate" interaction will be disabled.
true
Optional preserveIf true, The maps canvas can be exported to a PNG using map.getCanvas().toDataURL();. This is false by default as a performance optimization.
Optional refreshIf false, the map won't attempt to re-request tiles once they expire per their HTTP
cacheControl/expires headers.
true
Optional renderIf true, multiple copies of the world will be rendered, when zoomed out.
true
Optional scrollIf true, enable the "scroll to zoom" interaction
Optional touchIf true, the "drag to pitch" interaction is enabled
Optional touchIf true, enable the "pinch to rotate and zoom" interaction (see TouchZoomRotateHandler).
Optional trackIf true, the map will automatically resize when the browser window resizes
Optional transformA callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.
null
Optional zoomInitial zoom level
Objects that implement this interface will create or interact with the map control.
See
Mapbox Map Parameters