UNPKG

vue-mapbox

Version:

> Combine powers of [Vue.js](https://vuejs.org/) and [Mapbox Gl JS](https://mapbox.com/mapbox-gl-js)

47 lines 77.3 kB
<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>GlMap | VueMapbox</title>
    <meta name="description" content="Combine powers of Mapbox GL JS and Vue.js">
    <link rel="icon" href="/vue-mapbox/favicon.ico">
    
    <link rel="preload" href="/vue-mapbox/assets/css/0.styles.622f01af.css" as="style"><link rel="preload" href="/vue-mapbox/assets/js/app.1613afe0.js" as="script"><link rel="preload" href="/vue-mapbox/assets/js/2.1a36c030.js" as="script"><link rel="preload" href="/vue-mapbox/assets/js/14.3affa2b5.js" as="script"><link rel="prefetch" href="/vue-mapbox/assets/js/10.496a25ae.js"><link rel="prefetch" href="/vue-mapbox/assets/js/11.c30d5454.js"><link rel="prefetch" href="/vue-mapbox/assets/js/12.43a2535b.js"><link rel="prefetch" href="/vue-mapbox/assets/js/13.0cb68667.js"><link rel="prefetch" href="/vue-mapbox/assets/js/15.40b3c4ef.js"><link rel="prefetch" href="/vue-mapbox/assets/js/16.7de1d511.js"><link rel="prefetch" href="/vue-mapbox/assets/js/17.95d02626.js"><link rel="prefetch" href="/vue-mapbox/assets/js/18.449ed0f5.js"><link rel="prefetch" href="/vue-mapbox/assets/js/19.38617f97.js"><link rel="prefetch" href="/vue-mapbox/assets/js/20.f9650703.js"><link rel="prefetch" href="/vue-mapbox/assets/js/21.39c66c8d.js"><link rel="prefetch" href="/vue-mapbox/assets/js/22.276c6a9c.js"><link rel="prefetch" href="/vue-mapbox/assets/js/23.87f4c25b.js"><link rel="prefetch" href="/vue-mapbox/assets/js/24.9d297e6b.js"><link rel="prefetch" href="/vue-mapbox/assets/js/25.f1bf9c1c.js"><link rel="prefetch" href="/vue-mapbox/assets/js/3.02aa2be5.js"><link rel="prefetch" href="/vue-mapbox/assets/js/4.79bc4f3c.js"><link rel="prefetch" href="/vue-mapbox/assets/js/5.d3d1578a.js"><link rel="prefetch" href="/vue-mapbox/assets/js/6.49edb5d4.js"><link rel="prefetch" href="/vue-mapbox/assets/js/7.e6ed37a7.js"><link rel="prefetch" href="/vue-mapbox/assets/js/8.3e4706bb.js"><link rel="prefetch" href="/vue-mapbox/assets/js/9.5e3d2dbf.js">
    <link rel="stylesheet" href="/vue-mapbox/assets/css/0.styles.622f01af.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/vue-mapbox/" class="home-link router-link-active"><!----> <span class="site-name">VueMapbox</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/vue-mapbox/guide/" class="nav-link">Guide</a></div><div class="nav-item"><a href="/vue-mapbox/api/" class="nav-link router-link-exact-active router-link-active">API</a></div><div class="nav-item"><a href="https://github.com/soal/vue-mapbox" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://github.com/soal/map-promisified" target="_blank" rel="noopener noreferrer" class="nav-link external">
  map-promisified
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/vue-mapbox/guide/" class="nav-link">Guide</a></div><div class="nav-item"><a href="/vue-mapbox/api/" class="nav-link router-link-exact-active router-link-active">API</a></div><div class="nav-item"><a href="https://github.com/soal/vue-mapbox" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://github.com/soal/map-promisified" target="_blank" rel="noopener noreferrer" class="nav-link external">
  map-promisified
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Guide</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-mapbox/guide/" class="sidebar-link">Quickstart</a></li><li><a href="/vue-mapbox/guide/basemap.html" class="sidebar-link">Base map</a></li><li><a href="/vue-mapbox/guide/composition.html" class="sidebar-link">Composition</a></li><li><a href="/vue-mapbox/guide/controls.html" class="sidebar-link">Controls</a></li><li><a href="/vue-mapbox/guide/markers&amp;popups.html" class="sidebar-link">Markers and popups</a></li><li><a href="/vue-mapbox/guide/layers&amp;sources.html" class="sidebar-link">Layers and sources</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>API</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-mapbox/api/" class="active sidebar-link">GlMap</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vue-mapbox/api/#props" class="sidebar-link">Props</a></li><li class="sidebar-sub-header"><a href="/vue-mapbox/api/#actions" class="sidebar-link">Actions</a></li><li class="sidebar-sub-header"><a href="/vue-mapbox/api/#events" class="sidebar-link">Events</a></li></ul></li><li><a href="/vue-mapbox/api/controls.html" class="sidebar-link">Controls</a></li><li><a href="/vue-mapbox/api/marker.html" class="sidebar-link">MapMarker</a></li><li><a href="/vue-mapbox/api/popup.html" class="sidebar-link">Popup</a></li><li><a href="/vue-mapbox/api/Layers/" class="sidebar-link">Layer commons</a></li><li><a href="/vue-mapbox/api/Layers/geojsonlayer.html" class="sidebar-link">GeojsonLayer</a></li><li><a href="/vue-mapbox/api/Layers/vectorlayer.html" class="sidebar-link">VectorLayer</a></li><li><a href="/vue-mapbox/api/Layers/rasterlayer.html" class="sidebar-link">RasterLayer</a></li><li><a href="/vue-mapbox/api/Layers/imagelayer.html" class="sidebar-link">ImageLayer</a></li><li><a href="/vue-mapbox/api/Layers/videolayer.html" class="sidebar-link">VideoLayer</a></li><li><a href="/vue-mapbox/api/Layers/canvaslayer.html" class="sidebar-link">CanvasLayer</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Plugin components</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-mapbox/plugin_components/" class="sidebar-link">Using plugin components</a></li><li><a href="/vue-mapbox/plugin_components/plugin_components_development.html" class="sidebar-link">Create a plugin component</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="content default"><h1 id="glmap"><a href="#glmap" aria-hidden="true" class="header-anchor">#</a> GlMap</h1> <h2 id="props"><a href="#props" aria-hidden="true" class="header-anchor">#</a> Props</h2> <h3 id="mapboxgl"><a href="#mapboxgl" aria-hidden="true" class="header-anchor">#</a> <code>mapboxGl</code></h3> <ul><li><strong>Type</strong>: <code>Object</code></li> <li><strong>Default:</strong> <code>null</code></li> <li><ul><li><strong>Description:</strong> Mapboxgl-js implementation. Useful for lazy-loading. If omitted, VueMapbox imports Mapbox-gl-js dynamically.</li></ul></li></ul> <h3 id="mapstyle"><a href="#mapstyle" aria-hidden="true" class="header-anchor">#</a> <code>mapStyle</code></h3> <ul><li><strong>Type</strong>: <code>String</code>, <code>Object</code></li> <li><strong>Required</strong></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> The map's Mapbox style. This must be an a JSON object conforming to the schema described in the Mapbox Style Specification , or a URL to such JSON.</li> <li><strong>See:</strong> <code>options.style</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="container"><a href="#container" aria-hidden="true" class="header-anchor">#</a> <code>container</code></h3> <ul><li><strong>Type:</strong> <code>String</code>, <code>HTMLElement</code></li> <li><strong>Default:</strong> <code>#map-{random number}</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> The HTML element in which Mapbox GL JS will render the map</li> <li><strong>See:</strong> <code>options.container</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="accesstoken"><a href="#accesstoken" aria-hidden="true" class="header-anchor">#</a> <code>accessToken</code></h3> <ul><li><strong>Type:</strong> <code>String</code></li> <li><strong>Default:</strong> <code>undefined</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> Token for access Mapbox map</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#accesstoken" target="_blank" rel="noopener noreferrer">accessToken<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="minzoom"><a href="#minzoom" aria-hidden="true" class="header-anchor">#</a> <code>minZoom</code></h3> <ul><li><strong>Type:</strong> <code>Number</code></li> <li><strong>Default:</strong> <code>0</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> Minimum zoom level of the map (0-24)</li> <li><strong>See:</strong> <code>options.minZoom</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="maxzoom"><a href="#maxzoom" aria-hidden="true" class="header-anchor">#</a> <code>maxZoom</code></h3> <ul><li><strong>Type:</strong> <code>Number</code></li> <li><strong>Default:</strong> <code>22</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> Maximum zoom level of the map (0-24)</li> <li><strong>See:</strong> <code>options.maxZoom</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="hash"><a href="#hash" aria-hidden="true" class="header-anchor">#</a> <code>hash</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>false</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> If 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</li> <li><strong>See:</strong> <code>options.hash</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="interactive"><a href="#interactive" aria-hidden="true" class="header-anchor">#</a> <code>interactive</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If false, no mouse, touch, or keyboard listeners will be attached to the map, so it will not respond to interaction</li> <li><strong>See:</strong> <code>options.interactive</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="bearingsnap"><a href="#bearingsnap" aria-hidden="true" class="header-anchor">#</a> <code>bearingSnap</code></h3> <ul><li><strong>Type:</strong> <code>Number</code></li> <li><strong>Default:</strong> <code>7</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> The threshold, measured in degrees, that determines when the map's bearing will snap to north</li> <li><strong>See:</strong> <code>options.bearingSnap</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="attributioncontrol"><a href="#attributioncontrol" aria-hidden="true" class="header-anchor">#</a> <code>attributionControl</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, an AttributionControl will be added to the map</li> <li><strong>See:</strong> <code>options.attributionControl</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="logoposition"><a href="#logoposition" aria-hidden="true" class="header-anchor">#</a> <code>logoPosition</code></h3> <ul><li><strong>Type:</strong> <code>String</code>, <code>top-left</code>, <code>top-right</code>, <code>bottom-right</code>, <code>bottom-left</code></li> <li><strong>Default:</strong> <code>bottom-left</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> A string representing the position of the Mapbox wordmark on the map</li> <li><strong>See:</strong> <code>options.logoPosition</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="failifmajorperformancecaveat"><a href="#failifmajorperformancecaveat" aria-hidden="true" class="header-anchor">#</a> <code>failIfMajorPerformanceCaveat</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>false</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, map creation will fail if the performance of Mapbox GL JS would be dramatically worse than expected (i.e. a software renderer would be used)</li> <li><strong>See:</strong> <code>options.failIfMajorPerformanceCaveat</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="crosssourcecollisions"><a href="#crosssourcecollisions" aria-hidden="true" class="header-anchor">#</a> <code>crossSourceCollisions</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If 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.</li> <li><strong>See:</strong> <code>options.crossSourceCollisions</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="fadeduration"><a href="#fadeduration" aria-hidden="true" class="header-anchor">#</a> <code>fadeDuration</code></h3> <ul><li><strong>Type:</strong> <code>Number</code></li> <li><strong>Default:</strong> <code>300</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> Controls 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.</li> <li><strong>See:</strong> <code>options.fadeDuration</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="preservedrawingbuffer"><a href="#preservedrawingbuffer" aria-hidden="true" class="header-anchor">#</a> <code>preserveDrawingBuffer</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>false</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, the map's canvas can be exported to a PNG using map.getCanvas().toDataURL()</li> <li><strong>See:</strong> <code>options.preserveDrawingBuffer</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="refreshexpiredtiles"><a href="#refreshexpiredtiles" aria-hidden="true" class="header-anchor">#</a> <code>refreshExpiredTiles</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, the map won't attempt to re-request tiles once they expire per their HTTP cacheControl / expires headers.</li> <li><strong>See:</strong> <code>options.refreshExpiredTiles</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="maxbounds"><a href="#maxbounds" aria-hidden="true" class="header-anchor">#</a> <code>maxBounds</code></h3> <ul><li><strong>Type:</strong> <code>Array</code>, <code>LngLatBoundsLike object</code></li> <li><strong>Default:</strong> <code>undefined</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> If set, the map will be constrained to the given bounds</li> <li><strong>See:</strong> <code>options.maxBounds</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="scrollzoom"><a href="#scrollzoom" aria-hidden="true" class="header-anchor">#</a> <code>scrollZoom</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code>, <code>Object</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, the &quot;scroll to zoom&quot; interaction is enabled. An Object value is passed as options to ScrollZoomHandler#enable</li> <li><strong>See:</strong> <code>options.scrollZoom</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="boxzoom"><a href="#boxzoom" aria-hidden="true" class="header-anchor">#</a> <code>boxZoom</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, the &quot;box zoom&quot; interaction is enabled</li> <li><strong>See:</strong> <code>options.boxZoom</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="dragrotate"><a href="#dragrotate" aria-hidden="true" class="header-anchor">#</a> <code>dragRotate</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, the &quot;drag to rotate&quot; interaction is enabled</li> <li><strong>See:</strong> <code>options.dragRotate</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="keyboard"><a href="#keyboard" aria-hidden="true" class="header-anchor">#</a> <code>keyboard</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, keyboard shortcuts are enabled</li> <li><strong>See:</strong> <code>options.keyboard</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="doubleclickzoom"><a href="#doubleclickzoom" aria-hidden="true" class="header-anchor">#</a> <code>doubleClickZoom</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, the &quot;double click to zoom&quot; interaction is enabled</li> <li><strong>See:</strong> <code>options.doubleClickZoom</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="touchzoomrotate"><a href="#touchzoomrotate" aria-hidden="true" class="header-anchor">#</a> <code>touchZoomRotate</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code>, <code>Object</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, the &quot;pinch to rotate and zoom&quot; interaction is enabled. An Object value is passed as options to TouchZoomRotateHandler#enable</li> <li><strong>See:</strong> <code>options.touchZoomRotate</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="trackresize"><a href="#trackresize" aria-hidden="true" class="header-anchor">#</a> <code>trackResize</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true, the map will automatically resize when the browser window resizes.</li> <li><strong>See:</strong> <code>options.trackResize</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="center"><a href="#center" aria-hidden="true" class="header-anchor">#</a> <code>center</code></h3> <ul><li><strong>Type:</strong> <code>Array, LngLatLike Object</code></li> <li><strong>Default:</strong> <code>undefined</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> Geographical centerpoint of the map. If center is not specified in the constructor options, Mapbox GL JS will look for it in the map's style object.If it is not specified in the style, either, it will default to <code>[0, 0]</code></li> <li><strong>See:</strong> <code>options.center</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="zoom"><a href="#zoom" aria-hidden="true" class="header-anchor">#</a> <code>zoom</code></h3> <ul><li><strong>Type:</strong> <code>Number</code></li> <li><strong>Default:</strong> <code>undefined</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> Zoom level of the map. If zoom is not specified in the constructor options, Mapbox GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to <code>0</code></li> <li><strong>See:</strong> <code>options.zoom</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="bearing"><a href="#bearing" aria-hidden="true" class="header-anchor">#</a> <code>bearing</code></h3> <ul><li><strong>Type:</strong> <code>Number</code></li> <li><strong>Default:</strong> <code>undefined</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> Bearing (rotation) of the map, measured in degrees counter-clockwise from north. If bearing is not specified in the constructor options, Mapbox GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to <code>0</code></li> <li><strong>See:</strong> <code>options.bearing</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="pitch"><a href="#pitch" aria-hidden="true" class="header-anchor">#</a> <code>pitch</code></h3> <ul><li><strong>Type:</strong> <code>Number</code></li> <li><strong>Default:</strong> <code>undefined</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> Pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-60). If pitch is not specified in the constructor options, Mapbox GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to <code>0</code></li> <li><strong>See:</strong> <code>options.pitch</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="renderworldcopies"><a href="#renderworldcopies" aria-hidden="true" class="header-anchor">#</a> <code>renderWorldCopies</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>true</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If true , multiple copies of the world will be rendered, when zoomed out</li> <li><strong>See:</strong> <code>options.renderWorldCopies</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="light"><a href="#light" aria-hidden="true" class="header-anchor">#</a> <code>light</code></h3> <ul><li><strong>Type:</strong> <code>Object</code></li> <li><strong>Default:</strong> <code>undefined</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> Light properties. Must conform to the Mapbox Style Specification</li> <li><strong>See:</strong> See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#setlight" target="_blank" rel="noopener noreferrer">setLight<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="tileboundaries"><a href="#tileboundaries" aria-hidden="true" class="header-anchor">#</a> <code>tileBoundaries</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>false</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> A Boolean indicating whether the map will render an outline around each tile. These tile boundaries are useful for debugging</li> <li><strong>See:</strong> See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#showtileboundaries" target="_blank" rel="noopener noreferrer">showTileBoundaries<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map property</li></ul> <h3 id="collisionboxes"><a href="#collisionboxes" aria-hidden="true" class="header-anchor">#</a> <code>collisionBoxes</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>false</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> A Boolean indicating whether the map will render boxes around all symbols in the data source, revealing which symbols were rendered or which were hidden due to collisions. This information is useful for debugging</li> <li><strong>See:</strong> See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#showcollisionboxes" target="_blank" rel="noopener noreferrer">showCollisionBoxes<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map property</li></ul> <h3 id="repaint"><a href="#repaint" aria-hidden="true" class="header-anchor">#</a> <code>repaint</code></h3> <ul><li><strong>Type:</strong> <code>Boolean</code></li> <li><strong>Default:</strong> <code>false</code></li> <li><strong>Synced</strong></li> <li><strong>Description:</strong> A Boolean indicating whether the map will continuously repaint. This information is useful for analyzing performance.</li> <li><strong>See:</strong> See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#repaint" target="_blank" rel="noopener noreferrer">repaint<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map property</li></ul> <h3 id="transformrequest"><a href="#transformrequest" aria-hidden="true" class="header-anchor">#</a> <code>transformRequest</code></h3> <ul><li><strong>Type:</strong> <code>Function</code></li> <li><strong>Default:</strong> <code>null</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> A 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. Expected to return an object with a <code>url</code> property and optionally <code>headers</code> and <code>credentials</code> properties.</li> <li><strong>See:</strong> <code>options.transformRequest</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h3 id="localideographfontfamily"><a href="#localideographfontfamily" aria-hidden="true" class="header-anchor">#</a> <code>localIdeographFontFamily</code></h3> <ul><li><strong>Type:</strong> <code>String</code></li> <li><strong>Default:</strong> <code>null</code></li> <li><strong>Non-Synced</strong></li> <li><strong>Description:</strong> If 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.</li> <li><strong>See:</strong> <code>options.localIdeographFontFamily</code> in <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map" target="_blank" rel="noopener noreferrer">Map<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <h2 id="actions"><a href="#actions" aria-hidden="true" class="header-anchor">#</a> Actions</h2> <p>Asynchronous actions exposed via <code>GlMap.actions</code></p> <div class="tip custom-block"><p class="custom-block-title">TIP</p> <p><a href="https://github.com/soal/map-promisified" target="_blank" rel="noopener noreferrer">Map-promisified<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> is used as wrapper around Mapbox GL JS methods. That library can be used independently from VueMapbox.</p></div> <h3 id="stop-eventdata"><a href="#stop-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.stop(eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Stops all animations on the map</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ pitch, zoom, bearing, center }&gt;}</code>
Promise that resolves object with map parameters on the moment of call <code>stop()</code></li></ul> <h3 id="panby-offset-options-eventdata"><a href="#panby-offset-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.panBy(offset, options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>offset</code> <code>{Point | number[]}</code> x and y coordinates by which to pan the map</li> <li><code>options</code> <code>{AnimationOptions object}</code> animation options. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Pans the map by the specified offest</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, center }&gt;}</code>
Promise that resolves object with event data and new center of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#panby" target="_blank" rel="noopener noreferrer">panBy<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="panto-coordinates-options-eventdata"><a href="#panto-coordinates-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.panTo(coordinates, options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>coordinates</code> <code>{LngLat | number[][]}</code> The location to pan the map to. See also: <a href="https://docs.mapbox.com/mapbox-gl-js/api/#lnglat" target="_blank" rel="noopener noreferrer">LngLat<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>options</code> <code>{AnimationOptions object}</code> animation options. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Pans the map to the specified location, with an animated transition</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, center }&gt;}</code>
Promise that resolves object with event data and new center of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#panto" target="_blank" rel="noopener noreferrer">panTo<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="zoomto-zoom-options-eventdata"><a href="#zoomto-zoom-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.zoomTo(zoom, options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>zoom</code> <code>{number}</code> The zoom level to transition to</li> <li><code>options</code> <code>{AnimationOptions object}</code> animation options. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Zooms the map to the specified zoom level, with an animated transition</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, zoom }&gt;}</code>
Promise that resolves object with event data and new zoom level of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#zoomto" target="_blank" rel="noopener noreferrer">zoomTo<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="zoomin-options-eventdata"><a href="#zoomin-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.zoomIn(options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>options</code> <code>{AnimationOptions object}</code> animation options. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Increases the map's zoom level by 1</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, zoom }&gt;}</code>
Promise that resolves object with event data and new zoom level of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#zoomin" target="_blank" rel="noopener noreferrer">zoomIn<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="zoomout-options-eventdata"><a href="#zoomout-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.zoomOut(options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>options</code> <code>{AnimationOptions object}</code> animation options. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Decreases the map's zoom level by 1</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, zoom }&gt;}</code>
Promise that resolves object with event data and new zoom level of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#zoomOut" target="_blank" rel="noopener noreferrer">zoomOut<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="rotateto-bearing-options-eventdata"><a href="#rotateto-bearing-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.rotateTo(bearing, options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>bearing</code> <code>{number}</code> The desired bearing</li> <li><code>options</code> <code>{AnimationOptions object}</code> animation options. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction that is &quot;up&quot;; for example, a bearing of 90° orients the map so that east is up.</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, bearing }&gt;}</code>
Promise that resolves object with event data and new bearing of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#rotateto" target="_blank" rel="noopener noreferrer">rotateTo<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="resetnorth-options-eventdata"><a href="#resetnorth-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.resetNorth(options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>options</code> <code>{AnimationOptions object}</code> animation options. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></li> <li><strong>Description:</strong> Rotates the map so that north is up (0° bearing), with an animated transition</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, bearing }&gt;}</code>
Promise that resolves object with event data and new bearing of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#resetnorth" target="_blank" rel="noopener noreferrer">resetNorth<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="snaptonorth-options-eventdata"><a href="#snaptonorth-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.snapToNorth(options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>options</code> <code>{AnimationOptions object}</code> animation options. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Snaps the map so that north is up (0° bearing), if the current bearing is close enough to it (i.e. within the <code>bearingSnap</code> prop threshold).</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, bearing }&gt;}</code>
Promise that resolves object with event data and new bearing of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#snaptonorth" target="_blank" rel="noopener noreferrer">snapToNorth<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="fitbounds-bounds-options-eventdata"><a href="#fitbounds-bounds-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.fitBounds(bounds, options?, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>bounds</code> <code>{ number[][] | LngLatBounds }</code> Center these bounds in the viewport and use the highest zoom level up to and including <code>maxZoom</code> that fits them in the viewport</li> <li><code>options</code> <code>{Object}</code> <ul><li><code>options.padding?</code> <code>{number}</code> The amount of padding in pixels to add to the given bounds</li> <li><code>options.linear</code> <code>{boolean}</code> <em>default</em>: <code>false</code> If true , the map transitions using <code>Map#easeTo</code>. If false , the map transitions using <code>Map#flyTo</code>. See those functions and AnimationOptions for information about options available.</li> <li><code>options.easing?</code> An easing function for the animated transition. See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><code>options.offset</code> <code>{ number[] | Point }</code> <em>default:</em> <code>[0, 0]</code> The center of the given bounds relative to the map's center, measured in pixels</li> <li><code>options.maxZoom?</code> <code>{number}</code> The maximum zoom level to allow when the map view transitions to the specified bounds</li></ul></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Pans and zooms the map to contain its visible area within the specified geographical bounds. This function will also reset the map's bearing to 0 if bearing is nonzero</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, bounds }&gt;}</code>
Promise that resolves object with event data and new bounds of the map when animation ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds" target="_blank" rel="noopener noreferrer">fitBounds<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="jumpto-options-eventdata"><a href="#jumpto-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.jumpTo(options, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>options</code> <code>{Object}</code> See <a href="https://docs.mapbox.com/mapbox-gl-js/api/#cameraoptions" target="_blank" rel="noopener noreferrer">CameraOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> <ul><li><code>options.pitch?</code> <code>{number}</code> The desired pitch, in degrees</li> <li><code>options.zoom?</code> <code>{number}</code> The desired zoom level</li> <li><code>options.center?</code> <code>{number[] | LngLat}</code> The desired center</li> <li><code>options.bearing?</code> <code>{number}</code> The desired bearing, in degrees</li> <li><code>options.around?</code> <code>{number[] | LngLat}</code> If <code>zoom</code> is specified, <code>around</code> determines the point around which the zoom is centered.</li></ul></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Changes any combination of center, zoom, bearing, and pitch, without an animated transition. The map will retain its current values for any details not specified in options</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, pitch, zoom, center, bearing }&gt;}</code>
Promise that resolves object with event data and new pitch, zoom, center and bearing of the map</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#jumpto" target="_blank" rel="noopener noreferrer">jumpTo<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h3 id="easeto-options-eventdata"><a href="#easeto-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.easeTo(options, eventData?)</code></h3> <ul><li><p><strong>Arguments:</strong></p> <ul><li><p><code>options</code> <code>{Object}</code> Combination of <a href="https://docs.mapbox.com/mapbox-gl-js/api/#cameraoptions" target="_blank" rel="noopener noreferrer">CameraOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> and <a href="https://docs.mapbox.com/mapbox-gl-js/api/#animationoptions" target="_blank" rel="noopener noreferrer">AnimationOptions<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <ul><li><code>options.pitch?</code> <code>{number}</code> The desired pitch, in degrees</li> <li><code>options.zoom?</code> <code>{number}</code> The desired zoom level</li> <li><code>options.center?</code> <code>{number[] | LngLat}</code> The desired center</li> <li><code>options.bearing?</code> <code>{number}</code> The desired bearing, in degrees</li> <li><code>options.around?</code> <code>{number[] | LngLat}</code> If <code>zoom</code> is specified, <code>around</code> determines the point around which the zoom is centered.</li> <li><code>options.duration?</code> <code>{number}</code> The animation's duration, measured in milliseconds.</li> <li><code>options.easing?</code> <code>{Function}</code> A function taking a time in the range 0..1 and returning a number where 0 is the initial state and 1 is the final state.</li> <li><code>options.offset?</code> <code>{number[] | Point}</code> of the target center relative to real map container center at the end of animation.</li> <li><code>options.animate?</code> <code>{boolean}</code>: If <code>false</code>, no animation will occur</li></ul></li> <li><p><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</p></li></ul></li> <li><p><strong>Description:</strong> Changes any combination of center, zoom, bearing, and pitch, with an animated transition between old and new values. The map will retain its current values for any details not specified in <code>options</code></p></li> <li><p><strong>Returns:</strong> <code>{Promise&lt;{ eventData, pitch, zoom, center, bearing }&gt;}</code>
Promise that resolves object with event data and new pitch, zoom, center and bearing of the map when animations ends</p></li> <li><p><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#easeto" target="_blank" rel="noopener noreferrer">easeTo<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</p></li></ul> <h3 id="flyto-options-eventdata"><a href="#flyto-options-eventdata" aria-hidden="true" class="header-anchor">#</a> <code>.flyTo(options, eventData?)</code></h3> <ul><li><strong>Arguments:</strong> <ul><li><code>options</code> <code>{Object}</code> <ul><li><code>options.curve?</code> <code>{number}</code> <em>default</em> <code>1.42</code> The zooming &quot;curve&quot; that will occur along the flight path. A high value maximizes zooming for an exaggerated animation, while a low value minimizes zooming for an effect closer to Map#easeTo. 1.42 is the average value selected by participants in the user study discussed in van Wijk (2003). A value of Math.pow(6, 0.25) would be equivalent to the root mean squared average velocity. A value of 1 would produce a circular motion</li> <li><code>options.minZoom?</code> <code>{number}</code> The zero-based zoom level at the peak of the flight path. If <code>options.curve</code> is specified, this option is ignored</li> <li><code>options.speed?</code> <code>{number}</code> <em>default</em> <code>1.2</code> The average speed of the animation defined in relation to <code>options.curve</code>. A speed of 1.2 means that the map appears to move along the flight path by 1.2 times <code>options.curve</code> screenfuls every second. A screenful is the map's visible span. It does not correspond to a fixed physical distance, but varies by zoom level</li> <li><code>options.screenSpeed?</code> <code>{number}</code> The average speed of the animation measured in screenfuls per second, assuming a linear timing curve. If <code>options.speed</code> is specified, this option is ignored</li> <li><code>options.maxDuration?</code> <code>{number}</code> The animation's maximum duration, measured in milliseconds. If duration exceeds maximum duration, it resets to 0</li></ul></li> <li><code>eventData</code> <code>{Object}</code> Custom data passed to corresponfing event.</li></ul></li> <li><strong>Description:</strong> Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that evokes flight. The animation seamlessly incorporates zooming and panning to help the user maintain her bearings even after traversing a great distance</li> <li><strong>Returns:</strong> <code>{Promise&lt;{ eventData, pitch, zoom, center, bearing }&gt;}</code>
Promise that resolves object with event data and new pitch, zoom, center and bearing of the map when animations ends</li> <li><strong>See:</strong> <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto" target="_blank" rel="noopener noreferrer">flyTo<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> Map method</li></ul> <h2 id="events"><a href="#events" aria-hidden="true" class="header-anchor">#</a> Events</h2> <p>Payload of events contains object with properties:</p> <ul><li><code>mapboxEvent</code> Original Mapbox GL JS event</li> <li><code>map</code> Current map object</li> <li><code>component</code> Component that emits event</li></ul> <h3 id="load"><a href="#load" aria-hidden="true" class="header-anchor">#</a> <code>@load</code></h3> <ul><li><strong>Description:</strong> Fires after map fully loaded</li> <li><strong>Payload</strong> <code>{ map, component }</code> <code>map</code> is Mapbox Gl JS Map object, <code>component</code> is instance of GlMap component</li></ul> <p>GlMap passes all Mapbox GL JS Map events. Full list of map events see <a href="https://docs.mapbox.com/mapbox-gl-js/api/#map.event:resize" target="_blank" rel="noopener noreferrer">here<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/vue-mapbox/guide/layers&amp;sources.html" class="prev">
          Layers and sources
        </a></span> <span class="next"><a href="/vue-mapbox/api/controls.html">
          Controls
        </a>
        →
      </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/vue-mapbox/assets/js/app.1613afe0.js" defer></script><script src="/vue-mapbox/assets/js/2.1a36c030.js" defer></script><script src="/vue-mapbox/assets/js/14.3affa2b5.js" defer></script>
  </body>
</html>