diff --git a/73944ee5ea94c1d98436bc52f9523528f31fde99-727dd780702c9fcfc772.js b/73944ee5ea94c1d98436bc52f9523528f31fde99-0a1690d3fd163c21521f.js similarity index 75% rename from 73944ee5ea94c1d98436bc52f9523528f31fde99-727dd780702c9fcfc772.js rename to 73944ee5ea94c1d98436bc52f9523528f31fde99-0a1690d3fd163c21521f.js index e6d34aec..39a71fc2 100644 --- a/73944ee5ea94c1d98436bc52f9523528f31fde99-727dd780702c9fcfc772.js +++ b/73944ee5ea94c1d98436bc52f9523528f31fde99-0a1690d3fd163c21521f.js @@ -1,2 +1,2 @@ -/*! For license information please see 73944ee5ea94c1d98436bc52f9523528f31fde99-727dd780702c9fcfc772.js.LICENSE.txt */ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{ExcP:function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var r="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i="undefined"!=typeof window?window:t,o=(void 0!==t||window,"undefined"!=typeof document&&document,!1);try{var a={get passive(){return o=!0,!0}};i.addEventListener("test",a,a),i.removeEventListener("test",a,a)}catch(s){}}).call(this,n("yLpj"))},ODXe:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("BsWD");function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(c){i=!0,o=c}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,e)||Object(r.a)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},QFcT:function(t,e,n){var r=n("I+eb"),i=Math.hypot,o=Math.abs,a=Math.sqrt;r({target:"Math",stat:!0,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(t,e){for(var n,r,i=0,s=0,c=arguments.length,u=0;s0?(r=n/u)*r:n;return u===1/0?1/0:u*a(i)}})},QFtD:function(t,e,n){var r;!function(i,o,a,s){"use strict";var c,u=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),h=Math.round,p=Math.abs,f=Date.now;function d(t,e,n){return setTimeout(w(t,n),e)}function v(t,e,n){return!!Array.isArray(t)&&(g(t,n[e],n),!0)}function g(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}c="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n-1}function x(t){return t.trim().split(/\s+/g)}function T(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;rn[e]})):r.sort()),r}function C(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=B(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,c=e.center=U(r);e.timeStamp=f(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=X(s,c),e.distance=H(s,c),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y});e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=W(e.deltaX,e.deltaY);var u=q(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=p(u.x)>p(u.y)?u.x:u.y,e.scale=a?(l=a.pointers,h=r,H(h[0],h[1],F)/H(l[0],l[1],F)):1,e.rotation=a?function(t,e){return X(e[1],e[0],F)+X(t[1],t[0],F)}(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,o,a=t.lastInterval||e,s=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(s>25||void 0===a.velocity)){var c=e.deltaX-a.deltaX,u=e.deltaY-a.deltaY,l=q(s,c,u);r=l.x,i=l.y,n=p(l.x)>p(l.y)?l.x:l.y,o=W(c,u),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}(n,e);var l,h;var d=t.element;M(e.srcEvent.target,d)&&(d=e.srcEvent.target);e.target=d}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function B(t){for(var e=[],n=0;n=p(e)?t<0?2:4:e<0?8:16}function H(t,e,n){n||(n=N);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function X(t,e,n){n||(n=N);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&P(this.element,this.evEl,this.domHandler),this.evTarget&&P(this.target,this.evTarget,this.domHandler),this.evWin&&P(R(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4};function G(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,Z.apply(this,arguments)}O(G,Z,{handler:function(t){var e=Y[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var K={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:"touch",3:"pen",4:"mouse",5:"kinect"},J="pointerdown",$="pointermove pointerup pointercancel";function tt(){this.evEl=J,this.evWin=$,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(J="MSPointerDown",$="MSPointerMove MSPointerUp MSPointerCancel"),O(tt,Z,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=K[r],o=Q[t.pointerType]||t.pointerType,a="touch"==o,s=T(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&i&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var et={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function nt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function rt(t,e){var n=k(t.touches),r=k(t.changedTouches);return 12&e&&(n=D(n.concat(r),"identifier",!0)),[n,r]}O(nt,Z,{handler:function(t){var e=et[t.type];if(1===e&&(this.started=!0),this.started){var n=rt.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ot(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},Z.apply(this,arguments)}function at(t,e){var n=k(t.touches),r=this.targetIds;if(3&e&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=k(t.changedTouches),s=[],c=this.target;if(o=n.filter((function(t){return M(t.target,c)})),1===e)for(i=0;i-1&&r.splice(t,1)}),2500)}}function lt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+gt(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+gt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&i&e.direction},attrTest:function(t){return yt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=mt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),O(wt,yt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),O(jt,vt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distancee.time;if(this._input=t,!r||!n||12&t.eventType&&!i)this.reset();else if(1&t.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),O(Et,yt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),O(_t,yt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ot.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=mt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),O(Pt,vt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance0;)r.appendChild(n.childNodes[0]);this._map._container=r,t.savedMap=null,e.mapStyle&&this._map.setStyle(Object(o.a)(e.mapStyle),{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)},e._create=function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var n=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=n,e.gl}}var r={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:Object(o.a)(e.mapStyle),interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(r.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},r,e.mapOptions)),this._map.once("load",this._fireLoadEvent),this._map.on("error",this._handleError)}return this},e._destroy=function(){this._map&&(this.props.reuseMaps&&!t.savedMap?(t.savedMap=this._map,this._map.off("load",this._fireLoadEvent),this._map.off("error",this._handleError),this._map.off("styledata",this._fireLoadEvent)):this._map.remove(),this._map=null)},e._initialize=function(t){var e=this;c(t=Object.assign({},s,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||s.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var n=t.container;Object.defineProperty(n,"offsetWidth",{get:function(){return e.width}}),Object.defineProperty(n,"clientWidth",{get:function(){return e.width}}),Object.defineProperty(n,"offsetHeight",{get:function(){return e.height}}),Object.defineProperty(n,"clientHeight",{get:function(){return e.height}});var r=this._map.getCanvas();r&&(r.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t},e._update=function(t,e){if(this._map){c(e=Object.assign({},this.props,e),"Mapbox");var n=this._updateMapViewport(t,e),r=this._updateMapSize(t,e);this._updateMapStyle(t,e),e.asyncRender||!n&&!r||this.redraw(),this.props=e}},e._updateMapStyle=function(t,e){t.mapStyle!==e.mapStyle&&this._map.setStyle(Object(o.a)(e.mapStyle),{diff:!e.preventStyleDiffing})},e._updateMapSize=function(t,e){var n=t.width!==e.width||t.height!==e.height;return n&&(this.width=e.width,this.height=e.height,this._map.resize()),n},e._updateMapViewport=function(t,e){var n=this._getViewState(t),r=this._getViewState(e),i=r.latitude!==n.latitude||r.longitude!==n.longitude||r.zoom!==n.zoom||r.pitch!==n.pitch||r.bearing!==n.bearing||r.altitude!==n.altitude;return i&&(this._map.jumpTo(this._viewStateToMapboxProps(r)),r.altitude!==n.altitude&&(this._map.transform.altitude=r.altitude)),i},e._getViewState=function(t){var e=t.viewState||t,n=e.longitude,r=e.latitude,i=e.zoom,o=e.pitch,a=void 0===o?0:o,s=e.bearing,c=void 0===s?0:s,u=e.altitude;return{longitude:n,latitude:r,zoom:i,pitch:a,bearing:c,altitude:void 0===u?1.5:u}},e._checkStyleSheet=function(t){if(void 0===t&&(t="0.47.0"),void 0!==i.a)try{var e=i.a.createElement("div");if(e.className="mapboxgl-map",e.style.display="none",i.a.body.appendChild(e),!("static"!==window.getComputedStyle(e).position)){var n=i.a.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v"+t+"/mapbox-gl.css"),i.a.head.appendChild(n)}}catch(r){}},e._viewStateToMapboxProps=function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}},t}();u.initialized=!1,u.propTypes=a,u.defaultProps=s,u.savedMap=null}).call(this,n("8oxB"))},ZaHm:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"e",(function(){return c})),n.d(e,"f",(function(){return u})),n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return h}));n("QFcT");var r=n("yU0y");function i(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],v=e[13],g=e[14],m=e[15],b=n*s-r*a,y=n*c-i*a,O=n*u-o*a,w=r*c-i*s,j=r*u-o*s,E=i*u-o*c,_=l*v-h*d,P=l*g-p*d,M=l*m-f*d,S=h*g-p*v,x=h*m-f*v,T=p*m-f*g,k=b*T-y*x+O*S+w*M-j*P+E*_;return k?(k=1/k,t[0]=(s*T-c*x+u*S)*k,t[1]=(i*x-r*T-o*S)*k,t[2]=(v*E-g*j+m*w)*k,t[3]=(p*j-h*E-f*w)*k,t[4]=(c*M-a*T-u*P)*k,t[5]=(n*T-i*M+o*P)*k,t[6]=(g*O-d*E-m*y)*k,t[7]=(l*E-p*O+f*y)*k,t[8]=(a*x-s*M+u*_)*k,t[9]=(r*M-n*x-o*_)*k,t[10]=(d*j-v*O+m*b)*k,t[11]=(h*O-l*j-f*b)*k,t[12]=(s*P-a*S-c*_)*k,t[13]=(n*S-r*P+i*_)*k,t[14]=(v*y-d*w-g*b)*k,t[15]=(l*w-h*y+p*b)*k,t):null}function o(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],u=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],v=e[12],g=e[13],m=e[14],b=e[15],y=n[0],O=n[1],w=n[2],j=n[3];return t[0]=y*r+O*s+w*h+j*v,t[1]=y*i+O*c+w*p+j*g,t[2]=y*o+O*u+w*f+j*m,t[3]=y*a+O*l+w*d+j*b,y=n[4],O=n[5],w=n[6],j=n[7],t[4]=y*r+O*s+w*h+j*v,t[5]=y*i+O*c+w*p+j*g,t[6]=y*o+O*u+w*f+j*m,t[7]=y*a+O*l+w*d+j*b,y=n[8],O=n[9],w=n[10],j=n[11],t[8]=y*r+O*s+w*h+j*v,t[9]=y*i+O*c+w*p+j*g,t[10]=y*o+O*u+w*f+j*m,t[11]=y*a+O*l+w*d+j*b,y=n[12],O=n[13],w=n[14],j=n[15],t[12]=y*r+O*s+w*h+j*v,t[13]=y*i+O*c+w*p+j*g,t[14]=y*o+O*u+w*f+j*m,t[15]=y*a+O*l+w*d+j*b,t}function a(t,e,n){var r,i,o,a,s,c,u,l,h,p,f,d,v=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*m+e[12],t[13]=e[1]*v+e[5]*g+e[9]*m+e[13],t[14]=e[2]*v+e[6]*g+e[10]*m+e[14],t[15]=e[3]*v+e[7]*g+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],u=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=u,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*v+s*g+h*m+e[12],t[13]=i*v+c*g+p*m+e[13],t[14]=o*v+u*g+f*m+e[14],t[15]=a*v+l*g+d*m+e[15]),t}function s(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function c(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],u=e[8],l=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=c*i+p*r,t[8]=u*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-c*r,t}function u(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],u=e[4],l=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=c*i+p*r,t[4]=u*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=p*i-c*r,t}function l(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function h(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=t[9],f=t[10],d=t[11],v=t[12],g=t[13],m=t[14],b=t[15],y=e[0],O=e[1],w=e[2],j=e[3],E=e[4],_=e[5],P=e[6],M=e[7],S=e[8],x=e[9],T=e[10],k=e[11],D=e[12],C=e[13],I=e[14],R=e[15];return Math.abs(n-y)<=r.b*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-O)<=r.b*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(o-w)<=r.b*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-j)<=r.b*Math.max(1,Math.abs(a),Math.abs(j))&&Math.abs(s-E)<=r.b*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(c-_)<=r.b*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-P)<=r.b*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(l-M)<=r.b*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(h-S)<=r.b*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(p-x)<=r.b*Math.max(1,Math.abs(p),Math.abs(x))&&Math.abs(f-T)<=r.b*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(d-k)<=r.b*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(v-D)<=r.b*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(g-C)<=r.b*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-I)<=r.b*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(b-R)<=r.b*Math.max(1,Math.abs(b),Math.abs(R))}},Zs1x:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));"undefined"!=typeof window&&window,void 0!==t||window;var r="undefined"!=typeof document?document:{}}).call(this,n("yLpj"))},ZxFD:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return c})),n.d(e,"f",(function(){return h}));n("QFcT");var r=n("yU0y");function i(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function o(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function a(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function s(t,e){return t[0]=-e[0],t[1]=-e[1],t}function c(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}var u,l,h=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};u=new r.a(2),r.a!=Float32Array&&(u[0]=0,u[1]=0),l=u},bl9R:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));n("QFcT");var r=n("yU0y");function i(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function o(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}var a,s;a=new r.a(4),r.a!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0),s=a},iXzu:function(t,e,n){"use strict";(function(t){n("E9XD");var r=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n0},t.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;s.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),l=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),j="undefined"!=typeof WeakMap?new WeakMap:new r,E=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new w(e,n,this);j.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){E.prototype[t]=function(){var e;return(e=j.get(this))[t].apply(e,arguments)}}));var _=void 0!==o.ResizeObserver?o.ResizeObserver:E;e.a=_}).call(this,n("yLpj"))},"n+fv":function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return c}));n("QFcT");var r=n("yU0y");function i(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function o(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}var a,s,c=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t};a=new r.a(3),r.a!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),s=a},oXiK:function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return Xe})),n.d(e,"InteractiveMap",(function(){return Xe})),n.d(e,"StaticMap",(function(){return wt})),n.d(e,"Source",(function(){return Je})),n.d(e,"Layer",(function(){return sn})),n.d(e,"BaseControl",(function(){return pn})),n.d(e,"Marker",(function(){return Pn})),n.d(e,"Popup",(function(){return Dn})),n.d(e,"AttributionControl",(function(){return An})),n.d(e,"FullscreenControl",(function(){return Vn})),n.d(e,"GeolocateControl",(function(){return Xn})),n.d(e,"NavigationControl",(function(){return er})),n.d(e,"ScaleControl",(function(){return or})),n.d(e,"CanvasOverlay",(function(){return cr})),n.d(e,"HTMLOverlay",(function(){return hr})),n.d(e,"SVGOverlay",(function(){return dr})),n.d(e,"TRANSITION_EVENTS",(function(){return Vt})),n.d(e,"TransitionInterpolator",(function(){return _t})),n.d(e,"LinearInterpolator",(function(){return Ft})),n.d(e,"FlyToInterpolator",(function(){return At})),n.d(e,"MapController",(function(){return Re})),n.d(e,"WebMercatorViewport",(function(){return N})),n.d(e,"setRTLTextPlugin",(function(){return vr})),n.d(e,"MapContext",(function(){return lt})),n.d(e,"_useMapControl",(function(){return ln})),n.d(e,"_MapContext",(function(){return lt}));var r=n("KQm4"),i=n("rePB"),o=n("q1tI"),a=n("W0B4"),s=n("ODXe"),c=n("1OyB"),u=n("vuIU"),l=n("bl9R");function h(t,e){var n=l.b([],e,t);return l.a(n,n,1/n[3]),n}function p(t,e){var n=t%e;return n<0?e+n:n}function f(t,e,n){return n*e+(1-n)*t}var d=Math.log2||function(t){return Math.log(t)*Math.LOG2E},v=n("ZaHm"),g=n("ZxFD"),m=n("n+fv");function b(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var y=Math.PI,O=y/4,w=y/180,j=180/y;function E(t){return Math.pow(2,t)}function _(t){return d(t)}function P(t){var e=Object(s.a)(t,2),n=e[0],r=e[1];b(Number.isFinite(n)),b(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");var i=r*w;return[512*(n*w+y)/(2*y),512*(y+Math.log(Math.tan(O+.5*i)))/(2*y)]}function M(t){var e=Object(s.a)(t,2),n=e[0],r=e[1],i=n/512*(2*y)-y,o=2*(Math.atan(Math.exp(r/512*(2*y)-y))-O);return[i*j,o*j]}function S(t){var e=t.latitude,n=t.longitude,r=t.highPrecision,i=void 0!==r&&r;b(Number.isFinite(e)&&Number.isFinite(n));var o={},a=Math.cos(e*w),s=512/360/a,c=512/4003e4/a;if(o.unitsPerMeter=[c,c,c],o.metersPerUnit=[1/c,1/c,1/c],o.unitsPerDegree=[512/360,s,c],o.degreesPerUnit=[.703125,1/s,1/c],i){var u=w*Math.tan(e*w)/a,l=512/360*u/2,h=512/4003e4*u,p=h/s*c;o.unitsPerDegree2=[0,l,h],o.unitsPerMeter2=[p,0,p]}return o}function x(t){var e=t.height,n=t.pitch,r=t.bearing,i=t.altitude,o=t.scale,a=t.center,s=void 0===a?null:a,c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return v.h(c,c,[0,0,-i]),v.e(c,c,-n*w),v.f(c,c,r*w),o/=e,v.g(c,c,[o,o,o]),s&&v.h(c,c,m.c([],s)),c}function T(t){var e=t.width,n=t.height,r=t.pitch,i=function(t){var e=t.width,n=t.height,r=t.fovy,i=void 0===r?k(1.5):r,o=t.altitude,a=t.pitch,s=void 0===a?0:a,c=t.nearZMultiplier,u=void 0===c?1:c,l=t.farZMultiplier,h=void 0===l?1:l;void 0!==o&&(i=k(o));var p=.5*i*w,f=D(i),d=s*w,v=Math.sin(p)*f/Math.sin(Math.min(Math.max(Math.PI/2-d-p,.01),Math.PI-.01));return{fov:2*p,aspect:e/n,focalDistance:f,near:u,far:(Math.sin(d)*v+f)*h}}({width:e,height:n,altitude:t.altitude,fovy:t.fovy,pitch:r,nearZMultiplier:t.nearZMultiplier,farZMultiplier:t.farZMultiplier}),o=i.fov,a=i.aspect,s=i.near,c=i.far;return v.d([],o,a,s,c)}function k(t){return 2*Math.atan(.5/t)*j}function D(t){return.5/Math.tan(.5*t*w)}function C(t,e){var n=Object(s.a)(t,3),r=n[0],i=n[1],o=n[2],a=void 0===o?0:o;return b(Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(a)),h(e,[r,i,a,1])}function I(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(s.a)(t,3),i=r[0],o=r[1],a=r[2];if(b(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a)){var c=h(e,[i,o,a,1]);return c}var u=h(e,[i,o,0,1]),l=h(e,[i,o,1,1]),p=u[2],f=l[2],d=p===f?0:((n||0)-p)/(f-p);return g.c([],u,l,d)}function R(t){var e=t.width,n=t.height,r=t.bounds,i=t.minExtent,o=void 0===i?0:i,a=t.maxZoom,c=void 0===a?24:a,u=t.padding,l=void 0===u?0:u,h=t.offset,p=void 0===h?[0,0]:h,f=Object(s.a)(r,2),v=Object(s.a)(f[0],2),g=v[0],m=v[1],y=Object(s.a)(f[1],2),O=y[0],w=y[1];if(Number.isFinite(l)){l={top:l,bottom:l,left:l,right:l}}else b(Number.isFinite(l.top)&&Number.isFinite(l.bottom)&&Number.isFinite(l.left)&&Number.isFinite(l.right));var j=new N({width:e,height:n,longitude:0,latitude:0,zoom:0}),E=j.project([g,w]),_=j.project([O,m]),P=[Math.max(Math.abs(_[0]-E[0]),o),Math.max(Math.abs(_[1]-E[1]),o)],M=[e-l.left-l.right-2*Math.abs(p[0]),n-l.top-l.bottom-2*Math.abs(p[1])];b(M[0]>0&&M[1]>0);var S=M[0]/P[0],x=M[1]/P[1],T=(l.right-l.left)/2/S,k=(l.bottom-l.top)/2/x,D=[(_[0]+E[0])/2+T,(_[1]+E[1])/2+k],C=j.unproject(D),I=Math.min(c,j.zoom+d(Math.abs(Math.min(S,x))));return b(Number.isFinite(I)),{longitude:C[0],latitude:C[1],zoom:I}}var A=Math.PI/180;function L(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.width,o=t.height,a=t.unproject,s={targetZ:r},c=a([0,o],s),u=a([i,o],s),l=t.fovy?.5*t.fovy*A:Math.atan(.5/t.altitude),h=(90-t.pitch)*A;return l>h-.01?(e=z(t,0,r),n=z(t,i,r)):(e=a([0,0],s),n=a([i,0],s)),[c,u,n,e]}function z(t,e,n){var r=t.pixelUnprojectionMatrix,i=h(r,[e,0,1,1]),o=h(r,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(o[2]-i[2]),s=M(g.c([],i,o,a));return s[2]=n,s}var N=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1},n=e.width,r=e.height,i=e.latitude,o=void 0===i?0:i,a=e.longitude,s=void 0===a?0:a,u=e.zoom,l=void 0===u?0:u,h=e.pitch,p=void 0===h?0:h,f=e.bearing,d=void 0===f?0:f,v=e.altitude,g=void 0===v?null:v,b=e.fovy,y=void 0===b?null:b,O=e.position,w=void 0===O?null:O,j=e.nearZMultiplier,_=void 0===j?.02:j,M=e.farZMultiplier,C=void 0===M?1.01:M;Object(c.a)(this,t),n=n||1,r=r||1,null===y&&null===g?y=k(g=1.5):null===y?y=k(g):null===g&&(g=D(y));var I=E(l);g=Math.max(.75,g);var R=S({longitude:s,latitude:o}),A=P([s,o]);A[2]=0,w&&m.a(A,A,m.b([],w,R.unitsPerMeter)),this.projectionMatrix=T({width:n,height:r,pitch:p,fovy:y,nearZMultiplier:_,farZMultiplier:C}),this.viewMatrix=x({height:r,scale:I,center:A,pitch:p,bearing:d,altitude:g}),this.width=n,this.height=r,this.scale=I,this.latitude=o,this.longitude=s,this.zoom=l,this.pitch=p,this.bearing=d,this.altitude=g,this.fovy=y,this.center=A,this.meterOffset=w||[0,0,0],this.distanceScales=R,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}return Object(u.a)(t,[{key:"_initMatrices",value:function(){var t=this.width,e=this.height,n=this.projectionMatrix,r=this.viewMatrix,i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];v.c(i,i,n),v.c(i,i,r),this.viewProjectionMatrix=i;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];v.g(o,o,[t/2,-e/2,1]),v.h(o,o,[1,-1,0]),v.c(o,o,i);var a=v.b([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}},{key:"equals",value:function(e){return e instanceof t&&(e.width===this.width&&e.height===this.height&&v.a(e.projectionMatrix,this.projectionMatrix)&&v.a(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=this.projectPosition(t),o=C(i,this.pixelProjectionMatrix),a=Object(s.a)(o,2),c=a[0],u=a[1],l=r?u:this.height-u;return 2===t.length?[c,l]:[c,l,o[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=e.targetZ,o=void 0===i?void 0:i,a=Object(s.a)(t,3),c=a[0],u=a[1],l=a[2],h=r?u:this.height-u,p=o&&o*this.distanceScales.unitsPerMeter[2],f=I([c,h,l],this.pixelUnprojectionMatrix,p),d=this.unprojectPosition(f),v=Object(s.a)(d,3),g=v[0],m=v[1],b=v[2];return Number.isFinite(l)?[g,m,b]:Number.isFinite(o)?[g,m,o]:[g,m]}},{key:"projectPosition",value:function(t){var e=P(t),n=Object(s.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(t){var e=M(t),n=Object(s.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(t){return P(t)}},{key:"unprojectFlat",value:function(t){return M(t)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=I(t.pos,this.pixelUnprojectionMatrix),r=P(e),i=g.a([],r,g.d([],n));return M(g.a([],this.center,i))}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=R(Object.assign({width:r,height:i,bounds:e},n)),a=o.longitude,s=o.latitude,c=o.zoom;return new t({width:r,height:i,longitude:a,latitude:s,zoom:c})}},{key:"getBounds",value:function(t){var e=this.getBoundingRegion(t),n=Math.min.apply(Math,Object(r.a)(e.map((function(t){return t[0]})))),i=Math.max.apply(Math,Object(r.a)(e.map((function(t){return t[0]}))));return[[n,Math.min.apply(Math,Object(r.a)(e.map((function(t){return t[1]}))))],[i,Math.max.apply(Math,Object(r.a)(e.map((function(t){return t[1]}))))]]}},{key:"getBoundingRegion",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return L(this,t.z||0)}}]),t}();function F(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,"`scale` must be a positive number");var i=this._state,o=i.startZoom,a=i.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(n)||this._unproject(e)),J(a,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:r,startZoom:o||0}),c=new N(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:a,pos:e}),u=c[0],l=c[1];return this._getUpdatedMapState({zoom:s,longitude:u,latitude:l})},e.zoomEnd=function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})},e._getUpdatedMapState=function(e){return new t(Object.assign({},this._viewportProps,this._state,e))},e._applyConstraints=function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=K(r,n,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;return t.pitch=K(a,o,i),Object.assign(t,function(t){var e=t.width,n=t.height,r=t.longitude,i=t.latitude,o=t.zoom,a=t.pitch,s=void 0===a?0:a,c=t.bearing,u=void 0===c?0:c;(r<-180||r>180)&&(r=p(r+180,360)-180),(u<-180||u>180)&&(u=p(u+180,360)-180);var l=d(n/512);if(o<=l)o=l,i=0;else{var h=n/2/Math.pow(2,o),f=M([0,h])[1];if(iv&&(i=v)}}return{width:e,height:n,longitude:r,latitude:i,zoom:o,pitch:s,bearing:u}}(t)),t},e._unproject=function(t){var e=new N(this._viewportProps);return t&&e.unproject(t)},e._calculateNewLngLat=function(t){var e=t.startPanLngLat,n=t.pos;return new N(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:n})},e._calculateNewZoom=function(t){var e=t.scale,n=t.startZoom,r=this._viewportProps,i=r.maxZoom,o=r.minZoom;return K(n+Math.log2(e),o,i)},e._calculateNewPitchAndBearing=function(t){var e=t.deltaScaleX,n=t.deltaScaleY,r=t.startBearing,i=t.startPitch;n=K(n,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,c=i;return n>0?c=i+n*(s-i):n<0&&(c=i-n*(a-i)),{pitch:c,bearing:r+180*e}},e._getRotationParams=function(t,e){var n=t[0]-e[0],r=t[1]-e[1],i=t[1],o=e[1],a=this._viewportProps,s=a.width,c=a.height,u=n/s,l=0;return r>0?Math.abs(c-o)>5&&(l=r/(o-c)*1.2):r<0&&o>5&&(l=1-i/o),{deltaScaleX:u,deltaScaleY:l=Math.min(1,Math.max(-1,l))}},t}();function at(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function st(t){for(var e=1;ee[n])return!1}var o;return!0}(t.viewState||t,w),_=Object.assign({},mt,{visibility:E?"inherit":"hidden"});return o.createElement("div",{key:"map-container",ref:h,style:j},o.createElement("div",{key:"map-mapbox",ref:l,style:_,className:m}),g,!r&&!t.disableTokenWarning&&o.createElement(yt,null))}));Ot.supported=function(){return X.a&&X.a.supported()},Ot.defaultProps=bt;var wt=Ot;function jt(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Et(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n180&&(n=n<0?n+360:n-360),n}function Tt(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return kt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:{},i={},o=U(t,e,r),a=o.startZoom,s=o.startCenterXY,c=o.uDelta,u=o.w0,l=o.u1,h=o.S,p=o.rho,d=o.rho2,v=o.r0;if(l<.01){var m,b=F(V);try{for(b.s();!(m=b.n()).done;){var y=m.value,O=t[y],w=e[y];i[y]=f(O,w,n)}}catch(D){b.e(D)}finally{b.f()}return i}var j=n*h,E=Math.cosh(v)/Math.cosh(v+p*j),P=u*((Math.cosh(v)*Math.tanh(v+p*j)-Math.sinh(v))/d)/l,S=1/E,x=a+_(S),T=g.e([],c,P);g.a(T,T,s);var k=M(T);return i.longitude=k[0],i.latitude=k[1],i.zoom=x,i}(t,e,n,this.props),o=Tt(It);!(r=o()).done;){var a=r.value;i[a]=Q(t[a],e[a],n)}return i},n.getDuration=function(t,e){var n=e.transitionDuration;return"auto"===n&&(n=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r=Object.assign({},B,r),o=i.screenSpeed,a=i.speed,s=i.maxDuration,c=U(t,e,r),u=c.S,l=c.rho,h=1e3*u;return n=Number.isFinite(o)?h/(o/l):h/a,Number.isFinite(s)&&n>s?0:n}(t,e,this.props)),n},e}(_t);function Lt(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return zt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function zt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0||"auto"===e)&&Boolean(n)},e._isUpdateDueToCurrentTransition=function(t){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(t,this.state.propsInTransition)},e._shouldIgnoreViewportChange=function(t,e){return!t||(this._isTransitionInProgress()?this.state.interruption===Vt.IGNORE||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e))},e._triggerTransition=function(t,e){J(this._isTransitionEnabled(e)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var n=e.transitionInterpolator,r=n.getDuration?n.getDuration(t,e):e.transitionDuration;if(0!==r){var i=e.transitionInterpolator.initializeProps(t,e),o={inTransition:!0,isZooming:t.zoom!==e.zoom,isPanning:t.longitude!==e.longitude||t.latitude!==e.latitude,isRotating:t.bearing!==e.bearing||t.pitch!==e.pitch};this.state={duration:r,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:this.time(),startProps:i.start,endProps:i.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(o)}},e._endTransition=function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})},e._updateViewport=function(){var t=this.time(),e=this.state,n=e.startTime,r=e.duration,i=e.easing,o=e.interpolator,a=e.startProps,s=e.endProps,c=!1,u=(t-n)/r;u>=1&&(u=1,c=!0),u=i(u);var l=o.interpolateProps(a,s,u),h=new ot(Object.assign({},this.props,l));this.state.propsInTransition=h.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),c&&(this._endTransition(),this.props.onTransitionEnd())},t}();Ut.defaultProps=Bt;var qt,Wt,Ht=n("QFtD"),Xt=n.n(Ht),Yt={mousedown:1,mousemove:2,mouseup:4};qt=Xt.a.PointerEventInput,Wt=qt.prototype.handler,qt.prototype.handler=function(t){var e=this.store;t.button>0&&(function(t,e){for(var n=0;n=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};var Gt=Xt.a.Manager,Kt=Xt.a,Qt=Kt?[[Kt.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[Kt.Rotate,{enable:!1}],[Kt.Pinch,{enable:!1}],[Kt.Swipe,{enable:!1}],[Kt.Pan,{threshold:0,enable:!1}],[Kt.Press,{enable:!1}],[Kt.Tap,{event:"doubletap",taps:2,enable:!1}],[Kt.Tap,{event:"anytap",enable:!1}],[Kt.Tap,{enable:!1}]]:null,Jt={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},$t={doubletap:["tap"]},te={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],ne=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],re=["wheel","mousewheel","DOMMouseScroll"],ie={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},oe={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n("ExcP"),se=-1!==ae.b.indexOf("firefox"),ce=re,ue=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(c.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},i),this.events=ce.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent,!!ae.a&&{passive:!1})}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"wheel"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){if(this.options.enable){var e=t.deltaY;ae.c.WheelEvent&&(se&&t.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(e/=ae.c.devicePixelRatio),t.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(e*=40));var n={x:t.clientX,y:t.clientY};0!==e&&e%4.000244140625==0&&(e=Math.floor(e/4.000244140625)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}}},{key:"_onWheel",value:function(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),le=ne,he=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(c.a)(this,t),this.element=e,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=le.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"pointermove"===t&&(this.enableMoveEvent=e),"pointerover"===t&&(this.enableOverEvent=e),"pointerout"===t&&(this.enableOutEvent=e),"pointerleave"===t&&(this.enableLeaveEvent=e)}},{key:"handleEvent",value:function(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}},{key:"handleOverEvent",value:function(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:"pointerover",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleOutEvent",value:function(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:"pointerout",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleLeaveEvent",value:function(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:"pointerleave",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleMoveEvent",value:function(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}]),t}(),pe=ee,fe=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(c.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=pe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"keydown"===t&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}},{key:"handleEvent",value:function(t){var e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}]),t}(),de=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(c.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},r),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}return Object(u.a)(t,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(t,e){"contextmenu"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){this.options.enable&&this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),ve=n("U8pU"),ge={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};var me={srcElement:"root",priority:0},be=function(){function t(e){Object(c.a)(this,t),this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}return Object(u.a)(t,[{key:"isEmpty",value:function(){return!this._active}},{key:"add",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this.handlers,a=this.handlersByElement;n&&("object"!==Object(ve.a)(n)||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},me,n):me;var s=a.get(n.srcElement);s||(s=[],a.set(n.srcElement,s));var c={type:t,handler:e,srcElement:n.srcElement,priority:n.priority};r&&(c.once=!0),i&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;for(var u=s.length-1;u>=0&&!(s[u].priority>=c.priority);)u--;s.splice(u+1,0,c)}},{key:"remove",value:function(t,e){for(var n=this.handlers,r=this.handlersByElement,i=n.length-1;i>=0;i--){var o=n[i];if(o.type===t&&o.handler===e){n.splice(i,1);var a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=n.some((function(t){return!t.passive}))}},{key:"handleEvent",value:function(t){if(!this.isEmpty()){for(var e=this._normalizeEvent(t),n=t.srcEvent.target;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")}}},{key:"_emit",value:function(t,e){var n=this.handlersByElement.get(e);if(n){for(var r=!1,i=function(){t.handled=!0},o=function(){t.handled=!0,r=!0},a=[],s=0;s=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Oe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(c.a)(this,t),this.options=Object.assign({},we,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(e);var r=n.events;r&&this.on(r)}return Object(u.a)(t,[{key:"setElement",value:function(t){var e=this;if(this.element&&this.destroy(),this.element=t,t){var n=this.options,r=n.Manager;for(var i in this.manager=new r(t,{touchAction:n.touchAction,recognizers:n.recognizers||Qt}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Jt).forEach((function(t){var n=e.manager.get(t);n&&Jt[t].forEach((function(t){n.recognizeWith(t)}))})),n.recognizerOptions){var o=this.manager.get(i);if(o){var a=n.recognizerOptions[i];delete a.enable,o.set(a)}}this.wheelInput=new ue(t,this._onOtherEvent,{enable:!1}),this.moveInput=new he(t,this._onOtherEvent,{enable:!1}),this.keyInput=new fe(t,this._onOtherEvent,{enable:!1,tabIndex:n.tabIndex}),this.contextmenuInput=new de(t,this._onOtherEvent,{enable:!1});var c,u=ye(this.events);try{for(u.s();!(c=u.n()).done;){var l=Object(s.a)(c.value,2),h=l[0],p=l[1];p.isEmpty()||(this._toggleRecognizer(p.recognizerName,!0),this.manager.on(h,p.handleEvent))}}catch(f){u.e(f)}finally{u.f()}}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(t,e,n){this._addEventHandler(t,e,n,!1)}},{key:"once",value:function(t,e,n){this._addEventHandler(t,e,n,!0)}},{key:"watch",value:function(t,e,n){this._addEventHandler(t,e,n,!1,!0)}},{key:"off",value:function(t,e){this._removeEventHandler(t,e)}},{key:"_toggleRecognizer",value:function(t,e){var n=this.manager;if(n){var r=n.get(t);if(r&&r.options.enable!==e){r.set({enable:e});var i=$t[t];i&&!this.options.recognizers&&i.forEach((function(i){var o=n.get(i);e?(o.requireFailure(t),r.dropRequireFailure(i)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}}},{key:"_addEventHandler",value:function(t,e,n,r,i){if("string"==typeof t){var o=this.manager,a=this.events,s=oe[t]||t,c=a.get(s);c||(c=new be(this),a.set(s,c),c.recognizerName=ie[s]||s,o&&o.on(s,c.handleEvent)),c.add(t,e,n,r,i),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}else for(var u in n=e,t)this._addEventHandler(u,t[u],n,r,i)}},{key:"_removeEventHandler",value:function(t,e){if("string"==typeof t){var n=this.events,r=oe[t]||t,i=n.get(r);if(i&&(i.remove(t,e),i.isEmpty())){var o,a=i.recognizerName,s=!1,c=ye(n.values());try{for(c.s();!(o=c.n()).done;){var u=o.value;if(u.recognizerName===a&&!u.isEmpty()){s=!0;break}}}catch(h){c.e(h)}finally{c.f()}s||this._toggleRecognizer(a,!1)}}else for(var l in t)this._removeEventHandler(l,t[l])}},{key:"_onBasicInput",value:function(t){var e=t.srcEvent,n=te[e.type];n&&this.manager.emit(n,t)}},{key:"_onOtherEvent",value:function(t){this.manager.emit(t.type,t)}}]),t}();function Ee(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _e(t){for(var e=1;e0),a=o&&!this.state.isHovering,s=!o&&this.state.isHovering;(r||a)&&(t.features=e,r&&r(t)),a&&Ve.call(this,"onMouseEnter",t),s&&Ve.call(this,"onMouseLeave",t),(a||s)&&this.setState({isHovering:o})}}function We(t){var e=this.props,n=e.onClick,r=e.onNativeClick,i=e.onDblClick,o=e.doubleClickZoom,a=[],s=i||o;switch(t.type){case"anyclick":a.push(r),s||a.push(n);break;case"click":s&&a.push(n)}(a=a.filter(Boolean)).length&&((t=Fe.call(this,t)).features=Ze.call(this,t.point),a.forEach((function(e){return e(t)})))}var He=Object(o.forwardRef)((function(t,e){var n=Object(o.useContext)(lt),i=Object(o.useMemo)((function(){return t.controller||new Re}),[]),a=Object(o.useMemo)((function(){return new je(null,{touchAction:t.touchAction,recognizerOptions:t.eventRecognizerOptions})}),[]),s=Object(o.useRef)(null),c=Object(o.useRef)(null),u=Object(o.useRef)({width:0,height:0,state:{isHovering:!1,isDragging:!1}}).current;u.props=t,u.map=c.current&&c.current.getMap(),u.setState=function(e){u.state=Le(Le({},u.state),e),s.current.style.cursor=t.getCursor(u.state)};var l,h,p=!0,f=function(t,e,n){if(p)l=[t,e,n];else{var r=u.props,i=r.onViewStateChange,o=r.onViewportChange;Object.defineProperty(t,"position",{get:function(){return[0,0,pt(u.map,t)]}}),i&&i({viewState:t,interactionState:e,oldViewState:n}),o&&o(t,e,n)}};Object(o.useImperativeHandle)(e,(function(){return function(t){return{getMap:t.current&&t.current.getMap,queryRenderedFeatures:t.current&&t.current.queryRenderedFeatures}}(c)}),[]);var d=Object(o.useMemo)((function(){return Le(Le({},n),{},{eventManager:a,container:n.container||s.current})}),[n,s.current]);d.onViewportChange=f,d.viewport=n.viewport||gt(u),u.viewport=d.viewport;var v=function(t){var e=t.isDragging,n=void 0!==e&&e;if(n!==u.state.isDragging&&u.setState({isDragging:n}),p)h=t;else{var r=u.props.onInteractionStateChange;r&&r(t)}},g=function(){u.width&&u.height&&i.setOptions(Le(Le(Le({},u.props),u.props.viewState),{},{isInteractive:Boolean(u.props.onViewStateChange||u.props.onViewportChange),onViewportChange:f,onStateChange:v,eventManager:a,width:u.width,height:u.height}))};Object(o.useEffect)((function(){return a.setElement(s.current),a.on({pointerdown:Be.bind(u),pointermove:qe.bind(u),pointerup:Ue.bind(u),pointerleave:Ve.bind(u,"onMouseOut"),click:We.bind(u),anyclick:We.bind(u),dblclick:Ve.bind(u,"onDblClick"),wheel:Ve.bind(u,"onWheel"),contextmenu:Ve.bind(u,"onContextMenu")}),function(){a.destroy()}}),[]),ht((function(){l&&f.apply(void 0,Object(r.a)(l)),h&&v(h)})),g();var m=t.width,b=t.height,y=t.style,O=t.getCursor,w=Object(o.useMemo)((function(){return Le(Le({position:"relative"},y),{},{width:m,height:b,cursor:O(u.state)})}),[y,m,b,O,u.state]);return l&&u._child||(u._child=o.createElement(ut,{value:d},o.createElement("div",{key:"event-canvas",ref:s,style:w},o.createElement(wt,Object.assign({},t,{width:"100%",height:"100%",style:null,onResize:function(t){var e=t.width,n=t.height;u.width=e,u.height=n,g(),u.props.onResize({width:e,height:n})},ref:c}))))),p=!1,u._child}));He.supported=wt.supported,He.propTypes=ze,He.defaultProps=Ne;var Xe=He;function Ye(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n prop: "+r);else t.setCoordinates(e.coordinates)}}(s,t,n.current):s=Qe(a,i,t),n.current=t,s&&o.Children.map(t.children,(function(t){return t&&Object(o.cloneElement)(t,{source:i})}))||null},$e=n("zLVn");function tn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function en(t){for(var e=1;e0){var g=p,m=v;for(p=0;p<=1;p+=.5)d=(f=n-p*a)+a,(v=Math.max(0,u-f)+Math.max(0,d-i+u))0){var j=h,E=w;for(h=0;h<=1;h+=b)O=(y=e-h*o)+o,(w=Math.max(0,u-y)+Math.max(0,O-r+u))1||s<-1||o<0||o>e.width||a<0||a>e.height?d.display="none":d.zIndex=Math.floor((1-s)/2*1e5),d):d}(t,s,i.current,g,m),y=Object(o.useCallback)((function(t){n.props.onClose();var e=n.context.eventManager;e&&e.once("click",(function(t){return t.stopPropagation()}),t.target)}),[]);return o.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-"+m+" "+u,style:b,ref:i},o.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:p}}),o.createElement("div",{key:"content",ref:e,className:"mapboxgl-popup-content"},f&&o.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:y},"×"),d))}kn.defaultProps=xn;var Dn=o.memo(kn);function Cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var In=Object.assign({},cn,{className:"",toggleLabel:"Toggle Attribution"});function Rn(t){var e=ln(t),n=e.context,r=e.containerRef,a=Object(o.useRef)(null),s=Object(o.useState)(!1),c=s[0],u=s[1];Object(o.useEffect)((function(){var e;return n.map&&(e=function(t,e,n,r){var i=new X.a.AttributionControl(t);return i._map=e,i._container=n,i._innerContainer=r,i._updateAttributions(),i._updateEditLink(),e.on("styledata",i._updateData),e.on("sourcedata",i._updateData),i}({customAttribution:t.customAttribution},n.map,r.current,a.current)),function(){return e&&function(t){t._map.off("styledata",t._updateData),t._map.off("sourcedata",t._updateData)}(e)}}),[n.map]);var l=void 0===t.compact?n.viewport.width<=640:t.compact;Object(o.useEffect)((function(){!l&&c&&u(!1)}),[l]);var h=Object(o.useCallback)((function(){return u((function(t){return!t}))}),[]),p=Object(o.useMemo)((function(){return function(t){for(var e=1;ea)return 1}return 0}(t,"1.6.0")>=0?2:1}function Jn(t,e,n){var r=t.viewport,i=new ot(Object.assign({},r,n)),o=Object.assign({},i.getViewportProps(),Me),a=e.onViewportChange||t.onViewportChange||Gn;(e.onViewStateChange||t.onViewStateChange||Gn)({viewState:o}),a(o)}function $n(t,e,n,r){return o.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-"+t,type:"button",title:e,onClick:n},r||o.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}function tr(t){var e=ln(t),n=e.context,r=e.containerRef,a=t.className,s=t.showCompass,c=t.showZoom,u=t.zoomInLabel,l=t.zoomOutLabel,h=t.compassLabel,p=Object(o.useMemo)((function(){return function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}n.d(e,"a",(function(){return r}))}}]); \ No newline at end of file +/*! For license information please see 73944ee5ea94c1d98436bc52f9523528f31fde99-0a1690d3fd163c21521f.js.LICENSE.txt */ +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{ExcP:function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var r="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i="undefined"!=typeof window?window:t,o=(void 0!==t||window,"undefined"!=typeof document&&document,!1);try{var a={get passive(){return o=!0,!0}};i.addEventListener("test",a,a),i.removeEventListener("test",a,a)}catch(s){}}).call(this,n("yLpj"))},ODXe:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("BsWD");function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(c){i=!0,o=c}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,e)||Object(r.a)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},QFcT:function(t,e,n){var r=n("I+eb"),i=Math.hypot,o=Math.abs,a=Math.sqrt;r({target:"Math",stat:!0,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(t,e){for(var n,r,i=0,s=0,c=arguments.length,u=0;s0?(r=n/u)*r:n;return u===1/0?1/0:u*a(i)}})},QFtD:function(t,e,n){var r;!function(i,o,a,s){"use strict";var c,u=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),h=Math.round,p=Math.abs,f=Date.now;function d(t,e,n){return setTimeout(w(t,n),e)}function v(t,e,n){return!!Array.isArray(t)&&(g(t,n[e],n),!0)}function g(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}c="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n-1}function x(t){return t.trim().split(/\s+/g)}function T(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;rn[e]})):r.sort()),r}function C(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=B(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,c=e.center=U(r);e.timeStamp=f(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=X(s,c),e.distance=H(s,c),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y});e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=W(e.deltaX,e.deltaY);var u=q(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=p(u.x)>p(u.y)?u.x:u.y,e.scale=a?(l=a.pointers,h=r,H(h[0],h[1],F)/H(l[0],l[1],F)):1,e.rotation=a?function(t,e){return X(e[1],e[0],F)+X(t[1],t[0],F)}(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,o,a=t.lastInterval||e,s=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(s>25||void 0===a.velocity)){var c=e.deltaX-a.deltaX,u=e.deltaY-a.deltaY,l=q(s,c,u);r=l.x,i=l.y,n=p(l.x)>p(l.y)?l.x:l.y,o=W(c,u),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}(n,e);var l,h;var d=t.element;M(e.srcEvent.target,d)&&(d=e.srcEvent.target);e.target=d}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function B(t){for(var e=[],n=0;n=p(e)?t<0?2:4:e<0?8:16}function H(t,e,n){n||(n=N);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function X(t,e,n){n||(n=N);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&P(this.element,this.evEl,this.domHandler),this.evTarget&&P(this.target,this.evTarget,this.domHandler),this.evWin&&P(R(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4};function G(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,Z.apply(this,arguments)}O(G,Z,{handler:function(t){var e=Y[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var K={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:"touch",3:"pen",4:"mouse",5:"kinect"},J="pointerdown",$="pointermove pointerup pointercancel";function tt(){this.evEl=J,this.evWin=$,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(J="MSPointerDown",$="MSPointerMove MSPointerUp MSPointerCancel"),O(tt,Z,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=K[r],o=Q[t.pointerType]||t.pointerType,a="touch"==o,s=T(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&i&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var et={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function nt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function rt(t,e){var n=k(t.touches),r=k(t.changedTouches);return 12&e&&(n=D(n.concat(r),"identifier",!0)),[n,r]}O(nt,Z,{handler:function(t){var e=et[t.type];if(1===e&&(this.started=!0),this.started){var n=rt.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ot(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},Z.apply(this,arguments)}function at(t,e){var n=k(t.touches),r=this.targetIds;if(3&e&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=k(t.changedTouches),s=[],c=this.target;if(o=n.filter((function(t){return M(t.target,c)})),1===e)for(i=0;i-1&&r.splice(t,1)}),2500)}}function lt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+gt(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+gt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&i&e.direction},attrTest:function(t){return yt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=mt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),O(wt,yt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),O(jt,vt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distancee.time;if(this._input=t,!r||!n||12&t.eventType&&!i)this.reset();else if(1&t.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),O(Et,yt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),O(_t,yt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ot.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=mt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),O(Pt,vt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance0;)r.appendChild(n.childNodes[0]);this._map._container=r,t.savedMap=null,e.mapStyle&&this._map.setStyle(Object(o.a)(e.mapStyle),{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)},e._create=function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var n=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=n,e.gl}}var r={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:Object(o.a)(e.mapStyle),interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(r.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},r,e.mapOptions)),this._map.once("load",this._fireLoadEvent),this._map.on("error",this._handleError)}return this},e._destroy=function(){this._map&&(this.props.reuseMaps&&!t.savedMap?(t.savedMap=this._map,this._map.off("load",this._fireLoadEvent),this._map.off("error",this._handleError),this._map.off("styledata",this._fireLoadEvent)):this._map.remove(),this._map=null)},e._initialize=function(t){var e=this;c(t=Object.assign({},s,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||s.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var n=t.container;Object.defineProperty(n,"offsetWidth",{get:function(){return e.width}}),Object.defineProperty(n,"clientWidth",{get:function(){return e.width}}),Object.defineProperty(n,"offsetHeight",{get:function(){return e.height}}),Object.defineProperty(n,"clientHeight",{get:function(){return e.height}});var r=this._map.getCanvas();r&&(r.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t},e._update=function(t,e){if(this._map){c(e=Object.assign({},this.props,e),"Mapbox");var n=this._updateMapViewport(t,e),r=this._updateMapSize(t,e);this._updateMapStyle(t,e),e.asyncRender||!n&&!r||this.redraw(),this.props=e}},e._updateMapStyle=function(t,e){t.mapStyle!==e.mapStyle&&this._map.setStyle(Object(o.a)(e.mapStyle),{diff:!e.preventStyleDiffing})},e._updateMapSize=function(t,e){var n=t.width!==e.width||t.height!==e.height;return n&&(this.width=e.width,this.height=e.height,this._map.resize()),n},e._updateMapViewport=function(t,e){var n=this._getViewState(t),r=this._getViewState(e),i=r.latitude!==n.latitude||r.longitude!==n.longitude||r.zoom!==n.zoom||r.pitch!==n.pitch||r.bearing!==n.bearing||r.altitude!==n.altitude;return i&&(this._map.jumpTo(this._viewStateToMapboxProps(r)),r.altitude!==n.altitude&&(this._map.transform.altitude=r.altitude)),i},e._getViewState=function(t){var e=t.viewState||t,n=e.longitude,r=e.latitude,i=e.zoom,o=e.pitch,a=void 0===o?0:o,s=e.bearing,c=void 0===s?0:s,u=e.altitude;return{longitude:n,latitude:r,zoom:i,pitch:a,bearing:c,altitude:void 0===u?1.5:u}},e._checkStyleSheet=function(t){if(void 0===t&&(t="0.47.0"),void 0!==i.a)try{var e=i.a.createElement("div");if(e.className="mapboxgl-map",e.style.display="none",i.a.body.appendChild(e),!("static"!==window.getComputedStyle(e).position)){var n=i.a.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v"+t+"/mapbox-gl.css"),i.a.head.appendChild(n)}}catch(r){}},e._viewStateToMapboxProps=function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}},t}();u.initialized=!1,u.propTypes=a,u.defaultProps=s,u.savedMap=null}).call(this,n("8oxB"))},ZaHm:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"e",(function(){return c})),n.d(e,"f",(function(){return u})),n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return h}));n("QFcT");var r=n("yU0y");function i(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],v=e[13],g=e[14],m=e[15],b=n*s-r*a,y=n*c-i*a,O=n*u-o*a,w=r*c-i*s,j=r*u-o*s,E=i*u-o*c,_=l*v-h*d,P=l*g-p*d,M=l*m-f*d,S=h*g-p*v,x=h*m-f*v,T=p*m-f*g,k=b*T-y*x+O*S+w*M-j*P+E*_;return k?(k=1/k,t[0]=(s*T-c*x+u*S)*k,t[1]=(i*x-r*T-o*S)*k,t[2]=(v*E-g*j+m*w)*k,t[3]=(p*j-h*E-f*w)*k,t[4]=(c*M-a*T-u*P)*k,t[5]=(n*T-i*M+o*P)*k,t[6]=(g*O-d*E-m*y)*k,t[7]=(l*E-p*O+f*y)*k,t[8]=(a*x-s*M+u*_)*k,t[9]=(r*M-n*x-o*_)*k,t[10]=(d*j-v*O+m*b)*k,t[11]=(h*O-l*j-f*b)*k,t[12]=(s*P-a*S-c*_)*k,t[13]=(n*S-r*P+i*_)*k,t[14]=(v*y-d*w-g*b)*k,t[15]=(l*w-h*y+p*b)*k,t):null}function o(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],u=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],v=e[12],g=e[13],m=e[14],b=e[15],y=n[0],O=n[1],w=n[2],j=n[3];return t[0]=y*r+O*s+w*h+j*v,t[1]=y*i+O*c+w*p+j*g,t[2]=y*o+O*u+w*f+j*m,t[3]=y*a+O*l+w*d+j*b,y=n[4],O=n[5],w=n[6],j=n[7],t[4]=y*r+O*s+w*h+j*v,t[5]=y*i+O*c+w*p+j*g,t[6]=y*o+O*u+w*f+j*m,t[7]=y*a+O*l+w*d+j*b,y=n[8],O=n[9],w=n[10],j=n[11],t[8]=y*r+O*s+w*h+j*v,t[9]=y*i+O*c+w*p+j*g,t[10]=y*o+O*u+w*f+j*m,t[11]=y*a+O*l+w*d+j*b,y=n[12],O=n[13],w=n[14],j=n[15],t[12]=y*r+O*s+w*h+j*v,t[13]=y*i+O*c+w*p+j*g,t[14]=y*o+O*u+w*f+j*m,t[15]=y*a+O*l+w*d+j*b,t}function a(t,e,n){var r,i,o,a,s,c,u,l,h,p,f,d,v=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*m+e[12],t[13]=e[1]*v+e[5]*g+e[9]*m+e[13],t[14]=e[2]*v+e[6]*g+e[10]*m+e[14],t[15]=e[3]*v+e[7]*g+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],u=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=u,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*v+s*g+h*m+e[12],t[13]=i*v+c*g+p*m+e[13],t[14]=o*v+u*g+f*m+e[14],t[15]=a*v+l*g+d*m+e[15]),t}function s(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function c(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],u=e[8],l=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=c*i+p*r,t[8]=u*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-c*r,t}function u(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],u=e[4],l=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=c*i+p*r,t[4]=u*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=p*i-c*r,t}function l(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function h(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],p=t[9],f=t[10],d=t[11],v=t[12],g=t[13],m=t[14],b=t[15],y=e[0],O=e[1],w=e[2],j=e[3],E=e[4],_=e[5],P=e[6],M=e[7],S=e[8],x=e[9],T=e[10],k=e[11],D=e[12],C=e[13],I=e[14],R=e[15];return Math.abs(n-y)<=r.b*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-O)<=r.b*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(o-w)<=r.b*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-j)<=r.b*Math.max(1,Math.abs(a),Math.abs(j))&&Math.abs(s-E)<=r.b*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(c-_)<=r.b*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-P)<=r.b*Math.max(1,Math.abs(u),Math.abs(P))&&Math.abs(l-M)<=r.b*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(h-S)<=r.b*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(p-x)<=r.b*Math.max(1,Math.abs(p),Math.abs(x))&&Math.abs(f-T)<=r.b*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(d-k)<=r.b*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(v-D)<=r.b*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(g-C)<=r.b*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-I)<=r.b*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(b-R)<=r.b*Math.max(1,Math.abs(b),Math.abs(R))}},Zs1x:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));"undefined"!=typeof window&&window,void 0!==t||window;var r="undefined"!=typeof document?document:{}}).call(this,n("yLpj"))},ZxFD:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return c})),n.d(e,"f",(function(){return h}));n("QFcT");var r=n("yU0y");function i(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function o(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function a(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function s(t,e){return t[0]=-e[0],t[1]=-e[1],t}function c(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}var u,l,h=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};u=new r.a(2),r.a!=Float32Array&&(u[0]=0,u[1]=0),l=u},bl9R:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));n("QFcT");var r=n("yU0y");function i(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function o(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}var a,s;a=new r.a(4),r.a!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0),s=a},iXzu:function(t,e,n){"use strict";(function(t){n("E9XD");var r=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n0},t.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;s.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),l=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),j="undefined"!=typeof WeakMap?new WeakMap:new r,E=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new w(e,n,this);j.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){E.prototype[t]=function(){var e;return(e=j.get(this))[t].apply(e,arguments)}}));var _=void 0!==o.ResizeObserver?o.ResizeObserver:E;e.a=_}).call(this,n("yLpj"))},"n+fv":function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return c}));n("QFcT");var r=n("yU0y");function i(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function o(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}var a,s,c=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t};a=new r.a(3),r.a!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0),s=a},oXiK:function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return Xe})),n.d(e,"InteractiveMap",(function(){return Xe})),n.d(e,"StaticMap",(function(){return wt})),n.d(e,"Source",(function(){return Je})),n.d(e,"Layer",(function(){return sn})),n.d(e,"BaseControl",(function(){return pn})),n.d(e,"Marker",(function(){return Pn})),n.d(e,"Popup",(function(){return Dn})),n.d(e,"AttributionControl",(function(){return An})),n.d(e,"FullscreenControl",(function(){return Vn})),n.d(e,"GeolocateControl",(function(){return Xn})),n.d(e,"NavigationControl",(function(){return er})),n.d(e,"ScaleControl",(function(){return or})),n.d(e,"CanvasOverlay",(function(){return cr})),n.d(e,"HTMLOverlay",(function(){return hr})),n.d(e,"SVGOverlay",(function(){return dr})),n.d(e,"TRANSITION_EVENTS",(function(){return Vt})),n.d(e,"TransitionInterpolator",(function(){return _t})),n.d(e,"LinearInterpolator",(function(){return Ft})),n.d(e,"FlyToInterpolator",(function(){return At})),n.d(e,"MapController",(function(){return Re})),n.d(e,"WebMercatorViewport",(function(){return N})),n.d(e,"setRTLTextPlugin",(function(){return vr})),n.d(e,"MapContext",(function(){return lt})),n.d(e,"_useMapControl",(function(){return ln})),n.d(e,"_MapContext",(function(){return lt}));var r=n("KQm4"),i=n("rePB"),o=n("q1tI"),a=n("W0B4"),s=n("ODXe"),c=n("1OyB"),u=n("vuIU"),l=n("bl9R");function h(t,e){var n=l.b([],e,t);return l.a(n,n,1/n[3]),n}function p(t,e){var n=t%e;return n<0?e+n:n}function f(t,e,n){return n*e+(1-n)*t}var d=Math.log2||function(t){return Math.log(t)*Math.LOG2E},v=n("ZaHm"),g=n("ZxFD"),m=n("n+fv");function b(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var y=Math.PI,O=y/4,w=y/180,j=180/y;function E(t){return Math.pow(2,t)}function _(t){return d(t)}function P(t){var e=Object(s.a)(t,2),n=e[0],r=e[1];b(Number.isFinite(n)),b(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");var i=r*w;return[512*(n*w+y)/(2*y),512*(y+Math.log(Math.tan(O+.5*i)))/(2*y)]}function M(t){var e=Object(s.a)(t,2),n=e[0],r=e[1],i=n/512*(2*y)-y,o=2*(Math.atan(Math.exp(r/512*(2*y)-y))-O);return[i*j,o*j]}function S(t){var e=t.latitude,n=t.longitude,r=t.highPrecision,i=void 0!==r&&r;b(Number.isFinite(e)&&Number.isFinite(n));var o={},a=Math.cos(e*w),s=512/360/a,c=512/4003e4/a;if(o.unitsPerMeter=[c,c,c],o.metersPerUnit=[1/c,1/c,1/c],o.unitsPerDegree=[512/360,s,c],o.degreesPerUnit=[.703125,1/s,1/c],i){var u=w*Math.tan(e*w)/a,l=512/360*u/2,h=512/4003e4*u,p=h/s*c;o.unitsPerDegree2=[0,l,h],o.unitsPerMeter2=[p,0,p]}return o}function x(t){var e=t.height,n=t.pitch,r=t.bearing,i=t.altitude,o=t.scale,a=t.center,s=void 0===a?null:a,c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return v.h(c,c,[0,0,-i]),v.e(c,c,-n*w),v.f(c,c,r*w),o/=e,v.g(c,c,[o,o,o]),s&&v.h(c,c,m.c([],s)),c}function T(t){var e=t.width,n=t.height,r=t.pitch,i=function(t){var e=t.width,n=t.height,r=t.fovy,i=void 0===r?k(1.5):r,o=t.altitude,a=t.pitch,s=void 0===a?0:a,c=t.nearZMultiplier,u=void 0===c?1:c,l=t.farZMultiplier,h=void 0===l?1:l;void 0!==o&&(i=k(o));var p=.5*i*w,f=D(i),d=s*w,v=Math.sin(p)*f/Math.sin(Math.min(Math.max(Math.PI/2-d-p,.01),Math.PI-.01));return{fov:2*p,aspect:e/n,focalDistance:f,near:u,far:(Math.sin(d)*v+f)*h}}({width:e,height:n,altitude:t.altitude,fovy:t.fovy,pitch:r,nearZMultiplier:t.nearZMultiplier,farZMultiplier:t.farZMultiplier}),o=i.fov,a=i.aspect,s=i.near,c=i.far;return v.d([],o,a,s,c)}function k(t){return 2*Math.atan(.5/t)*j}function D(t){return.5/Math.tan(.5*t*w)}function C(t,e){var n=Object(s.a)(t,3),r=n[0],i=n[1],o=n[2],a=void 0===o?0:o;return b(Number.isFinite(r)&&Number.isFinite(i)&&Number.isFinite(a)),h(e,[r,i,a,1])}function I(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(s.a)(t,3),i=r[0],o=r[1],a=r[2];if(b(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a)){var c=h(e,[i,o,a,1]);return c}var u=h(e,[i,o,0,1]),l=h(e,[i,o,1,1]),p=u[2],f=l[2],d=p===f?0:((n||0)-p)/(f-p);return g.c([],u,l,d)}function R(t){var e=t.width,n=t.height,r=t.bounds,i=t.minExtent,o=void 0===i?0:i,a=t.maxZoom,c=void 0===a?24:a,u=t.padding,l=void 0===u?0:u,h=t.offset,p=void 0===h?[0,0]:h,f=Object(s.a)(r,2),v=Object(s.a)(f[0],2),g=v[0],m=v[1],y=Object(s.a)(f[1],2),O=y[0],w=y[1];if(Number.isFinite(l)){l={top:l,bottom:l,left:l,right:l}}else b(Number.isFinite(l.top)&&Number.isFinite(l.bottom)&&Number.isFinite(l.left)&&Number.isFinite(l.right));var j=new N({width:e,height:n,longitude:0,latitude:0,zoom:0}),E=j.project([g,w]),_=j.project([O,m]),P=[Math.max(Math.abs(_[0]-E[0]),o),Math.max(Math.abs(_[1]-E[1]),o)],M=[e-l.left-l.right-2*Math.abs(p[0]),n-l.top-l.bottom-2*Math.abs(p[1])];b(M[0]>0&&M[1]>0);var S=M[0]/P[0],x=M[1]/P[1],T=(l.right-l.left)/2/S,k=(l.bottom-l.top)/2/x,D=[(_[0]+E[0])/2+T,(_[1]+E[1])/2+k],C=j.unproject(D),I=Math.min(c,j.zoom+d(Math.abs(Math.min(S,x))));return b(Number.isFinite(I)),{longitude:C[0],latitude:C[1],zoom:I}}var A=Math.PI/180;function L(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.width,o=t.height,a=t.unproject,s={targetZ:r},c=a([0,o],s),u=a([i,o],s),l=t.fovy?.5*t.fovy*A:Math.atan(.5/t.altitude),h=(90-t.pitch)*A;return l>h-.01?(e=z(t,0,r),n=z(t,i,r)):(e=a([0,0],s),n=a([i,0],s)),[c,u,n,e]}function z(t,e,n){var r=t.pixelUnprojectionMatrix,i=h(r,[e,0,1,1]),o=h(r,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(o[2]-i[2]),s=M(g.c([],i,o,a));return s[2]=n,s}var N=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1},n=e.width,r=e.height,i=e.latitude,o=void 0===i?0:i,a=e.longitude,s=void 0===a?0:a,u=e.zoom,l=void 0===u?0:u,h=e.pitch,p=void 0===h?0:h,f=e.bearing,d=void 0===f?0:f,v=e.altitude,g=void 0===v?null:v,b=e.fovy,y=void 0===b?null:b,O=e.position,w=void 0===O?null:O,j=e.nearZMultiplier,_=void 0===j?.02:j,M=e.farZMultiplier,C=void 0===M?1.01:M;Object(c.a)(this,t),n=n||1,r=r||1,null===y&&null===g?y=k(g=1.5):null===y?y=k(g):null===g&&(g=D(y));var I=E(l);g=Math.max(.75,g);var R=S({longitude:s,latitude:o}),A=P([s,o]);A[2]=0,w&&m.a(A,A,m.b([],w,R.unitsPerMeter)),this.projectionMatrix=T({width:n,height:r,pitch:p,fovy:y,nearZMultiplier:_,farZMultiplier:C}),this.viewMatrix=x({height:r,scale:I,center:A,pitch:p,bearing:d,altitude:g}),this.width=n,this.height=r,this.scale=I,this.latitude=o,this.longitude=s,this.zoom=l,this.pitch=p,this.bearing=d,this.altitude=g,this.fovy=y,this.center=A,this.meterOffset=w||[0,0,0],this.distanceScales=R,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}return Object(u.a)(t,[{key:"_initMatrices",value:function(){var t=this.width,e=this.height,n=this.projectionMatrix,r=this.viewMatrix,i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];v.c(i,i,n),v.c(i,i,r),this.viewProjectionMatrix=i;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];v.g(o,o,[t/2,-e/2,1]),v.h(o,o,[1,-1,0]),v.c(o,o,i);var a=v.b([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}},{key:"equals",value:function(e){return e instanceof t&&(e.width===this.width&&e.height===this.height&&v.a(e.projectionMatrix,this.projectionMatrix)&&v.a(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=this.projectPosition(t),o=C(i,this.pixelProjectionMatrix),a=Object(s.a)(o,2),c=a[0],u=a[1],l=r?u:this.height-u;return 2===t.length?[c,l]:[c,l,o[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=e.targetZ,o=void 0===i?void 0:i,a=Object(s.a)(t,3),c=a[0],u=a[1],l=a[2],h=r?u:this.height-u,p=o&&o*this.distanceScales.unitsPerMeter[2],f=I([c,h,l],this.pixelUnprojectionMatrix,p),d=this.unprojectPosition(f),v=Object(s.a)(d,3),g=v[0],m=v[1],b=v[2];return Number.isFinite(l)?[g,m,b]:Number.isFinite(o)?[g,m,o]:[g,m]}},{key:"projectPosition",value:function(t){var e=P(t),n=Object(s.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(t){var e=M(t),n=Object(s.a)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(t){return P(t)}},{key:"unprojectFlat",value:function(t){return M(t)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=I(t.pos,this.pixelUnprojectionMatrix),r=P(e),i=g.a([],r,g.d([],n));return M(g.a([],this.center,i))}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=R(Object.assign({width:r,height:i,bounds:e},n)),a=o.longitude,s=o.latitude,c=o.zoom;return new t({width:r,height:i,longitude:a,latitude:s,zoom:c})}},{key:"getBounds",value:function(t){var e=this.getBoundingRegion(t),n=Math.min.apply(Math,Object(r.a)(e.map((function(t){return t[0]})))),i=Math.max.apply(Math,Object(r.a)(e.map((function(t){return t[0]}))));return[[n,Math.min.apply(Math,Object(r.a)(e.map((function(t){return t[1]}))))],[i,Math.max.apply(Math,Object(r.a)(e.map((function(t){return t[1]}))))]]}},{key:"getBoundingRegion",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return L(this,t.z||0)}}]),t}();function F(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,"`scale` must be a positive number");var i=this._state,o=i.startZoom,a=i.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(n)||this._unproject(e)),J(a,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:r,startZoom:o||0}),c=new N(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:a,pos:e}),u=c[0],l=c[1];return this._getUpdatedMapState({zoom:s,longitude:u,latitude:l})},e.zoomEnd=function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})},e._getUpdatedMapState=function(e){return new t(Object.assign({},this._viewportProps,this._state,e))},e._applyConstraints=function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=K(r,n,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;return t.pitch=K(a,o,i),Object.assign(t,function(t){var e=t.width,n=t.height,r=t.longitude,i=t.latitude,o=t.zoom,a=t.pitch,s=void 0===a?0:a,c=t.bearing,u=void 0===c?0:c;(r<-180||r>180)&&(r=p(r+180,360)-180),(u<-180||u>180)&&(u=p(u+180,360)-180);var l=d(n/512);if(o<=l)o=l,i=0;else{var h=n/2/Math.pow(2,o),f=M([0,h])[1];if(iv&&(i=v)}}return{width:e,height:n,longitude:r,latitude:i,zoom:o,pitch:s,bearing:u}}(t)),t},e._unproject=function(t){var e=new N(this._viewportProps);return t&&e.unproject(t)},e._calculateNewLngLat=function(t){var e=t.startPanLngLat,n=t.pos;return new N(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:n})},e._calculateNewZoom=function(t){var e=t.scale,n=t.startZoom,r=this._viewportProps,i=r.maxZoom,o=r.minZoom;return K(n+Math.log2(e),o,i)},e._calculateNewPitchAndBearing=function(t){var e=t.deltaScaleX,n=t.deltaScaleY,r=t.startBearing,i=t.startPitch;n=K(n,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,c=i;return n>0?c=i+n*(s-i):n<0&&(c=i-n*(a-i)),{pitch:c,bearing:r+180*e}},e._getRotationParams=function(t,e){var n=t[0]-e[0],r=t[1]-e[1],i=t[1],o=e[1],a=this._viewportProps,s=a.width,c=a.height,u=n/s,l=0;return r>0?Math.abs(c-o)>5&&(l=r/(o-c)*1.2):r<0&&o>5&&(l=1-i/o),{deltaScaleX:u,deltaScaleY:l=Math.min(1,Math.max(-1,l))}},t}();function at(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function st(t){for(var e=1;ee[n])return!1}var o;return!0}(t.viewState||t,w),_=Object.assign({},mt,{visibility:E?"inherit":"hidden"});return o.createElement("div",{key:"map-container",ref:h,style:j},o.createElement("div",{key:"map-mapbox",ref:l,style:_,className:m}),g,!r&&!t.disableTokenWarning&&o.createElement(yt,null))}));Ot.supported=function(){return X.a&&X.a.supported()},Ot.defaultProps=bt;var wt=Ot;function jt(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Et(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n180&&(n=n<0?n+360:n-360),n}function Tt(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return kt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:{},i={},o=U(t,e,r),a=o.startZoom,s=o.startCenterXY,c=o.uDelta,u=o.w0,l=o.u1,h=o.S,p=o.rho,d=o.rho2,v=o.r0;if(l<.01){var m,b=F(V);try{for(b.s();!(m=b.n()).done;){var y=m.value,O=t[y],w=e[y];i[y]=f(O,w,n)}}catch(D){b.e(D)}finally{b.f()}return i}var j=n*h,E=Math.cosh(v)/Math.cosh(v+p*j),P=u*((Math.cosh(v)*Math.tanh(v+p*j)-Math.sinh(v))/d)/l,S=1/E,x=a+_(S),T=g.e([],c,P);g.a(T,T,s);var k=M(T);return i.longitude=k[0],i.latitude=k[1],i.zoom=x,i}(t,e,n,this.props),o=Tt(It);!(r=o()).done;){var a=r.value;i[a]=Q(t[a],e[a],n)}return i},n.getDuration=function(t,e){var n=e.transitionDuration;return"auto"===n&&(n=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r=Object.assign({},B,r),o=i.screenSpeed,a=i.speed,s=i.maxDuration,c=U(t,e,r),u=c.S,l=c.rho,h=1e3*u;return n=Number.isFinite(o)?h/(o/l):h/a,Number.isFinite(s)&&n>s?0:n}(t,e,this.props)),n},e}(_t);function Lt(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return zt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function zt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0||"auto"===e)&&Boolean(n)},e._isUpdateDueToCurrentTransition=function(t){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(t,this.state.propsInTransition)},e._shouldIgnoreViewportChange=function(t,e){return!t||(this._isTransitionInProgress()?this.state.interruption===Vt.IGNORE||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e))},e._triggerTransition=function(t,e){J(this._isTransitionEnabled(e)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var n=e.transitionInterpolator,r=n.getDuration?n.getDuration(t,e):e.transitionDuration;if(0!==r){var i=e.transitionInterpolator.initializeProps(t,e),o={inTransition:!0,isZooming:t.zoom!==e.zoom,isPanning:t.longitude!==e.longitude||t.latitude!==e.latitude,isRotating:t.bearing!==e.bearing||t.pitch!==e.pitch};this.state={duration:r,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:this.time(),startProps:i.start,endProps:i.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(o)}},e._endTransition=function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})},e._updateViewport=function(){var t=this.time(),e=this.state,n=e.startTime,r=e.duration,i=e.easing,o=e.interpolator,a=e.startProps,s=e.endProps,c=!1,u=(t-n)/r;u>=1&&(u=1,c=!0),u=i(u);var l=o.interpolateProps(a,s,u),h=new ot(Object.assign({},this.props,l));this.state.propsInTransition=h.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),c&&(this._endTransition(),this.props.onTransitionEnd())},t}();Ut.defaultProps=Bt;var qt,Wt,Ht=n("QFtD"),Xt=n.n(Ht),Yt={mousedown:1,mousemove:2,mouseup:4};qt=Xt.a.PointerEventInput,Wt=qt.prototype.handler,qt.prototype.handler=function(t){var e=this.store;t.button>0&&(function(t,e){for(var n=0;n=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};var Gt=Xt.a.Manager,Kt=Xt.a,Qt=Kt?[[Kt.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[Kt.Rotate,{enable:!1}],[Kt.Pinch,{enable:!1}],[Kt.Swipe,{enable:!1}],[Kt.Pan,{threshold:0,enable:!1}],[Kt.Press,{enable:!1}],[Kt.Tap,{event:"doubletap",taps:2,enable:!1}],[Kt.Tap,{event:"anytap",enable:!1}],[Kt.Tap,{enable:!1}]]:null,Jt={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},$t={doubletap:["tap"]},te={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ee=["keydown","keyup"],ne=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],re=["wheel","mousewheel","DOMMouseScroll"],ie={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},oe={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},ae=n("ExcP"),se=-1!==ae.b.indexOf("firefox"),ce=re,ue=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(c.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},i),this.events=ce.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent,!!ae.a&&{passive:!1})}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"wheel"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){if(this.options.enable){var e=t.deltaY;ae.c.WheelEvent&&(se&&t.deltaMode===ae.c.WheelEvent.DOM_DELTA_PIXEL&&(e/=ae.c.devicePixelRatio),t.deltaMode===ae.c.WheelEvent.DOM_DELTA_LINE&&(e*=40));var n={x:t.clientX,y:t.clientY};0!==e&&e%4.000244140625==0&&(e=Math.floor(e/4.000244140625)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}}},{key:"_onWheel",value:function(t,e,n){this.callback({type:"wheel",center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),le=ne,he=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(c.a)(this,t),this.element=e,this.callback=n,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=le.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"pointermove"===t&&(this.enableMoveEvent=e),"pointerover"===t&&(this.enableOverEvent=e),"pointerout"===t&&(this.enableOutEvent=e),"pointerleave"===t&&(this.enableLeaveEvent=e)}},{key:"handleEvent",value:function(t){this.handleOverEvent(t),this.handleOutEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)}},{key:"handleOverEvent",value:function(t){this.enableOverEvent&&"mouseover"===t.type&&this.callback({type:"pointerover",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleOutEvent",value:function(t){this.enableOutEvent&&"mouseout"===t.type&&this.callback({type:"pointerout",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleLeaveEvent",value:function(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this.callback({type:"pointerleave",srcEvent:t,pointerType:"mouse",target:t.target})}},{key:"handleMoveEvent",value:function(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this.callback({type:"pointermove",srcEvent:t,pointerType:"mouse",target:t.target});break;case"mouseup":this.pressed=!1}}}]),t}(),pe=ee,fe=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(c.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=pe.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach((function(t){return e.addEventListener(t,r.handleEvent)}))}return Object(u.a)(t,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){"keydown"===t&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}},{key:"handleEvent",value:function(t){var e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))}}]),t}(),de=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(c.a)(this,t),this.element=e,this.callback=n,this.options=Object.assign({enable:!0},r),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}return Object(u.a)(t,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(t,e){"contextmenu"===t&&(this.options.enable=e)}},{key:"handleEvent",value:function(t){this.options.enable&&this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})}}]),t}(),ve=n("U8pU"),ge={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};var me={srcElement:"root",priority:0},be=function(){function t(e){Object(c.a)(this,t),this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}return Object(u.a)(t,[{key:"isEmpty",value:function(){return!this._active}},{key:"add",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this.handlers,a=this.handlersByElement;n&&("object"!==Object(ve.a)(n)||n.addEventListener)&&(n={srcElement:n}),n=n?Object.assign({},me,n):me;var s=a.get(n.srcElement);s||(s=[],a.set(n.srcElement,s));var c={type:t,handler:e,srcElement:n.srcElement,priority:n.priority};r&&(c.once=!0),i&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;for(var u=s.length-1;u>=0&&!(s[u].priority>=c.priority);)u--;s.splice(u+1,0,c)}},{key:"remove",value:function(t,e){for(var n=this.handlers,r=this.handlersByElement,i=n.length-1;i>=0;i--){var o=n[i];if(o.type===t&&o.handler===e){n.splice(i,1);var a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=n.some((function(t){return!t.passive}))}},{key:"handleEvent",value:function(t){if(!this.isEmpty()){for(var e=this._normalizeEvent(t),n=t.srcEvent.target;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")}}},{key:"_emit",value:function(t,e){var n=this.handlersByElement.get(e);if(n){for(var r=!1,i=function(){t.handled=!0},o=function(){t.handled=!0,r=!0},a=[],s=0;s=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Oe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(c.a)(this,t),this.options=Object.assign({},we,n),this.events=new Map,this._onBasicInput=this._onBasicInput.bind(this),this._onOtherEvent=this._onOtherEvent.bind(this),this.setElement(e);var r=n.events;r&&this.on(r)}return Object(u.a)(t,[{key:"setElement",value:function(t){var e=this;if(this.element&&this.destroy(),this.element=t,t){var n=this.options,r=n.Manager;for(var i in this.manager=new r(t,{touchAction:n.touchAction,recognizers:n.recognizers||Qt}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(Jt).forEach((function(t){var n=e.manager.get(t);n&&Jt[t].forEach((function(t){n.recognizeWith(t)}))})),n.recognizerOptions){var o=this.manager.get(i);if(o){var a=n.recognizerOptions[i];delete a.enable,o.set(a)}}this.wheelInput=new ue(t,this._onOtherEvent,{enable:!1}),this.moveInput=new he(t,this._onOtherEvent,{enable:!1}),this.keyInput=new fe(t,this._onOtherEvent,{enable:!1,tabIndex:n.tabIndex}),this.contextmenuInput=new de(t,this._onOtherEvent,{enable:!1});var c,u=ye(this.events);try{for(u.s();!(c=u.n()).done;){var l=Object(s.a)(c.value,2),h=l[0],p=l[1];p.isEmpty()||(this._toggleRecognizer(p.recognizerName,!0),this.manager.on(h,p.handleEvent))}}catch(f){u.e(f)}finally{u.f()}}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(t,e,n){this._addEventHandler(t,e,n,!1)}},{key:"once",value:function(t,e,n){this._addEventHandler(t,e,n,!0)}},{key:"watch",value:function(t,e,n){this._addEventHandler(t,e,n,!1,!0)}},{key:"off",value:function(t,e){this._removeEventHandler(t,e)}},{key:"_toggleRecognizer",value:function(t,e){var n=this.manager;if(n){var r=n.get(t);if(r&&r.options.enable!==e){r.set({enable:e});var i=$t[t];i&&!this.options.recognizers&&i.forEach((function(i){var o=n.get(i);e?(o.requireFailure(t),r.dropRequireFailure(i)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}}},{key:"_addEventHandler",value:function(t,e,n,r,i){if("string"==typeof t){var o=this.manager,a=this.events,s=oe[t]||t,c=a.get(s);c||(c=new be(this),a.set(s,c),c.recognizerName=ie[s]||s,o&&o.on(s,c.handleEvent)),c.add(t,e,n,r,i),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}else for(var u in n=e,t)this._addEventHandler(u,t[u],n,r,i)}},{key:"_removeEventHandler",value:function(t,e){if("string"==typeof t){var n=this.events,r=oe[t]||t,i=n.get(r);if(i&&(i.remove(t,e),i.isEmpty())){var o,a=i.recognizerName,s=!1,c=ye(n.values());try{for(c.s();!(o=c.n()).done;){var u=o.value;if(u.recognizerName===a&&!u.isEmpty()){s=!0;break}}}catch(h){c.e(h)}finally{c.f()}s||this._toggleRecognizer(a,!1)}}else for(var l in t)this._removeEventHandler(l,t[l])}},{key:"_onBasicInput",value:function(t){var e=t.srcEvent,n=te[e.type];n&&this.manager.emit(n,t)}},{key:"_onOtherEvent",value:function(t){this.manager.emit(t.type,t)}}]),t}();function Ee(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _e(t){for(var e=1;e0),a=o&&!this.state.isHovering,s=!o&&this.state.isHovering;(r||a)&&(t.features=e,r&&r(t)),a&&Ve.call(this,"onMouseEnter",t),s&&Ve.call(this,"onMouseLeave",t),(a||s)&&this.setState({isHovering:o})}}function We(t){var e=this.props,n=e.onClick,r=e.onNativeClick,i=e.onDblClick,o=e.doubleClickZoom,a=[],s=i||o;switch(t.type){case"anyclick":a.push(r),s||a.push(n);break;case"click":s&&a.push(n)}(a=a.filter(Boolean)).length&&((t=Fe.call(this,t)).features=Ze.call(this,t.point),a.forEach((function(e){return e(t)})))}var He=Object(o.forwardRef)((function(t,e){var n=Object(o.useContext)(lt),i=Object(o.useMemo)((function(){return t.controller||new Re}),[]),a=Object(o.useMemo)((function(){return new je(null,{touchAction:t.touchAction,recognizerOptions:t.eventRecognizerOptions})}),[]),s=Object(o.useRef)(null),c=Object(o.useRef)(null),u=Object(o.useRef)({width:0,height:0,state:{isHovering:!1,isDragging:!1}}).current;u.props=t,u.map=c.current&&c.current.getMap(),u.setState=function(e){u.state=Le(Le({},u.state),e),s.current.style.cursor=t.getCursor(u.state)};var l,h,p=!0,f=function(t,e,n){if(p)l=[t,e,n];else{var r=u.props,i=r.onViewStateChange,o=r.onViewportChange;Object.defineProperty(t,"position",{get:function(){return[0,0,pt(u.map,t)]}}),i&&i({viewState:t,interactionState:e,oldViewState:n}),o&&o(t,e,n)}};Object(o.useImperativeHandle)(e,(function(){return function(t){return{getMap:t.current&&t.current.getMap,queryRenderedFeatures:t.current&&t.current.queryRenderedFeatures}}(c)}),[]);var d=Object(o.useMemo)((function(){return Le(Le({},n),{},{eventManager:a,container:n.container||s.current})}),[n,s.current]);d.onViewportChange=f,d.viewport=n.viewport||gt(u),u.viewport=d.viewport;var v=function(t){var e=t.isDragging,n=void 0!==e&&e;if(n!==u.state.isDragging&&u.setState({isDragging:n}),p)h=t;else{var r=u.props.onInteractionStateChange;r&&r(t)}},g=function(){u.width&&u.height&&i.setOptions(Le(Le(Le({},u.props),u.props.viewState),{},{isInteractive:Boolean(u.props.onViewStateChange||u.props.onViewportChange),onViewportChange:f,onStateChange:v,eventManager:a,width:u.width,height:u.height}))};Object(o.useEffect)((function(){return a.setElement(s.current),a.on({pointerdown:Be.bind(u),pointermove:qe.bind(u),pointerup:Ue.bind(u),pointerleave:Ve.bind(u,"onMouseOut"),click:We.bind(u),anyclick:We.bind(u),dblclick:Ve.bind(u,"onDblClick"),wheel:Ve.bind(u,"onWheel"),contextmenu:Ve.bind(u,"onContextMenu")}),function(){a.destroy()}}),[]),ht((function(){l&&f.apply(void 0,Object(r.a)(l)),h&&v(h)})),g();var m=t.width,b=t.height,y=t.style,O=t.getCursor,w=Object(o.useMemo)((function(){return Le(Le({position:"relative"},y),{},{width:m,height:b,cursor:O(u.state)})}),[y,m,b,O,u.state]);return l&&u._child||(u._child=o.createElement(ut,{value:d},o.createElement("div",{key:"event-canvas",ref:s,style:w},o.createElement(wt,Object.assign({},t,{width:"100%",height:"100%",style:null,onResize:function(t){var e=t.width,n=t.height;u.width=e,u.height=n,g(),u.props.onResize({width:e,height:n})},ref:c}))))),p=!1,u._child}));He.supported=wt.supported,He.propTypes=ze,He.defaultProps=Ne;var Xe=He;function Ye(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n prop: "+r);else t.setCoordinates(e.coordinates)}}(s,t,n.current):s=Qe(a,i,t),n.current=t,s&&o.Children.map(t.children,(function(t){return t&&Object(o.cloneElement)(t,{source:i})}))||null},$e=n("zLVn");function tn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function en(t){for(var e=1;e0){var g=p,m=v;for(p=0;p<=1;p+=.5)d=(f=n-p*a)+a,(v=Math.max(0,u-f)+Math.max(0,d-i+u))0){var j=h,E=w;for(h=0;h<=1;h+=b)O=(y=e-h*o)+o,(w=Math.max(0,u-y)+Math.max(0,O-r+u))1||s<-1||o<0||o>e.width||a<0||a>e.height?d.display="none":d.zIndex=Math.floor((1-s)/2*1e5),d):d}(t,s,i.current,g,m),y=Object(o.useCallback)((function(t){n.props.onClose();var e=n.context.eventManager;e&&e.once("click",(function(t){return t.stopPropagation()}),t.target)}),[]);return o.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-"+m+" "+u,style:b,ref:i},o.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:p}}),o.createElement("div",{key:"content",ref:e,className:"mapboxgl-popup-content"},f&&o.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:y},"×"),d))}kn.defaultProps=xn;var Dn=o.memo(kn);function Cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var In=Object.assign({},cn,{className:"",toggleLabel:"Toggle Attribution"});function Rn(t){var e=ln(t),n=e.context,r=e.containerRef,a=Object(o.useRef)(null),s=Object(o.useState)(!1),c=s[0],u=s[1];Object(o.useEffect)((function(){var e;return n.map&&(e=function(t,e,n,r){var i=new X.a.AttributionControl(t);return i._map=e,i._container=n,i._innerContainer=r,i._updateAttributions(),i._updateEditLink(),e.on("styledata",i._updateData),e.on("sourcedata",i._updateData),i}({customAttribution:t.customAttribution},n.map,r.current,a.current)),function(){return e&&function(t){t._map.off("styledata",t._updateData),t._map.off("sourcedata",t._updateData)}(e)}}),[n.map]);var l=void 0===t.compact?n.viewport.width<=640:t.compact;Object(o.useEffect)((function(){!l&&c&&u(!1)}),[l]);var h=Object(o.useCallback)((function(){return u((function(t){return!t}))}),[]),p=Object(o.useMemo)((function(){return function(t){for(var e=1;ea)return 1}return 0}(t,"1.6.0")>=0?2:1}function Jn(t,e,n){var r=t.viewport,i=new ot(Object.assign({},r,n)),o=Object.assign({},i.getViewportProps(),Me),a=e.onViewportChange||t.onViewportChange||Gn;(e.onViewStateChange||t.onViewStateChange||Gn)({viewState:o}),a(o)}function $n(t,e,n,r){return o.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-"+t,type:"button",title:e,onClick:n},r||o.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}function tr(t){var e=ln(t),n=e.context,r=e.containerRef,a=t.className,s=t.showCompass,c=t.showZoom,u=t.zoomInLabel,l=t.zoomOutLabel,h=t.compassLabel,p=Object(o.useMemo)((function(){return function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0||(i[n]=t[n]);return i}n.d(e,"a",(function(){return r}))}}]); \ No newline at end of file diff --git a/73944ee5ea94c1d98436bc52f9523528f31fde99-727dd780702c9fcfc772.js.LICENSE.txt b/73944ee5ea94c1d98436bc52f9523528f31fde99-0a1690d3fd163c21521f.js.LICENSE.txt similarity index 100% rename from 73944ee5ea94c1d98436bc52f9523528f31fde99-727dd780702c9fcfc772.js.LICENSE.txt rename to 73944ee5ea94c1d98436bc52f9523528f31fde99-0a1690d3fd163c21521f.js.LICENSE.txt diff --git a/docs/advanced/custom-components/index.html b/docs/advanced/custom-components/index.html index bebea604..a1b91f34 100644 --- a/docs/advanced/custom-components/index.html +++ b/docs/advanced/custom-components/index.html @@ -88,7 +88,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

Custom Components

You may create your own map control components by consuming MapContext.

Using the MapContext

The following component renders a label "(longitude, latitude)" at the given coordinate:

import * as React from 'react';
+  

Custom Components

You may create your own map control components by consuming MapContext.

Using the MapContext

The following component renders a label "(longitude, latitude)" at the given coordinate:

import * as React from 'react';
 import MapGL, {MapContext} from 'react-map-gl';
 
 function CustomMarker(props) {
@@ -148,4 +148,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       <CustomControl />
     </MapGL>
   )
-}

Calling useMapControl(opts) returns an object containing the following fields:

  • context (MapContext) - the current context value
  • containerRef (RefObject) - this should be assigned to the ref prop of the DOM element that the event listeners should attach to.

This hook supports the following options:

  • onScroll (Function) - called on mouse wheel event. Can be used to stop map from zooming when this component is scrolled.
  • onDragStart (Function) - called on dragstart event. Can be used to stop map from panning when this component is dragged.
  • onClick (Function) - called on click event. Can be used to stop map from calling the onClick callback when this component is clicked.
  • onDoubleClick (Function) - called on double click event. Can be used to stop map from zooming when this component is double clicked.
  • onPointerMove (Function) - called on pointermove event. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.
\ No newline at end of file +}

Calling useMapControl(opts) returns an object containing the following fields:

  • context (MapContext) - the current context value
  • containerRef (RefObject) - this should be assigned to the ref prop of the DOM element that the event listeners should attach to.

This hook supports the following options:

  • onScroll (Function) - called on mouse wheel event. Can be used to stop map from zooming when this component is scrolled.
  • onDragStart (Function) - called on dragstart event. Can be used to stop map from panning when this component is dragged.
  • onClick (Function) - called on click event. Can be used to stop map from calling the onClick callback when this component is clicked.
  • onDoubleClick (Function) - called on double click event. Can be used to stop map from zooming when this component is double clicked.
  • onPointerMove (Function) - called on pointermove event. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.
\ No newline at end of file diff --git a/docs/advanced/custom-map-controller/index.html b/docs/advanced/custom-map-controller/index.html index 111641e7..b56b963a 100644 --- a/docs/advanced/custom-map-controller/index.html +++ b/docs/advanced/custom-map-controller/index.html @@ -88,7 +88,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

Custom Map Controller

Overriding The Default Map Controller

To change the default behavior of map interaction, you can provide a custom map control to the controller prop of InteractiveMap.

This custom map control must offer the following interface:

  • setOptions(options) - called by InteractiveMap when props change.
  const mapController = new MyMapController();
+  

Custom Map Controller

Overriding The Default Map Controller

To change the default behavior of map interaction, you can provide a custom map control to the controller prop of InteractiveMap.

This custom map control must offer the following interface:

  • setOptions(options) - called by InteractiveMap when props change.
  const mapController = new MyMapController();
 
   render() {
     return <ReactMapGL controller={mapController} ... />;
@@ -150,4 +150,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       super._onPanRotate(event);
       this.onRotate();
     }
-  }
\ No newline at end of file + }
\ No newline at end of file diff --git a/docs/advanced/viewport-transition/index.html b/docs/advanced/viewport-transition/index.html index d490f316..94b561df 100644 --- a/docs/advanced/viewport-transition/index.html +++ b/docs/advanced/viewport-transition/index.html @@ -90,7 +90,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

Viewport Transition

react-map-gl does not expose the transition API from mapbox-gl-js since it is designed to be a stateless component, and needs to synchronize with separate overlay systems such as deck.gl.

Instead, transitions can be defined using InteractiveMap's transition props.

Example: Fly to a New Location

import * as React from 'react';
+  

Viewport Transition

react-map-gl does not expose the transition API from mapbox-gl-js since it is designed to be a stateless component, and needs to synchronize with separate overlay systems such as deck.gl.

Instead, transitions can be defined using InteractiveMap's transition props.

Example: Fly to a New Location

import * as React from 'react';
 import ReactMapGL, {FlyToInterpolator} from 'react-map-gl';
 // 3rd-party easing functions
 import d3 from 'd3-ease';
@@ -137,4 +137,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       transitionInterpolator: new FlyToInterpolator(),
       transitionEasing: d3.easeCubic
     });
-  };

Documentation of WebMercatorViewport

Controlling Map Transitions

InteractiveMap's Transition Props

See properties of InteractiveMap.

  • transitionDuration (Number)
  • transitionInterpolator (Object)
  • transitionEasing (Function)
  • transitionInterruption (Number)
  • onTransitionStart (Function)
  • onTransitionInterrupt (Function)
  • onTransitionEnd (Function)

Transition and the onViewportChange Callback

InteractiveMap is designed to be a stateless component. For transitions to work, the application must update the viewport props returned by the onViewportChange callback:

<ReactMapGL {...viewport} onViewportChange={setViewport} />

Remarks:

  • The props returned by the callback may contain transition properties. For example, during panning and rotating, the callback is invoked with transitionDuration: 0, meaning that the map movement instantly matches the change of the pointer. When panning or zooming with keyboard, the callback is invoked with a 300ms linear transition.
  • It is recommended that when programatically triggering a transition, always explicitly set the transition properties (interpolator, easing and duration).
  • "Set and forget": the values of the following props at the start of a transition carry through the entire duration of the transition:
    • transitionDuration
    • transitionInterpolator
    • transitionEasing
    • transitionInterruption
  • The default interaction/transition behavior can always be intercepted and overwritten in the handler for onViewportChange. However, if a transition is in progress, the properties that are being transitioned (e.g. longitude and latitude) should not be manipulated, otherwise the change will be interpreted as an interruption of the transition.
  • When using FlyToInterpolator for transitionInterpolator, transitionDuration can be set to 'auto' where actual duration is auto calculated based on start and end viewports and is linear to the distance between them. This duration can be further customized using speed parameter to FlyToInterpolator constructor.

Transition Interpolators

A TransitionInterpolator instance must be supplied to the transitionInterpolator prop. It contains the following methods:

  • arePropsEqual(currentProps, nextProps) - called to determine if transition should be triggered when viewport props update.
  • initiateProps(startProps, endProps) - called before transition starts to pre-process the start and end viewport props.
  • interpolateProps(startProps, endProps, t) - called to get viewport props in transition. t is a time factor between [0, 1].

react-map-gl offers two built-in interpolator classes:

\ No newline at end of file + };

Documentation of WebMercatorViewport

Controlling Map Transitions

InteractiveMap's Transition Props

See properties of InteractiveMap.

  • transitionDuration (Number)
  • transitionInterpolator (Object)
  • transitionEasing (Function)
  • transitionInterruption (Number)
  • onTransitionStart (Function)
  • onTransitionInterrupt (Function)
  • onTransitionEnd (Function)

Transition and the onViewportChange Callback

InteractiveMap is designed to be a stateless component. For transitions to work, the application must update the viewport props returned by the onViewportChange callback:

<ReactMapGL {...viewport} onViewportChange={setViewport} />

Remarks:

  • The props returned by the callback may contain transition properties. For example, during panning and rotating, the callback is invoked with transitionDuration: 0, meaning that the map movement instantly matches the change of the pointer. When panning or zooming with keyboard, the callback is invoked with a 300ms linear transition.
  • It is recommended that when programatically triggering a transition, always explicitly set the transition properties (interpolator, easing and duration).
  • "Set and forget": the values of the following props at the start of a transition carry through the entire duration of the transition:
    • transitionDuration
    • transitionInterpolator
    • transitionEasing
    • transitionInterruption
  • The default interaction/transition behavior can always be intercepted and overwritten in the handler for onViewportChange. However, if a transition is in progress, the properties that are being transitioned (e.g. longitude and latitude) should not be manipulated, otherwise the change will be interpreted as an interruption of the transition.
  • When using FlyToInterpolator for transitionInterpolator, transitionDuration can be set to 'auto' where actual duration is auto calculated based on start and end viewports and is linear to the distance between them. This duration can be further customized using speed parameter to FlyToInterpolator constructor.

Transition Interpolators

A TransitionInterpolator instance must be supplied to the transitionInterpolator prop. It contains the following methods:

  • arePropsEqual(currentProps, nextProps) - called to determine if transition should be triggered when viewport props update.
  • initiateProps(startProps, endProps) - called before transition starts to pre-process the start and end viewport props.
  • interpolateProps(startProps, endProps, t) - called to get viewport props in transition. t is a time factor between [0, 1].

react-map-gl offers two built-in interpolator classes:

\ No newline at end of file diff --git a/docs/api-reference/attribution-control/index.html b/docs/api-reference/attribution-control/index.html index 327ee96e..69e0370a 100644 --- a/docs/api-reference/attribution-control/index.html +++ b/docs/api-reference/attribution-control/index.html @@ -90,7 +90,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

AttributionControl

Since v5.3

This is a React equivalent of Mapbox's AttributionControl.

import * as React from 'react';
+  

AttributionControl

Since v5.3

This is a React equivalent of Mapbox's AttributionControl.

import * as React from 'react';
 import ReactMapGL, {AttributionControl} from 'react-map-gl';
 
 const attributionStyle= {
@@ -110,4 +110,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       <AttributionControl compact={true} style={attributionStyle} />
     </ReactMapGL>
   );
-}

Properties

toggleLabel (String)
  • default: 'Toggle Attribution'

Label applied to the toggle button.

compact (Boolean)

If true, force a compact attribution that shows the full attribution on mouse hover. If false, force the full attribution control. When undefined, shows a responsive attribution that collapses when the map is less than 640 pixels wide.

customAttribution (String|[String])

String or strings to show in addition to any other attributions.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

attribution-control.js

\ No newline at end of file +}

Properties

toggleLabel (String)
  • default: 'Toggle Attribution'

Label applied to the toggle button.

compact (Boolean)

If true, force a compact attribution that shows the full attribution on mouse hover. If false, force the full attribution control. When undefined, shows a responsive attribution that collapses when the map is less than 640 pixels wide.

customAttribution (String|[String])

String or strings to show in addition to any other attributions.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

attribution-control.js

\ No newline at end of file diff --git a/docs/api-reference/canvas-overlay/index.html b/docs/api-reference/canvas-overlay/index.html index 4e7d0350..cb2effeb 100644 --- a/docs/api-reference/canvas-overlay/index.html +++ b/docs/api-reference/canvas-overlay/index.html @@ -86,4 +86,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

CanvasOverlay

Allows applications to overlay data on top of maps using a canvas.

Properties

redraw (Function)

Called every time the map updates.

Parameters:

  • ctx {CanvasRenderingContext2D} - rendering context of the canvas
  • width {Number} - width of the viewport
  • height {Number} - height of the viewport
  • project {Function} - get screen position [x, y] from geo coordinates [lng, lat]
  • unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y]
captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: false

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: false

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: false

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Source

canvas-overlay.js

\ No newline at end of file +

CanvasOverlay

Allows applications to overlay data on top of maps using a canvas.

Properties

redraw (Function)

Called every time the map updates.

Parameters:

  • ctx {CanvasRenderingContext2D} - rendering context of the canvas
  • width {Number} - width of the viewport
  • height {Number} - height of the viewport
  • project {Function} - get screen position [x, y] from geo coordinates [lng, lat]
  • unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y]
captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: false

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: false

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: false

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Source

canvas-overlay.js

\ No newline at end of file diff --git a/docs/api-reference/fly-to-interpolator/index.html b/docs/api-reference/fly-to-interpolator/index.html index 29baad12..ae05353e 100644 --- a/docs/api-reference/fly-to-interpolator/index.html +++ b/docs/api-reference/fly-to-interpolator/index.html @@ -90,9 +90,9 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

FlyToInterpolator

Since v3.2

Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap.

This interpolator offers similar behavior to Mapbox's flyTo method.

import ReactMapGL, {FlyToInterpolator} from 'react-map-gl';
+  

FlyToInterpolator

Since v3.2

Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap.

This interpolator offers similar behavior to Mapbox's flyTo method.

import ReactMapGL, {FlyToInterpolator} from 'react-map-gl';
 
 <ReactMapGL
     ...
     transitionDuration={1000}
-    transitionInterpolator={new FlyToInterpolator()} />

Constructor

new FlyToInterpolator([options])

Parameters:

  • options {Object} (optional)
    • curve (Number, optional, default: 1.414) - The zooming "curve" that will occur along the flight path.
    • speed (Number, optional, default: 1.2) - The average speed of the animation defined in relation to options.curve, it linearly affects the duration, higher speed returns smaller durations and vice versa.
    • screenSpeed (Number, optional) - The average speed of the animation measured in screenfuls per second. Similar to opts.speed it linearly affects the duration, when specified opts.speed is ignored.
    • maxDuration (Number, optional) - Maximum duration in milliseconds, if calculated duration exceeds this value, 0 is returned.

Source

viewport-fly-to-interpolator.js

\ No newline at end of file + transitionInterpolator={new FlyToInterpolator()} />

Constructor

new FlyToInterpolator([options])

Parameters:

  • options {Object} (optional)
    • curve (Number, optional, default: 1.414) - The zooming "curve" that will occur along the flight path.
    • speed (Number, optional, default: 1.2) - The average speed of the animation defined in relation to options.curve, it linearly affects the duration, higher speed returns smaller durations and vice versa.
    • screenSpeed (Number, optional) - The average speed of the animation measured in screenfuls per second. Similar to opts.speed it linearly affects the duration, when specified opts.speed is ignored.
    • maxDuration (Number, optional) - Maximum duration in milliseconds, if calculated duration exceeds this value, 0 is returned.

Source

viewport-fly-to-interpolator.js

\ No newline at end of file diff --git a/docs/api-reference/fullscreen-control/index.html b/docs/api-reference/fullscreen-control/index.html index 1be86f69..44392b80 100644 --- a/docs/api-reference/fullscreen-control/index.html +++ b/docs/api-reference/fullscreen-control/index.html @@ -90,7 +90,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

FullscreenControl

Since v4.1

This is a React equivalent of Mapbox's FullscreenControl.

import * as React from 'react';
+  

FullscreenControl

Since v4.1

This is a React equivalent of Mapbox's FullscreenControl.

import * as React from 'react';
 import ReactMapGL, {FullscreenControl} from 'react-map-gl';
 
 const fullscreenControlStyle= {
@@ -109,4 +109,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       <FullscreenControl style={fullscreenControlStyle} />
     </ReactMapGL>
   );
-}

Properties

container (HTMLElement)

container is the compatible DOM element which should be made full screen. By default, the map container element will be made full screen.

label (String)
  • default: Toggle fullscreen

Label applied to the fullscreen control button.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

fullscreen-control.js

\ No newline at end of file +}

Properties

container (HTMLElement)

container is the compatible DOM element which should be made full screen. By default, the map container element will be made full screen.

label (String)
  • default: Toggle fullscreen

Label applied to the fullscreen control button.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

fullscreen-control.js

\ No newline at end of file diff --git a/docs/api-reference/geolocate-control/index.html b/docs/api-reference/geolocate-control/index.html index 79f267ad..6ca6562d 100644 --- a/docs/api-reference/geolocate-control/index.html +++ b/docs/api-reference/geolocate-control/index.html @@ -92,10 +92,10 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

GeolocateControl

Since v4.1

This is a React equivalent of Mapbox's GeolocateControl.

import * as React from 'react';
-import ReactMapGL, {GeolocateControl} from "react-map-gl";
+  

GeolocateControl

Since v4.1

This is a React equivalent of Mapbox's GeolocateControl.

import * as React from 'react';
+import ReactMapGL, {GeolocateControl} from 'react-map-gl';
 
-const geolocateControlStyle= {
+const geolocateControlStyle = {
   right: 10,
   top: 10
 };
@@ -116,4 +116,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       />
     </ReactMapGL>
   );
-}

Properties

Accepts all the options of Mapbox GeolocateControl.

onViewportChange (Function, optional)

Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing InteractiveMap's onViewportChange.

onGeolocate (Function, optional)

Callback when Geolocation API position updates. It is called with a Geolocation API PositionOptions object.

positionOptions (Object)
  • default: {enableHighAccuracy: false, timeout: 6000}

A Geolocation API PositionOptions object.

fitBoundsOptions (Object)
  • default: {maxZoom: 15}

A fitBounds options object to use when the map is panned and zoomed to the user's location. The default is to use a maxZoom of 15 to limit how far the map will zoom in for very accurate locations.

trackUserLocation (Boolean)
  • default: false

If true the Geolocate Control becomes a toggle button and when active the map will receive updates to the user's location as it changes.

showUserLocation (Boolean)
  • default: true

By default a dot will be shown on the map at the user's location. Set to false to disable.

showAccuracyCircle (Boolean)
  • default: true

By default, if showUserLocation is true , a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to false to disable. Always disabled when showUserLocation is false.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

label (String)
  • default: 'Find My Location'

Label applied to the Geolocate control button.

disabledLabel (String)
  • default: 'Location Not Available'

Label applied to the Geolocate control button if geolocation is disabled by the user.

auto (Boolean)
  • default: false

Programmatically triggers geolocate when set to true. Initializing the component with true triggers inside componentDidMount where as changing to true at a later point triggers inside componentDidUpdate. Initally setting as or changing to false has no effect.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

geolocate-control.js

\ No newline at end of file +}

Properties

Accepts all the options of Mapbox GeolocateControl.

onViewportChange (Function, optional)

Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing InteractiveMap's onViewportChange.

onGeolocate (Function, optional)

Callback when Geolocation API position updates. It is called with a Geolocation API PositionOptions object.

positionOptions (Object)
  • default: {enableHighAccuracy: false, timeout: 6000}

A Geolocation API PositionOptions object.

fitBoundsOptions (Object)
  • default: {maxZoom: 15}

A fitBounds options object to use when the map is panned and zoomed to the user's location. The default is to use a maxZoom of 15 to limit how far the map will zoom in for very accurate locations.

trackUserLocation (Boolean)
  • default: false

If true the Geolocate Control becomes a toggle button and when active the map will receive updates to the user's location as it changes.

showUserLocation (Boolean)
  • default: true

By default a dot will be shown on the map at the user's location. Set to false to disable.

showUserHeading (Boolean)
  • default: false

If true a heading indicator will be shown on the map at the user's location.

showAccuracyCircle (Boolean)
  • default: true

By default, if showUserLocation is true , a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to false to disable. Always disabled when showUserLocation is false.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

label (String)
  • default: 'Find My Location'

Label applied to the Geolocate control button.

disabledLabel (String)
  • default: 'Location Not Available'

Label applied to the Geolocate control button if geolocation is disabled by the user.

auto (Boolean)
  • default: false

Programmatically triggers geolocate when set to true. Initializing the component with true triggers inside componentDidMount where as changing to true at a later point triggers inside componentDidUpdate. Initally setting as or changing to false has no effect.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

geolocate-control.js

\ No newline at end of file diff --git a/docs/api-reference/html-overlay/index.html b/docs/api-reference/html-overlay/index.html index 16a2729e..6b253dfe 100644 --- a/docs/api-reference/html-overlay/index.html +++ b/docs/api-reference/html-overlay/index.html @@ -86,4 +86,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

HTMLOverlay

Allows applications to overlay data on top of maps using a HTML container.

Properties

redraw (Function)

Called every time the map updates.

Parameters:

  • width {Number} - width of the viewport
  • height {Number} - height of the viewport
  • project {Function} - get screen position [x, y] from geo coordinates [lng, lat]
  • unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y]
style (Object)

Additional css styles of the div container.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: false

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: false

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: false

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Source

html-overlay.js

\ No newline at end of file +

HTMLOverlay

Allows applications to overlay data on top of maps using a HTML container.

Properties

redraw (Function)

Called every time the map updates.

Parameters:

  • width {Number} - width of the viewport
  • height {Number} - height of the viewport
  • project {Function} - get screen position [x, y] from geo coordinates [lng, lat]
  • unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y]
style (Object)

Additional css styles of the div container.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: false

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: false

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: false

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Source

html-overlay.js

\ No newline at end of file diff --git a/docs/api-reference/interactive-map/index.html b/docs/api-reference/interactive-map/index.html index abd32cb5..4ae4a5b0 100644 --- a/docs/api-reference/interactive-map/index.html +++ b/docs/api-reference/interactive-map/index.html @@ -94,7 +94,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

default (InteractiveMap)

Since v3.0

This component renders MapboxGL and provides full interactivity support. +

default (InteractiveMap)

Since v3.0

This component renders MapboxGL and provides full interactivity support. It uses StaticMap underneath to render the final map component. This is the default exported component from react-map-gl.

import * as React from 'react';
 import ReactMapGL from 'react-map-gl';
@@ -117,4 +117,4 @@ This is the eventRecognizerOptions={eventRecognizerOptions}
 />

Note that the value of this prop is used once when the component mounts. Subsequent changes will be ignored.

clickRadius (Number)
  • default: 0

Radius to detect features around a clicked point.

controller (Object)

A map controller instance to replace the default map controller.

This object must implement the following interface:

  • events - An array of subscribed events
  • handleEvent(event, context) - A method that handles interactive events
interactiveLayerIds (Array)
  • default: null

A list of layer ids that are interactive. If specified:

  • Pointer event callbacks will only query the features under the pointer of these layers.
  • The getCursor callback will receive isHovering: true when hover over features of these layers.

If not specified:

  • Pointer event callbacks will query the features under the pointer of all layers.
  • The getCursor callback will always receive isHovering: false.

Transitions

transitionDuration (Number)
  • default: 0

Duration of transition in milliseconds. If specified, the map's viewport will smoothly move from the previous props to the current one.

transitionInterpolator (Object)
  • default: new LinearInterpolator()

An interpolator object that defines the transition behavior between two map states. react-map-gl offers two interpolators:

  • LinearInterpolator - similar to Mapbox's easeTo behavior.
  • FlyToInterpolator - similar to Mapbox's flyTo behavior.

You may import them as follows:

import ReactMapGL, {LinearInterpolator, FlyToInterpolator} from 'react-map-gl';
 
-<ReactMapGL transitionDuration={1000} transitionInterpolator={new FlyToInterpolator()}>

For details about using transition interpolators, see transitions.

transitionEasing (Function)
  • default: t => t

Easing function that maps a value from [0, 1] to [0, 1]. Check out http://easings.net/ for common easing curves.

transitionInterruption (Number)
  • default: TRANSITION_EVENTS.BREAK

What to do if an ongoing transition is interrupted by another transition. There are 4 options:

  • TRANSITION_EVENTS.BREAK - Start new transition from the current view.
  • TRANSITION_EVENTS.SNAP_TO_END - Jump to the end of the previous transition before starting the new transition.
  • TRANSITION_EVENTS.IGNORE - Complete the previous transition and ignore the new viewport change.
  • TRANSITION_EVENTS.UPDATE - Continue the ongoing transition but change its destination to the new viewport.

You may import the constants as follows:

import {TRANSITION_EVENTS} from 'react-map-gl';

Callbacks

Inherit the following props from StaticMap:

  • onLoad (Function)
  • onResize (Function)
  • onError (Function)
onViewportChange (Function)

Callback that is fired when the map's viewport properties should be updated. If not supplied, the map is not interactive.

onViewportChange(viewState, interactionState, oldViewState);

Arguments:

  • viewState (Object) The next viewport properties, including: width, height, latitude, longitude, zoom, bearing, pitch, altitude, maxZoom, minZoom, maxPitch, minPitch, transitionDuration, transitionEasing, transitionInterpolator, transitionInterruption.
  • interactionState (Object) The current interaction that caused this viewport change. See onInteractionStateChange for possible fields.
  • oldViewState (Object) The current viewport properties.
onViewStateChange (Function)

A newer version of the onViewportChange callback. Both are supported and provide equivalent functionality.

onViewStateChange({viewState, interactionState, oldViewState});
onInteractionStateChange (Function)

Callback that is fired when the user interacted with the map.

onInteractionStateChange(interactionState)

Possible fields include:

  • interactionState.inTransition (Boolean)
  • interactionState.isDragging (Boolean)
  • interactionState.isPanning (Boolean)
  • interactionState.isRotating (Boolean)
  • interactionState.isZooming (Boolean)

Note:

  • onInteractionStateChange may be fired without onViewportChange. For example, when the pointer is released at the end of a drag-pan, isDragging are reset to false, without the viewport's longitude and latitude changing.
onHover (Function)

Called when the mouse moves over the map (without button pressed). Receives a PointerEvent object.

onClick (Function)

Called when the map is single clicked. Receives a PointerEvent object. This event is not fired on double click therefore there may be a delay between pointer up and the event.

onNativeClick (Function)

Called when the map is clicked. Receives a PointerEvent object. This event is fired twice on double click.

onDblClick (Function)

Called when the map is double clicked. Receives a PointerEvent object.

onMouseDown (Function)

Called when a pointing device (usually a mouse) is pressed within the map. Receives a PointerEvent object.

onMouseMove (Function)

Called when a pointing device (usually a mouse) is moved within the map. Receives a PointerEvent object.

onMouseUp (Function)

Called when a pointing device (usually a mouse) is released within the map. Receives a PointerEvent object.

onTouchStart (Function)

Called when a touchstart event occurs within the map. Receives a PointerEvent object.

onTouchMove (Function)

Called when a touchmove event occurs within the map. Receives a PointerEvent object.

onTouchEnd (Function)

Called when a touchend event occurs within the map. Receives a PointerEvent object.

onMouseEnter (Function)

Called when a pointing device (usually a mouse) enters a visible portion of one of the interactive layers, defined by the interactiveLayerIds prop. Receives a PointerEvent object.

onMouseLeave (Function)

Called when a pointing device (usually a mouse) leaves a visible portion of one of the interactive layers, defined by the interactiveLayerIds prop. Receives a PointerEvent object.

onWheel (Function)

Called when a wheel event occurs within the map. Receives a PointerEvent object.

onMouseOut (Function)

Called when a point device (usually a mouse) leaves the map's canvas. Receives a PointerEvent object.

onContextMenu (Function)

Called when the context menu is activated. Prevent default here to enable right button interaction.

Default: event => event.preventDefault()

onTransitionStart (Function)

Callback that is fired when a transition is triggered.

onTransitionInterrupt (Function)

Callback that is fired when an ongoing transition is interrupted by another transition.

onTransitionEnd (Function)

Callback that is fired when a transition is complete.

Methods

Inherit the following methods from StaticMap:

  • getMap()
  • queryRenderedFeatures(geometry, parameters)

Source

interactive-map.js

\ No newline at end of file +<ReactMapGL transitionDuration={1000} transitionInterpolator={new FlyToInterpolator()}>

For details about using transition interpolators, see transitions.

transitionEasing (Function)
  • default: t => t

Easing function that maps a value from [0, 1] to [0, 1]. Check out http://easings.net/ for common easing curves.

transitionInterruption (Number)
  • default: TRANSITION_EVENTS.BREAK

What to do if an ongoing transition is interrupted by another transition. There are 4 options:

  • TRANSITION_EVENTS.BREAK - Start new transition from the current view.
  • TRANSITION_EVENTS.SNAP_TO_END - Jump to the end of the previous transition before starting the new transition.
  • TRANSITION_EVENTS.IGNORE - Complete the previous transition and ignore the new viewport change.
  • TRANSITION_EVENTS.UPDATE - Continue the ongoing transition but change its destination to the new viewport.

You may import the constants as follows:

import {TRANSITION_EVENTS} from 'react-map-gl';

Callbacks

Inherit the following props from StaticMap:

  • onLoad (Function)
  • onResize (Function)
  • onError (Function)
onViewportChange (Function)

Callback that is fired when the map's viewport properties should be updated. If not supplied, the map is not interactive.

onViewportChange(viewState, interactionState, oldViewState);

Arguments:

  • viewState (Object) The next viewport properties, including: width, height, latitude, longitude, zoom, bearing, pitch, altitude, maxZoom, minZoom, maxPitch, minPitch, transitionDuration, transitionEasing, transitionInterpolator, transitionInterruption.
  • interactionState (Object) The current interaction that caused this viewport change. See onInteractionStateChange for possible fields.
  • oldViewState (Object) The current viewport properties.
onViewStateChange (Function)

A newer version of the onViewportChange callback. Both are supported and provide equivalent functionality.

onViewStateChange({viewState, interactionState, oldViewState});
onInteractionStateChange (Function)

Callback that is fired when the user interacted with the map.

onInteractionStateChange(interactionState)

Possible fields include:

  • interactionState.inTransition (Boolean)
  • interactionState.isDragging (Boolean)
  • interactionState.isPanning (Boolean)
  • interactionState.isRotating (Boolean)
  • interactionState.isZooming (Boolean)

Note:

  • onInteractionStateChange may be fired without onViewportChange. For example, when the pointer is released at the end of a drag-pan, isDragging are reset to false, without the viewport's longitude and latitude changing.
onHover (Function)

Called when the mouse moves over the map (without button pressed). Receives a PointerEvent object.

onClick (Function)

Called when the map is single clicked. Receives a PointerEvent object. This event is not fired on double click therefore there may be a delay between pointer up and the event.

onNativeClick (Function)

Called when the map is clicked. Receives a PointerEvent object. This event is fired twice on double click.

onDblClick (Function)

Called when the map is double clicked. Receives a PointerEvent object.

onMouseDown (Function)

Called when a pointing device (usually a mouse) is pressed within the map. Receives a PointerEvent object.

onMouseMove (Function)

Called when a pointing device (usually a mouse) is moved within the map. Receives a PointerEvent object.

onMouseUp (Function)

Called when a pointing device (usually a mouse) is released within the map. Receives a PointerEvent object.

onTouchStart (Function)

Called when a touchstart event occurs within the map. Receives a PointerEvent object.

onTouchMove (Function)

Called when a touchmove event occurs within the map. Receives a PointerEvent object.

onTouchEnd (Function)

Called when a touchend event occurs within the map. Receives a PointerEvent object.

onMouseEnter (Function)

Called when a pointing device (usually a mouse) enters a visible portion of one of the interactive layers, defined by the interactiveLayerIds prop. Receives a PointerEvent object.

onMouseLeave (Function)

Called when a pointing device (usually a mouse) leaves a visible portion of one of the interactive layers, defined by the interactiveLayerIds prop. Receives a PointerEvent object.

onWheel (Function)

Called when a wheel event occurs within the map. Receives a PointerEvent object.

onMouseOut (Function)

Called when a point device (usually a mouse) leaves the map's canvas. Receives a PointerEvent object.

onContextMenu (Function)

Called when the context menu is activated. Prevent default here to enable right button interaction.

Default: event => event.preventDefault()

onTransitionStart (Function)

Callback that is fired when a transition is triggered.

onTransitionInterrupt (Function)

Callback that is fired when an ongoing transition is interrupted by another transition.

onTransitionEnd (Function)

Callback that is fired when a transition is complete.

Methods

Inherit the following methods from StaticMap:

  • getMap()
  • queryRenderedFeatures(geometry, parameters)

Source

interactive-map.js

\ No newline at end of file diff --git a/docs/api-reference/layer/index.html b/docs/api-reference/layer/index.html index 5ee96b7b..ac04d925 100644 --- a/docs/api-reference/layer/index.html +++ b/docs/api-reference/layer/index.html @@ -90,7 +90,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

Layer

Since v5.1

This component allows apps to create a map layer using React.

import * as React from 'react';
+  

Layer

Since v5.1

This component allows apps to create a map layer using React.

import * as React from 'react';
 import ReactMapGL, {Layer} from 'react-map-gl';
 
 const parkLayer = {
@@ -114,4 +114,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       <Layer {...parkLayer} paint={{'fill-color': parkColor}} />
     </ReactMapGL>
   );
-}

Properties

The props provided to this component should be conforming to the Mapbox layer specification.

When props change shallowly, the component will perform style diffing to update the layer. Avoid defining constant objects/arrays inline may help performance.

Identity Properties

Once a <Layer> is mounted, the following props should not change. If you add/remove multiple JSX layers dynamically, make sure you use React's key prop to give each element a stable identity.

id (String)

Unique identifier of the layer. If not provided, a default id will be assigned.

type (String, required)

Type of the layer.

Options

beforeId (String)

The ID of an existing layer to insert this layer before. If this prop is omitted, the layer will be appended to the end of the layers array. This is useful when using dynamic layers with a map style from a URL.

Note that layers are added by the order that they mount. They are NOT reordered later if their relative positions in the JSX tree change. If dynamic reordering is desired, you should manipulate beforeId for consistent behavior.

source (String)

source is required by some layer types in the Mapbox style specification. If <Layer> is used as the child of a Source component, this prop will be overwritten by the id of the parent source.

Source

layer.js

\ No newline at end of file +}

Properties

The props provided to this component should be conforming to the Mapbox layer specification.

When props change shallowly, the component will perform style diffing to update the layer. Avoid defining constant objects/arrays inline may help performance.

Identity Properties

Once a <Layer> is mounted, the following props should not change. If you add/remove multiple JSX layers dynamically, make sure you use React's key prop to give each element a stable identity.

id (String)

Unique identifier of the layer. If not provided, a default id will be assigned.

type (String, required)

Type of the layer.

Options

beforeId (String)

The ID of an existing layer to insert this layer before. If this prop is omitted, the layer will be appended to the end of the layers array. This is useful when using dynamic layers with a map style from a URL.

Note that layers are added by the order that they mount. They are NOT reordered later if their relative positions in the JSX tree change. If dynamic reordering is desired, you should manipulate beforeId for consistent behavior.

source (String)

source is required by some layer types in the Mapbox style specification. If <Layer> is used as the child of a Source component, this prop will be overwritten by the id of the parent source.

Source

layer.js

\ No newline at end of file diff --git a/docs/api-reference/linear-interpolator/index.html b/docs/api-reference/linear-interpolator/index.html index 10f4d423..d4690b64 100644 --- a/docs/api-reference/linear-interpolator/index.html +++ b/docs/api-reference/linear-interpolator/index.html @@ -90,9 +90,9 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

LinearInterpolator

Since v3.2

Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap.

Interpolates all viewport props linearly. This interpolator offers similar behavior to Mapbox's easeTo when combined with a transitionEasing function. You may optionally limit the transition to selected viewport props, for example new LinearInterpolator(['pitch', 'bearing']) animates pitch and bearing while the user is still allowed to pan and zoom.

import ReactMapGL, {LinearInterpolator} from 'react-map-gl';
+  

LinearInterpolator

Since v3.2

Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap.

Interpolates all viewport props linearly. This interpolator offers similar behavior to Mapbox's easeTo when combined with a transitionEasing function. You may optionally limit the transition to selected viewport props, for example new LinearInterpolator(['pitch', 'bearing']) animates pitch and bearing while the user is still allowed to pan and zoom.

import ReactMapGL, {LinearInterpolator} from 'react-map-gl';
 
 <ReactMapGL
     ...
     transitionDuration={1000}
-    transitionInterpolator={new LinearInterpolator()} />

Constructor

new LinearInterpolator([options])

Parameters:

  • options {Object} (optional)
    • transitionProps {Array} (optional) - list of prop names to interpolate. Default: ['longitude', 'latitude', 'zoom', 'pitch', 'bearing'].
    • around {Array} (optional) - a point to zoom/rotate the map around, as [x, y] in screen position.

Source

linear-interpolator.js

\ No newline at end of file + transitionInterpolator={new LinearInterpolator()} />

Constructor

new LinearInterpolator([options])

Parameters:

  • options {Object} (optional)
    • transitionProps {Array} (optional) - list of prop names to interpolate. Default: ['longitude', 'latitude', 'zoom', 'pitch', 'bearing'].
    • around {Array} (optional) - a point to zoom/rotate the map around, as [x, y] in screen position.

Source

linear-interpolator.js

\ No newline at end of file diff --git a/docs/api-reference/map-context/index.html b/docs/api-reference/map-context/index.html index 96158d41..d5c29a08 100644 --- a/docs/api-reference/map-context/index.html +++ b/docs/api-reference/map-context/index.html @@ -88,7 +88,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

MapContext

Since v5.3

MapContext allows components to interact with InteractiveMap or StaticMap via React's context API.

import * as React from 'react';
+  

MapContext

Since v5.3

MapContext allows components to interact with InteractiveMap or StaticMap via React's context API.

import * as React from 'react';
 import MapGL, {MapContext} from 'react-map-gl';
 
 function CurrentZoomLevel() {
@@ -133,4 +133,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       </div>
     </MapContext.Provider>
   );
-}

Fields

The context value object may contain the following fields:

  • map (Map) - the mapbox-gl Map instance
  • viewport (WebMercatorViewport) - the current viewport
  • container (HTMLDivElement) - the outer container of the map component
  • onViewportChange (Function) - a callback invoked when a map control requests a viewport change, with the signature onViewportChange(viewState, interactionState, oldViewState)
  • onViewStateChange (Function) - an alternative callback invoked when a map control requests a viewport change, with the signature onViewStateChange({viewState, interactionState, oldViewState})
  • eventManager (EventManager) - an EventManager instance used to register all interactive events

Source

map-context.js

\ No newline at end of file +}

Fields

The context value object may contain the following fields:

  • map (Map) - the mapbox-gl Map instance
  • viewport (WebMercatorViewport) - the current viewport
  • container (HTMLDivElement) - the outer container of the map component
  • onViewportChange (Function) - a callback invoked when a map control requests a viewport change, with the signature onViewportChange(viewState, interactionState, oldViewState)
  • onViewStateChange (Function) - an alternative callback invoked when a map control requests a viewport change, with the signature onViewStateChange({viewState, interactionState, oldViewState})
  • eventManager (EventManager) - an EventManager instance used to register all interactive events

Source

map-context.js

\ No newline at end of file diff --git a/docs/api-reference/map-controller/index.html b/docs/api-reference/map-controller/index.html index d000c88b..ae5c65c6 100644 --- a/docs/api-reference/map-controller/index.html +++ b/docs/api-reference/map-controller/index.html @@ -88,4 +88,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

MapController

Since v4.0

The easiest way to create a custom map control is to extend the default MapController class.

Properties

events (Array)

A list of additional event names that this control subscribes to.

Available events: click, dblclick, tap, doubletap, press, pinch, pinchin, pinchout, pinchstart, pinchmove, pinchend, pinchcancel, rotate, rotatestart, rotatemove, rotateend, rotatecancel, pan, panstart, panmove, panup, pandown, panleft, panright, panend, pancancel, swipe, swipeleft, swiperight, swipeup, swipedown, pointerdown, pointermove, pointerup, keydown, and keyup.

The following events are toggled on/off by InteractiveMap props:

  • scrollZoom - ['wheel']
  • dragPan and dragRotate - ['panstart', 'panmove', 'panend']
  • touchZoomRotate - ['pinchstart', 'pinchmove', 'pinchend']
  • doubleClickZoom - ['doubletap']
  • keyboard - ['keydown']

Event object is generated by mjolnir.js. It always has the following properties:

  • type (string) - The event type to which the event handler is subscribed, e.g. 'click' or 'pointermove'
  • center (Object {x, y}) - The center of the event location (e.g. the centroid of a touch) relative to the viewport (basically, clientX/Y)
  • offsetCenter (Object {x, y}) - The center of the event location relative to the map.
  • target (Object) - The target of the event, as specified by the original srcEvent
  • srcEvent (Object) - The original event object dispatched by the browser to the JS runtime

Additionally, event objects for different event types contain a subset of the following properties:

  • key (number) - The keycode of the keyboard event
  • leftButton (boolean) - Flag indicating whether the left button is involved during the event
  • middleButton (boolean) - Flag indicating whether the middle button is involved during the event
  • rightButton (boolean) - Flag indicating whether the right button is involved during the event
  • pointerType (string) - A string indicating the type of input (e.g. 'mouse', 'touch', 'pointer')
  • delta (number) - The scroll magnitude/distance of a wheel event

Methods

handleEvent

handleEvent(event)

Called by the event manager to handle pointer events. This method delegate to the following methods to handle the default events:

  • _onPanStart(event)
  • _onPan(event)
  • _onPanEnd(event)
  • _onPinchStart(event)
  • _onPinch(event)
  • _onPinchEnd(event)
  • _onDoubleTap(event)
  • _onWheel(event)
  • _onKeyDown(event)
getMapState

getMapState(overrides)

Get a new descriptor object of the map state. If specified, props in the overrides object override the current map props.

setOptions

setOptions(options)

Add/remove event listeners based on the latest InteractiveMap props.

updateViewport

updateViewport(newMapState, extraProps, interactionState)

Invoke onViewportChange callback with a new map state.

Source

map-controller.js

\ No newline at end of file +

MapController

Since v4.0

The easiest way to create a custom map control is to extend the default MapController class.

Properties

events (Array)

A list of additional event names that this control subscribes to.

Available events: click, dblclick, tap, doubletap, press, pinch, pinchin, pinchout, pinchstart, pinchmove, pinchend, pinchcancel, rotate, rotatestart, rotatemove, rotateend, rotatecancel, pan, panstart, panmove, panup, pandown, panleft, panright, panend, pancancel, swipe, swipeleft, swiperight, swipeup, swipedown, pointerdown, pointermove, pointerup, keydown, and keyup.

The following events are toggled on/off by InteractiveMap props:

  • scrollZoom - ['wheel']
  • dragPan and dragRotate - ['panstart', 'panmove', 'panend']
  • touchZoomRotate - ['pinchstart', 'pinchmove', 'pinchend']
  • doubleClickZoom - ['doubletap']
  • keyboard - ['keydown']

Event object is generated by mjolnir.js. It always has the following properties:

  • type (string) - The event type to which the event handler is subscribed, e.g. 'click' or 'pointermove'
  • center (Object {x, y}) - The center of the event location (e.g. the centroid of a touch) relative to the viewport (basically, clientX/Y)
  • offsetCenter (Object {x, y}) - The center of the event location relative to the map.
  • target (Object) - The target of the event, as specified by the original srcEvent
  • srcEvent (Object) - The original event object dispatched by the browser to the JS runtime

Additionally, event objects for different event types contain a subset of the following properties:

  • key (number) - The keycode of the keyboard event
  • leftButton (boolean) - Flag indicating whether the left button is involved during the event
  • middleButton (boolean) - Flag indicating whether the middle button is involved during the event
  • rightButton (boolean) - Flag indicating whether the right button is involved during the event
  • pointerType (string) - A string indicating the type of input (e.g. 'mouse', 'touch', 'pointer')
  • delta (number) - The scroll magnitude/distance of a wheel event

Methods

handleEvent

handleEvent(event)

Called by the event manager to handle pointer events. This method delegate to the following methods to handle the default events:

  • _onPanStart(event)
  • _onPan(event)
  • _onPanEnd(event)
  • _onPinchStart(event)
  • _onPinch(event)
  • _onPinchEnd(event)
  • _onDoubleTap(event)
  • _onWheel(event)
  • _onKeyDown(event)
getMapState

getMapState(overrides)

Get a new descriptor object of the map state. If specified, props in the overrides object override the current map props.

setOptions

setOptions(options)

Add/remove event listeners based on the latest InteractiveMap props.

updateViewport

updateViewport(newMapState, extraProps, interactionState)

Invoke onViewportChange callback with a new map state.

Source

map-controller.js

\ No newline at end of file diff --git a/docs/api-reference/marker/index.html b/docs/api-reference/marker/index.html index 4ac8c7d1..94646d26 100644 --- a/docs/api-reference/marker/index.html +++ b/docs/api-reference/marker/index.html @@ -90,7 +90,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

Marker

Since v3.0

This is a React equivalent of Mapbox's +

Marker

Since v3.0

This is a React equivalent of Mapbox's Marker Control, which can be used to render custom icons at specific locations on the map.

import * as React from 'react';
 import ReactMapGL, {Marker} from 'react-map-gl';
@@ -132,4 +132,4 @@ be used to render custom icons at specific locations on the map.

{markers} </ReactMapGL> ); -}

Properties

latitude (Number, required)

Latitude of the marker.

longitude (Number, required)

Longitude of the marker.

offsetLeft (Number)
  • default: 0

Offset of the marker from the left in pixels, negative number indicates left.

offsetTop (Number)
  • default: 0

Offset of the marker from the top in pixels, negative number indicates up.

draggable (Boolean)
  • default: false

Allows this marker component to be dragged around the map. (Use onDragEnd to capture the final position and update longitude and latitude).

onDragStart (Function)

Called when a draggable marker starts being dragged.

Parameters:

  • event - The pointer event.
    • event.lngLat - The geo coordinates where the drag started, as [lng, lat].
onDrag (Function)

Continuously called while a draggable marker is being dragged.

Parameters:

  • event - The pointer event.
    • event.lngLat - The geo coordinates of the drag event, as [lng, lat].
onDragEnd (Function)

Called when a draggable marker is released at its final position. This is usually a good time to capture event.lngLat and update the marker's longitude and latitude props.

Parameters:

  • event - The pointer event.
    • event.lngLat - The geo coordinates where the drag ended, as [lng, lat].
className (String)

Assign a custom class name to the container of this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

marker.js

\ No newline at end of file +}

Properties

latitude (Number, required)

Latitude of the marker.

longitude (Number, required)

Longitude of the marker.

offsetLeft (Number)
  • default: 0

Offset of the marker from the left in pixels, negative number indicates left.

offsetTop (Number)
  • default: 0

Offset of the marker from the top in pixels, negative number indicates up.

draggable (Boolean)
  • default: false

Allows this marker component to be dragged around the map. (Use onDragEnd to capture the final position and update longitude and latitude).

onDragStart (Function)

Called when a draggable marker starts being dragged.

Parameters:

  • event - The pointer event.
    • event.lngLat - The geo coordinates where the drag started, as [lng, lat].
onDrag (Function)

Continuously called while a draggable marker is being dragged.

Parameters:

  • event - The pointer event.
    • event.lngLat - The geo coordinates of the drag event, as [lng, lat].
onDragEnd (Function)

Called when a draggable marker is released at its final position. This is usually a good time to capture event.lngLat and update the marker's longitude and latitude props.

Parameters:

  • event - The pointer event.
    • event.lngLat - The geo coordinates where the drag ended, as [lng, lat].
className (String)

Assign a custom class name to the container of this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

marker.js

\ No newline at end of file diff --git a/docs/api-reference/navigation-control/index.html b/docs/api-reference/navigation-control/index.html index bc90ccda..356f77c6 100644 --- a/docs/api-reference/navigation-control/index.html +++ b/docs/api-reference/navigation-control/index.html @@ -92,7 +92,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

NavigationControl

Since v3.0

This is a React equivalent of Mapbox's NavigationControl, +

NavigationControl

Since v3.0

This is a React equivalent of Mapbox's NavigationControl, which provides zoom buttons and a compass button.

import * as React from 'react';
 import ReactMapGL, {NavigationControl} from 'react-map-gl';
 
@@ -112,4 +112,4 @@ which provides zoom buttons and a compass button.

<NavigationControl style={navControlStyle} /> </ReactMapGL> ); -}

Properties

onViewportChange (Function)

Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing InteractiveMap's onViewportChange.

showCompass (Boolean)
  • default: true

Show or hide the compass button

showZoom (Boolean)
  • default: true

Show or hide the zoom buttons

zoomInLabel (String)
  • default: Zoom In

Label applied to the zoom in control button.

zoomOutLabel (String)
  • default: Zoom Out

Label applied to the zoom out control button.

compassLabel (String)
  • default: Reset North

Label applied to the compass control button.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

navigation-control.js

\ No newline at end of file +}

Properties

onViewportChange (Function)

Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing InteractiveMap's onViewportChange.

showCompass (Boolean)
  • default: true

Show or hide the compass button

showZoom (Boolean)
  • default: true

Show or hide the zoom buttons

zoomInLabel (String)
  • default: Zoom In

Label applied to the zoom in control button.

zoomOutLabel (String)
  • default: Zoom Out

Label applied to the zoom out control button.

compassLabel (String)
  • default: Reset North

Label applied to the compass control button.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

navigation-control.js

\ No newline at end of file diff --git a/docs/api-reference/pointer-event/index.html b/docs/api-reference/pointer-event/index.html index d27cf82e..2437f79f 100644 --- a/docs/api-reference/pointer-event/index.html +++ b/docs/api-reference/pointer-event/index.html @@ -84,4 +84,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

PointerEvent

Event object passed to some of InteractiveMap's callback props.

Members

type (String)

The name of the event.

point (Array)

The screen coordinates that is being clicked.

lngLat (Array)

The geo coordinates that is being clicked.

target (Element)

The target element of the pointer event.

srcEvent (Object)

The original browser event.

\ No newline at end of file +

PointerEvent

Event object passed to some of InteractiveMap's callback props.

Members

type (String)

The name of the event.

point (Array)

The screen coordinates that is being clicked.

lngLat (Array)

The geo coordinates that is being clicked.

target (Element)

The target element of the pointer event.

srcEvent (Object)

The original browser event.

\ No newline at end of file diff --git a/docs/api-reference/popup/index.html b/docs/api-reference/popup/index.html index ad99b0aa..8efeeb13 100644 --- a/docs/api-reference/popup/index.html +++ b/docs/api-reference/popup/index.html @@ -90,7 +90,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

Popup

Since v3.0

This is a React equivalent of Mapbox's Popup Control, which can be used to +

Popup

Since v3.0

This is a React equivalent of Mapbox's Popup Control, which can be used to show tooltip popups with custom HTML content at specific locations on the map.

import * as React from 'react';
 import ReactMapGL, {Popup} from 'react-map-gl';
 
@@ -116,4 +116,4 @@ show tooltip popups with custom HTML content at specific locations on the map.</ReactMapGL>
   );
 }

Properties

latitude (Number, required)

Latitude of the anchor.

longitude (Number, required)

Longitude of the anchor.

altitude (Number)
  • default: 0

Altitude of the anchor.

offsetLeft (Number)
  • default: 0

Offset of the anchor from the left in pixels, negative number indicates left.

offsetTop (Number)
  • default: 0

Offset of the anchor from the top in pixels, negative number indicates up.

closeButton (Boolean)
  • default: true

If true, a close button will appear in the top right corner of the popup.

closeOnClick (Boolean)
  • default: true

If true, the popup will be closed when the map is clicked.

tipSize (Number)
  • default: 10

Size of the tip pointing to the coordinate.

anchor (String)
  • default: bottom

A string indicating the popup's position relative to the coordinate. -Options are top, bottom, left, right, top-left, top-right, bottom-left, and bottom-right.

dynamicPosition (Boolean)
  • default: true

If true, the anchor will be dynamically adjusted to ensure the popup falls within the map container.

sortByDepth (Boolean)
  • default: false

If true, the order of the popups will be dynamically rearranged to ensure that the ones anchored closer to the camera are rendered on top. Useful when showing multiple popups in a tilted map.

onClose (Function)

Callback when the user closes the popup.

className (String)

Assign a custom class name to the container of this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

popup.js

\ No newline at end of file +Options are top, bottom, left, right, top-left, top-right, bottom-left, and bottom-right.

dynamicPosition (Boolean)
  • default: true

If true, the anchor will be dynamically adjusted to ensure the popup falls within the map container.

sortByDepth (Boolean)
  • default: false

If true, the order of the popups will be dynamically rearranged to ensure that the ones anchored closer to the camera are rendered on top. Useful when showing multiple popups in a tilted map.

onClose (Function)

Callback when the user closes the popup.

className (String)

Assign a custom class name to the container of this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

popup.js

\ No newline at end of file diff --git a/docs/api-reference/scale-control/index.html b/docs/api-reference/scale-control/index.html index 310b982d..3f7c2a79 100644 --- a/docs/api-reference/scale-control/index.html +++ b/docs/api-reference/scale-control/index.html @@ -90,7 +90,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

ScaleControl

Since v5.2

This is a React equivalent of Mapbox's ScaleControl.

import * as React from 'react';
+  

ScaleControl

Since v5.2

This is a React equivalent of Mapbox's ScaleControl.

import * as React from 'react';
 import ReactMapGL, {ScaleControl} from 'react-map-gl';
 
 const scaleControlStyle= {
@@ -109,4 +109,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
       <ScaleControl maxWidth={100} unit="metric" style={scaleControlStyle} />
     </ReactMapGL>
   );
-}

Properties

maxWidth (Number)
  • default: 100

The maximum length of the scale control in pixels.

unit (String)
  • default: 'metric'

Unit of the distance, one of 'imperial', 'metric' or 'nautical'.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

scale-control.js

\ No newline at end of file +}

Properties

maxWidth (Number)
  • default: 100

The maximum length of the scale control in pixels.

unit (String)
  • default: 'metric'

Unit of the distance, one of 'imperial', 'metric' or 'nautical'.

className (String)

Assign a custom class name to the container of this control.

style (Object)
  • default: {position: 'absolute'}

A React style object applied to this control.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: true

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: true

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: true

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Styling

Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.

Source

scale-control.js

\ No newline at end of file diff --git a/docs/api-reference/source/index.html b/docs/api-reference/source/index.html index aba22fbc..81b5a521 100644 --- a/docs/api-reference/source/index.html +++ b/docs/api-reference/source/index.html @@ -88,7 +88,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

Source

Since v5.1

This component allows apps to create a map source using React. It may contain Layer components as children.

import * as React from 'react';
+  

Source

Since v5.1

This component allows apps to create a map source using React. It may contain Layer components as children.

import * as React from 'react';
 import ReactMapGL, {Source, Layer} from 'react-map-gl';
 
 const geojson = {
@@ -126,4 +126,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
   layers: []
 };
 
-<ReactMapGL ... mapStyle={EMPTY_STYLE}>

When props change shallowly, the component will attempt to update the source. Do not define objects/arrays inline to avoid perf hit.

Once a <Source> is mounted, the following props should not change. If add/remove multiple JSX sources dynamically, make sure you use React's key prop to give each element a stable identity.

id (String)

Unique identifier of the source. If not provided, a default id will be assigned.

type (String, required)

Type of the source.

Source

source.js

\ No newline at end of file +<ReactMapGL ... mapStyle={EMPTY_STYLE}>

When props change shallowly, the component will attempt to update the source. Do not define objects/arrays inline to avoid perf hit.

Once a <Source> is mounted, the following props should not change. If add/remove multiple JSX sources dynamically, make sure you use React's key prop to give each element a stable identity.

id (String)

Unique identifier of the source. If not provided, a default id will be assigned.

type (String, required)

Type of the source.

Source

source.js

\ No newline at end of file diff --git a/docs/api-reference/static-map/index.html b/docs/api-reference/static-map/index.html index afb75c42..f96a7fc9 100644 --- a/docs/api-reference/static-map/index.html +++ b/docs/api-reference/static-map/index.html @@ -96,7 +96,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

StaticMap

Since v3.0

The simplest React wrapper around MapboxGL. This is designed to be completely +

StaticMap

Since v3.0

The simplest React wrapper around MapboxGL. This is designed to be completely static, and should be used to render a map with no interactivity. For a component that supports full user interactivity, see InteractiveMap.

import * as React from 'react';
 import {StaticMap} from 'react-map-gl';
@@ -116,4 +116,4 @@ will take precedence over those same options if set via props.

There are known issues with style diffing. As stopgap, use this option to prevent style diffing.

reuseMaps (Boolean)
  • default: false

This prop is experimental.

If true, when the map component is unmounted, instead of calling remove on the Mapbox map instance, save it for later reuse. This will avoid repeatedly creating new Mapbox map instances if possible.

Applications that frequently mount and unmount maps may try this prop to help work around a mapbox-gl resource leak issue that can lead to a browser crash in certain situations.

transformRequest (Function)
  • default: null

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 url property and optionally headers and credentials properties. Equivalent to Mapbox's transformRequest map option.

Map State

mapStyle (String | Object | Immutable.Map)
  • default: 'mapbox://styles/mapbox/light-v8'

The Mapbox style. A string url or a MapboxGL style -object (regular JS object or Immutable.Map).

Whenever the mapStyle prop changes, the component will attempt to update the style of the underlying Mapbox map. The behavior can be further customized with the preventStyleDiffing prop.

mapStyle is ignored when explicitly set to null.

width (Number | String, required)

The width of the map. Can be either a number in pixels, or a valid CSS string.

height (Number | String, required)

The height of the map. Can be either a number in pixels, or a valid CSS string.

latitude (Number)

The latitude of the center of the map, as a top level prop. Only used if viewState is not supplied.

longitude (Number)

The longitude of the center of the map, as a top level prop. Only used if viewState is not supplied.

zoom (Number)

The tile zoom level of the map, as a top level prop. Only used if viewState is not supplied.

Bounded implicitly by default minZoom and maxZoom of MapboxGL

bearing (Number)
  • default: 0

Specify the bearing of the viewport, as a top level prop. Only used if viewState is not supplied.

pitch (Number)
  • default: 0

Specify the pitch of the viewport, as a top level prop. Only used if viewState is not supplied..

altitude (Number)
  • default: 1.5

Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137.

Altitude of the viewport camera, relative to screen height.

viewState (Object)

An object containing the view state of the map specified by the following fields:

  • latitude (Number) - The latitude of the center of the map.
  • longitude (Number) - The longitude of the center of the map.
  • zoom (Number) - The tile zoom level of the map. Bounded implicitly by default minZoom and maxZoom of MapboxGL.
  • bearing (Number) - default: 0 - The bearing of the viewport.
  • pitch (Number) - default: 0 - The pitch of the viewport.
  • altitude (Number) - default: 1.5 screen heights

Note: Either the viewState, or the latitude, longitude and zoom properties need to be specified.

Render Options

asyncRender (Boolean)
  • default: false

If true, let Mapbox manage its own render cycle. This is the behavior prior to v4.1.

If false, force Mapbox canvas to redraw with DOM updates. This will make the map synchronize better with other controls during prop-driven viewport changes.

style (Object)

The CSS style of the map container.

visible (Boolean)
  • default: true

Whether the map is visible. Unmounting and re-mounting a Mapbox instance is known to be costly. This option offers a way to hide a map using CSS style.

visibilityConstraints (Object)

An object that specifies bounds for viewport props with min*, max* keys. If the viewport props are outside of these constraints, the Mapbox map is automatically hidden.

Default: { minZoom: 0, maxZoom: 20, minPitch: 0, maxPitch: 60 }

Callbacks

onLoad (Function)
  • default: () => {}

A callback run when the map emits a load event. Mapbox docs

onResize (Function)
  • default: () => {}

A callback run when the map size has changed.

onError (Function)
  • default: console.error

A callback run when the map emits an error event. Mapbox docs

Methods

getMap

Returns the Mapbox instance if initialized. The Map instance will have full access to MapboxGL's API.

getMap()

queryRenderedFeatures

Use Mapbox's queryRenderedFeatures API to find features at point or in a bounding box. If the parameters argument is not specified, only queries the layers with the interactive property in the layer style.

queryRenderedFeatures(geometry, parameters)

  • geometry {[Number, Number | [[Number, Number, [Number, Number - Point or an array of two points defining the bounding box. Coordinates in pixels.
  • parameters - Query options. For more details, see Mapbox API documentation.

Source

static-map.js

\ No newline at end of file +object (regular JS object or Immutable.Map).

Whenever the mapStyle prop changes, the component will attempt to update the style of the underlying Mapbox map. The behavior can be further customized with the preventStyleDiffing prop.

mapStyle is ignored when explicitly set to null.

width (Number | String, required)

The width of the map. Can be either a number in pixels, or a valid CSS string.

height (Number | String, required)

The height of the map. Can be either a number in pixels, or a valid CSS string.

latitude (Number)

The latitude of the center of the map, as a top level prop. Only used if viewState is not supplied.

longitude (Number)

The longitude of the center of the map, as a top level prop. Only used if viewState is not supplied.

zoom (Number)

The tile zoom level of the map, as a top level prop. Only used if viewState is not supplied.

Bounded implicitly by default minZoom and maxZoom of MapboxGL

bearing (Number)
  • default: 0

Specify the bearing of the viewport, as a top level prop. Only used if viewState is not supplied.

pitch (Number)
  • default: 0

Specify the pitch of the viewport, as a top level prop. Only used if viewState is not supplied..

altitude (Number)
  • default: 1.5

Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137.

Altitude of the viewport camera, relative to screen height.

viewState (Object)

An object containing the view state of the map specified by the following fields:

  • latitude (Number) - The latitude of the center of the map.
  • longitude (Number) - The longitude of the center of the map.
  • zoom (Number) - The tile zoom level of the map. Bounded implicitly by default minZoom and maxZoom of MapboxGL.
  • bearing (Number) - default: 0 - The bearing of the viewport.
  • pitch (Number) - default: 0 - The pitch of the viewport.
  • altitude (Number) - default: 1.5 screen heights

Note: Either the viewState, or the latitude, longitude and zoom properties need to be specified.

Render Options

asyncRender (Boolean)
  • default: false

If true, let Mapbox manage its own render cycle. This is the behavior prior to v4.1.

If false, force Mapbox canvas to redraw with DOM updates. This will make the map synchronize better with other controls during prop-driven viewport changes.

style (Object)

The CSS style of the map container.

visible (Boolean)
  • default: true

Whether the map is visible. Unmounting and re-mounting a Mapbox instance is known to be costly. This option offers a way to hide a map using CSS style.

visibilityConstraints (Object)

An object that specifies bounds for viewport props with min*, max* keys. If the viewport props are outside of these constraints, the Mapbox map is automatically hidden.

Default: { minZoom: 0, maxZoom: 20, minPitch: 0, maxPitch: 60 }

Callbacks

onLoad (Function)
  • default: () => {}

A callback run when the map emits a load event. Mapbox docs

onResize (Function)
  • default: () => {}

A callback run when the map size has changed.

onError (Function)
  • default: console.error

A callback run when the map emits an error event. Mapbox docs

Methods

getMap

Returns the Mapbox instance if initialized. The Map instance will have full access to MapboxGL's API.

getMap()

queryRenderedFeatures

Use Mapbox's queryRenderedFeatures API to find features at point or in a bounding box. If the parameters argument is not specified, only queries the layers with the interactive property in the layer style.

queryRenderedFeatures(geometry, parameters)

  • geometry {[Number, Number | [[Number, Number, [Number, Number - Point or an array of two points defining the bounding box. Coordinates in pixels.
  • parameters - Query options. For more details, see Mapbox API documentation.

Source

static-map.js

\ No newline at end of file diff --git a/docs/api-reference/svg-overlay/index.html b/docs/api-reference/svg-overlay/index.html index b8b513a6..76be7607 100644 --- a/docs/api-reference/svg-overlay/index.html +++ b/docs/api-reference/svg-overlay/index.html @@ -88,4 +88,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

SVGOverlay

Allows applications to overlay data on top of maps using a SVG container.

Properties

redraw (Function)

Called every time the map updates.

Parameters:

  • width (Number) - width of the viewport
  • height (Number) - height of the viewport
  • project (Function) - get screen position [x, y] from geo coordinates [lng, lat]
  • unproject (Function) - get geo coordinates [lng, lat] from screen position [x, y]

style (Object)

Additional css styles of the svg container.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: false

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: false

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: false

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Source

svg-overlay.js

\ No newline at end of file +

SVGOverlay

Allows applications to overlay data on top of maps using a SVG container.

Properties

redraw (Function)

Called every time the map updates.

Parameters:

  • width (Number) - width of the viewport
  • height (Number) - height of the viewport
  • project (Function) - get screen position [x, y] from geo coordinates [lng, lat]
  • unproject (Function) - get geo coordinates [lng, lat] from screen position [x, y]

style (Object)

Additional css styles of the svg container.

captureScroll (Boolean)
  • default: false

Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.

captureDrag (Boolean)
  • default: false

Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.

captureClick (Boolean)
  • default: false

Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked.

captureDoubleClick (Boolean)
  • default: false

Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.

capturePointerMove (Boolean)
  • default: false

Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.

Source

svg-overlay.js

\ No newline at end of file diff --git a/docs/api-reference/web-mercator-viewport/index.html b/docs/api-reference/web-mercator-viewport/index.html index c976a711..0bea0d63 100644 --- a/docs/api-reference/web-mercator-viewport/index.html +++ b/docs/api-reference/web-mercator-viewport/index.html @@ -94,7 +94,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

WebMercatorViewport

+

WebMercatorViewport

From-v3.1

The WebMercatorViewport class takes map camera states (latitude, longitude, zoom, pitch, bearing etc.), and performs projections between world and screen coordinates.

Constructor

ParameterTypeDefaultDescription
widthnumber1Width of viewport
heightnumber1Height of viewport
latitudenumber0Latitude of viewport center
longitudenumber0Longitude of viewport center
zoomnumber11Map zoom (scale is calculated as 2^zoom)
pitchnumber0The pitch (tilt) of the map from the screen, in degrees (0 is straight down)
bearingnumber0The bearing (rotation) of the map from north, in degrees counter-clockwise (0 means north is up)
fovynumbersee belowField of view of camera in degrees
altitudenumbersee belowAltitude of camera in screen units
positionnumber[]nullOffset of the camera, in meters

Remarks:

  • If either altitude or fovy is not provided, the missing value is computed from the other using altitudeToFovy()/fovyToAltitude().
  • Altitude has a default value that matches assumptions in mapbox-gl. It is only used if both altitude and fovy are not supplied.
  • Field of view is independent from altitude, provide altitudeToFovy(1.5) (default value) to match assumptions in mapbox-gl
  • width and height are forced to 1 if supplied as 0, to avoid @@ -104,4 +104,4 @@ latitudes are specified as degrees.

unproject(xyz, options)

Unproject pixel coordinates on screen to longitude and latitude on map.

ParameterTypeDefaultDescription
xyzArray(required)pixel coordinates, [x, y] or [x, y, z] where z is pixel depth
optionsObject{}named options
options.topLeftBooleantrueIf true projected coords are top left, otherwise bottom left
options.targetZnumber0If pixel depth z is not specified in xyz, use options.targetZ as the desired elevation

Returns: [lng, lat] or [longitude, lat, Z] in map coordinates. Z is elevation in meters.

  • If input is [x, y] without specifying options.targetZ: returns [lng, lat].
  • If input is [x, y] with options.targetZ: returns [lng, lat, targetZ].
  • If input is [x, y, z]: returns [lng, lat, Z].
projectFlat(lngLat, scale)

Project longitude and latitude onto Web Mercator coordinates.

ParameterTypeDefaultDescription
lngLatArray(required)map coordinates, [lng, lat]
scalenumberthis.scaleWeb Mercator scale

Returns:

  • [x, y], representing Web Mercator coordinates.
unprojectFlat(xy, scale)

Unprojects a Web Mercator coordinate to longitude and latitude.

ParameterTypeDefaultDescription
xyArray(required)Web Mercator coordinates, [x, y]
scalenumberthis.scaleWeb Mercator scale

Returns:

  • [longitude, latitude]
getBounds(options)

Get the axis-aligned bounding box of the current visible area.

  • options.z (number, optional) - To calculate a bounding volume for fetching 3D data, this option can be used to get the bounding box at a specific elevation. Default 0.

Returns:

  • [[lon, lat], [lon, lat]] as the south west and north east corners of the smallest orthogonal bounds that encompasses the visible region.
getBoundingRegion(options)

Get the vertices of the current visible region.

  • options.z (number, optional) - To calculate a bounding volume for fetching 3D data, this option can be used to get the bounding region at a specific elevation. Default 0.

Returns:

  • An array of 4 corners in [longitude, latitude, altitude] that define the visible region.
fitBounds(bounds, options: object)

Get a new flat viewport that fits around the given bounding box.

  • bounds ([[number,number],[number,number]]) - an array of two opposite corners of the bounding box. Each corner is specified in [lon, lat].
  • options.padding (number|{top:number, bottom: number, left: number, right: number}, optional) - The amount of padding in pixels to add to the given bounds from the edge of the viewport. If padding is set as object, all parameters are -required.
  • options.offset ([number,number], optional) - The center of the given bounds relative to the viewport's center, [x, y] measured in pixels.
  • opts.minExtent (number, optional) - If supplied, the bounds used to calculate the new map settings will be expanded if the delta width or height of the supplied bounds is smaller than this value.
  • opts.maxZoom=24 (number, optional) - The returned zoom value will be capped to this value. Avoids returning infinite zoom when the supplied bounds have zero width or height deltas.

Returns:

  • A new WebMercatorViewport instance
getMapCenterByLngLatPosition(options: object): [number, number]

Get the map center that place a given [lng, lat] coordinate at screen point [x, y].

Parameters:

  • options.lngLat (Array, required) - [lng,lat] coordinates of a location on the sphere.
  • options.pos (Array, required) - [x,y] coordinates of a pixel on screen.

Returns:

  • [longitude, latitude] as the new map center
\ No newline at end of file +required.
  • options.offset ([number,number], optional) - The center of the given bounds relative to the viewport's center, [x, y] measured in pixels.
  • opts.minExtent (number, optional) - If supplied, the bounds used to calculate the new map settings will be expanded if the delta width or height of the supplied bounds is smaller than this value.
  • opts.maxZoom=24 (number, optional) - The returned zoom value will be capped to this value. Avoids returning infinite zoom when the supplied bounds have zero width or height deltas.
  • Returns:

    • A new WebMercatorViewport instance
    getMapCenterByLngLatPosition(options: object): [number, number]

    Get the map center that place a given [lng, lat] coordinate at screen point [x, y].

    Parameters:

    • options.lngLat (Array, required) - [lng,lat] coordinates of a location on the sphere.
    • options.pos (Array, required) - [x,y] coordinates of a pixel on screen.

    Returns:

    • [longitude, latitude] as the new map center
    \ No newline at end of file diff --git a/docs/contributing/index.html b/docs/contributing/index.html index a9235625..80ac7a0e 100644 --- a/docs/contributing/index.html +++ b/docs/contributing/index.html @@ -88,8 +88,8 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    Contributing to react-map-gl

    Thanks for taking the time to contribute!

    PRs and bug reports are welcome, and we are actively looking for new maintainers.

    Setting Up Dev Environment

    The master branch is the active development branch.

    Building react-map-gl locally from the source requires node.js >=8. +

    Contributing to react-map-gl

    Thanks for taking the time to contribute!

    PRs and bug reports are welcome, and we are actively looking for new maintainers.

    Setting Up Dev Environment

    The master branch is the active development branch.

    Building react-map-gl locally from the source requires node.js >=8. We use yarn to manage the dependencies.

    git checkout master
     yarn bootstrap
     yarn test

    Test:

    $ npm run test

    Test in Node:

    $ npm run test node

    Test in browser (can use Chrome dev tools for debugging):

    $ npm run test browser

    Pull Requests

    Any intended change to the code base must open a pull request and be approved.

    Generally speaking, all PRs are open against the master branch, unless the feature being affected no longer exists on master.

    PR Checklist

    • Tests
      • npm run test must be successful.
      • New code should be covered by unit tests whenever possible.
    • Documentation
      • If public APIs are added/modified, update component documentation in docs/api-reference.
      • Breaking changes and deprecations must be added to docs/upgrade-guide.md.
      • Noteworthy new features should be added to docs/whats-new.md.
    • Description on GitHub
      • Link to relevant issue.
      • Label with a milestone (latest release or vNext).
      • If public APIs are added/modified, describe the intended behavior.
      • If visual/interaction is affected, consider attaching a screenshot/GIF.

    Release

    react-map-gl follows the Semantic Versioning guidelines. Steps for publishing releases can be found here.

    Community Governance

    vis.gl is part of the Urban Computing Foundation. See the organization's Technical Charter.

    Technical Steering Committee

    react-map-gl development is governed by the vis.gl Technical Steering Committee (TSC).

    Maintainers

    Maintainers of react-map-gl have commit access to this GitHub repository, and take part in the decision making process.

    If you are interested in becoming a maintainer, read the governance guidelines.

    The vis.gl TSC meets monthly and publishes meeting notes via a mailing list. -This mailing list can also be utilized to reach out to the TSC.

    Code of Conduct

    Please be mindful of and adhere to the Linux Foundation's Code of Conduct when contributing to react-map-gl.

    \ No newline at end of file +This mailing list can also be utilized to reach out to the TSC.

    Code of Conduct

    Please be mindful of and adhere to the Linux Foundation's Code of Conduct when contributing to react-map-gl.

    \ No newline at end of file diff --git a/docs/get-started/adding-custom-data/index.html b/docs/get-started/adding-custom-data/index.html index ab467589..ec0107f7 100644 --- a/docs/get-started/adding-custom-data/index.html +++ b/docs/get-started/adding-custom-data/index.html @@ -90,7 +90,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    Adding Custom Data

    Native Mapbox Layers

    You can inject data and mapbox native layers using the Source and Layer components:

    import * as React from 'react';
    +  

    Adding Custom Data

    Native Mapbox Layers

    You can inject data and mapbox native layers using the Source and Layer components:

    import * as React from 'react';
     import ReactMapGL, {Source, Layer} from 'react-map-gl';
     
     const geojson = {
    @@ -132,4 +132,4 @@ They are great for creating light-weight custom drawings.

    <MapGL {...viewport}> <SVGOverlay redraw={redraw} /> -</MapGL>

    Built-in Overlays

    Example Overlays

    There are a couple of additional overlays in the examples folder that can be copied into applications ScatterplotOverlay, ChoroplethOverlay.

    Third-party overlays are also available. For example, the heatmap-overlay module uses webgl-heatmap to create geographic heatmaps.

    Other vis.gl Libraries

    For more feature rich and performant data visualization overlay use cases, you may consider using other visualization libraries. react-map-gl is part of the vis.gl ecosystem, a suite of high-performance data visualization tools for the Web.

    • deck.gl - WebGL-powered framework for the visualization of large datasets.
    • loaders.gl - loaders for file formats focused on visualization of big data, including point clouds, 3D geometries, images, geospatial formats as well as tabular data.
    • nebula.gl - 3D-enabled GeoJSON editing based on deck.gl and React.
    \ No newline at end of file +</MapGL>

    Built-in Overlays

    Example Overlays

    There are a couple of additional overlays in the examples folder that can be copied into applications ScatterplotOverlay, ChoroplethOverlay.

    Third-party overlays are also available. For example, the heatmap-overlay module uses webgl-heatmap to create geographic heatmaps.

    Other vis.gl Libraries

    For more feature rich and performant data visualization overlay use cases, you may consider using other visualization libraries. react-map-gl is part of the vis.gl ecosystem, a suite of high-performance data visualization tools for the Web.

    • deck.gl - WebGL-powered framework for the visualization of large datasets.
    • loaders.gl - loaders for file formats focused on visualization of big data, including point clouds, 3D geometries, images, geospatial formats as well as tabular data.
    • nebula.gl - 3D-enabled GeoJSON editing based on deck.gl and React.
    \ No newline at end of file diff --git a/docs/get-started/faq/index.html b/docs/get-started/faq/index.html index eca6a178..88a98eea 100644 --- a/docs/get-started/faq/index.html +++ b/docs/get-started/faq/index.html @@ -86,7 +86,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    FAQ

    Enable Right-to-Left Language Support

    Since v5.2.2

    import {setRTLTextPlugin} from 'react-map-gl';
    +  

    FAQ

    Enable Right-to-Left Language Support

    Since v5.2.2

    import {setRTLTextPlugin} from 'react-map-gl';
     
     setRTLTextPlugin(
       // find out the latest version at https://www.npmjs.com/package/@mapbox/mapbox-gl-rtl-text
    @@ -109,4 +109,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
         pitch: 0,
         bearing: 0,
         ...
    - */

    Documentation of WebMercatorViewport

    I called flyTo/panTo and all controls went out of sync

    You cannot manipulate the map camera via getMap() and the native mapbox-gl API. To conform to the reactive programming paradigm, all camera changes should be driven by prop changes on the React component. Circumventing this will break the binding between React components and the underlying map instance.

    Instead, use the InteractiveMap's transition props. See viewport transition for examples.

    mapbox-gl-draw does not work with react-map-gl

    Unfortunately, react-map-gl implements its own interative logic and disables the native event handling of mapbox-gl.

    Short explanation: mapbox-gl is not designed to support React.

    Long explanation: When using react-map-gl, we have two asynchronous rendering loops, React and Mapbox. Mapbox's move events are only fired after the camera changes and there is no way to control how and when the map rerenders. If we update React states upon the move events, all React controls/overlays may only get updated one animation frame after the map rerender. You can find discussions here and here.

    Because of this, any mapbox-gl control that listens to the native map events will not work. An equivelant to mapbox-gl-draw is react-map-gl-draw. You can find an example here.

    \ No newline at end of file + */

    Documentation of WebMercatorViewport

    I called flyTo/panTo and all controls went out of sync

    You cannot manipulate the map camera via getMap() and the native mapbox-gl API. To conform to the reactive programming paradigm, all camera changes should be driven by prop changes on the React component. Circumventing this will break the binding between React components and the underlying map instance.

    Instead, use the InteractiveMap's transition props. See viewport transition for examples.

    mapbox-gl-draw does not work with react-map-gl

    Unfortunately, react-map-gl implements its own interative logic and disables the native event handling of mapbox-gl.

    Short explanation: mapbox-gl is not designed to support React.

    Long explanation: When using react-map-gl, we have two asynchronous rendering loops, React and Mapbox. Mapbox's move events are only fired after the camera changes and there is no way to control how and when the map rerenders. If we update React states upon the move events, all React controls/overlays may only get updated one animation frame after the map rerender. You can find discussions here and here.

    Because of this, any mapbox-gl control that listens to the native map events will not work. An equivelant to mapbox-gl-draw is react-map-gl-draw. You can find an example here.

    \ No newline at end of file diff --git a/docs/get-started/get-started/index.html b/docs/get-started/get-started/index.html index 9c714c6c..04cd63dc 100644 --- a/docs/get-started/get-started/index.html +++ b/docs/get-started/get-started/index.html @@ -86,7 +86,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    Get Started

    Installation

    Using react-map-gl requires node >= v4 and react >= 16.3.

    npm install --save react-map-gl

    Example

    import * as React from 'react';
    +  

    Get Started

    Installation

    Using react-map-gl requires node >= v4 and react >= 16.3.

    npm install --save react-map-gl

    Example

    import * as React from 'react';
     import { useState } from 'react';
     import ReactMapGL from 'react-map-gl';
     
    @@ -128,4 +128,14 @@ module.exports ]
         })
       ]
    -};
    \ No newline at end of file +};

    In Next.js:

    // next.config.js
    +const nextConfig = {
    +  // ...
    +  webpack: (config) => {
    +    config.resolve.alias = {
    +      ...config.resolve.alias,
    +      'mapbox-gl': 'maplibre-gl',
    +    };
    +  // ...
    +  }
    +};
    \ No newline at end of file diff --git a/docs/get-started/mapbox-tokens/index.html b/docs/get-started/mapbox-tokens/index.html index 3cc6cacc..c4efb8d5 100644 --- a/docs/get-started/mapbox-tokens/index.html +++ b/docs/get-started/mapbox-tokens/index.html @@ -88,7 +88,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    About Mapbox Tokens

    react-map-gl itself is open source and free. It provides a React wrapper for mapbox-gl or derived projects. +

    About Mapbox Tokens

    react-map-gl itself is open source and free. It provides a React wrapper for mapbox-gl or derived projects. Depending on which Mapbox GL JS version (or fork) you use, you may need a Mapbox token. You will need a Mapbox token if you use:

    • react-map-gl@>=6.0.0, depending on mapbox-gl@>=2.0.0 and above - requires a mapbox access token in order to access the map renderer, and generates billable events regardlesss of whether you are displaying your own maps.
    • react-map-gl@5.x, depending on mapbox-gl@1.x - requires an access token only if you load the map styles and tiles from Mapbox's data service. See "Display Maps Without A Mapbox Token" section below for using non-Mapbox tiles.

    To get a Mapbox token, you will need to register on their website. The token will be used to identify you and start serving up map tiles. The service is free until a certain level of traffic is exceeded.

    There are several ways to provide a token to your app, as showcased in some of the example folders:

    • Provide a mapboxApiAccessToken prop to the map component
    • Set the MapboxAccessToken environment variable (or set REACT_APP_MAPBOX_ACCESS_TOKEN if you are using Create React App)
    • Provide it in the URL, e.g ?access_token=TOKEN
    • Provide mapboxApiUrl prop to the map component to override the default mapbox API URL

    But we would recommend using something like dotenv and put your key in an untracked .env file, that will then expose it as a process.env variable, with much less leaking risks.

    Display Maps Without A Mapbox Token

    It is possible to use the map component without the Mapbox service, if you use another tile source (for example, if you host your own map tiles). Note that this is no longer allowed using mapbox-gl v2.0 and above. The options are:

    • Stay on react-map-gl@5.x and mapbox-gl@1.x. react-map-gl plans to continue supporting this release in the foreseeable future, however, this version will not include any of the latest features of the map renderer, nor get any future updates from Mapbox.
    • Use a community fork of mapbox-gl, for example maplibre-gl. See using with a mapbox-gl fork for how to configure your project.

    To use your own map service, you will need a custom Mapbox GL style that points to your own vector tile source, and pass it to ReactMapGL using the mapStyle prop. This custom style must match the schema of your tile source.

    Open source tile schemas include:

    Some useful resources for creating your own map service:

    If you are using a third party service that requires header based authentication, you can do this by defining a function to pass to ReactMapGL using the transformRequest prop.

    An example function:

    const transformRequest = (url, resourceType) => {
             if (resourceType === 'Tile' && url.match('yourTileSource.com')) {
                 return {
    @@ -96,4 +96,4 @@ Depending on which Mapbox GL JS version (or fork) you use, you may need a Mapbox
                     headers: { 'Authorization': 'Bearer ' + yourAuthToken }
                 }
             }
    -    }
    \ No newline at end of file + }
    \ No newline at end of file diff --git a/docs/get-started/state-management/index.html b/docs/get-started/state-management/index.html index 855a6e60..62084724 100644 --- a/docs/get-started/state-management/index.html +++ b/docs/get-started/state-management/index.html @@ -82,7 +82,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    State Management

    InteractiveMap is designed to be a stateless component. Its appearance is entirely controlled by the properties that are passed in from its parent. In this architecture, transition works the same way as interaction: the component shall notify the application of "user intent" by calling the onViewportChange callback, but ultimately the application needs to decide what to do with it.

    The most simple handling of this intent is to save it and pass it back to the component:

    <ReactMapGL
    +  

    State Management

    InteractiveMap is designed to be a stateless component. Its appearance is entirely controlled by the properties that are passed in from its parent. In this architecture, transition works the same way as interaction: the component shall notify the application of "user intent" by calling the onViewportChange callback, but ultimately the application needs to decide what to do with it.

    The most simple handling of this intent is to save it and pass it back to the component:

    <ReactMapGL
         {...this.state.viewport}
         onViewportChange={(viewport) => this.setState({viewport})} />

    User interaction and transition will not work without a valid onViewportChange handler.

    The advantage of this practice is that it ensures a single source of truth regarding the viewport state (in the example above, saved in the state of the container component). When you use this viewport state to direct the rendering of other components, it is guaranteed that they will always be synced with the map.

    You may apply additional constraints to the viewport:

    _onViewportChange = viewport => {
         if (viewport.longitude > 0) {
    @@ -107,4 +107,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
         );
     }

    Using with Redux

    If you're using redux, it is very easy to hook this component up to store state in the redux state tree. The simplest way is to take all properties passed to the onViewportChange function property and add them -directly into the store. This state can then be passed back to the <ReactMapGL> component without any transformation.

    \ No newline at end of file +directly into the store. This state can then be passed back to the <ReactMapGL> component without any transformation.

    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 656a2438..e8110bbf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -90,5 +90,5 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    Introduction

    react-map-gl is a suite of React components for -Mapbox GL JS-compatible libraries.

    LibraryDescription
    MapLibreAn open fork of mapbox-gl v1, that can be used without a mapbox token.
    Mapbox GL JS v1The previous version of mapbox GL JS. This version is free open source and can be used with non-mapbox basemaps without a mapbox token.
    Mapbox GL JS v2The latest version of Mapbox GL JS. Note that version 2 is not free open source, and a mapbox token is required and billable events are generated even if you do not use mapbox hosted basemaps.
    Other mapbox-gl forksIt may be possible to use react-map-gl with other mapbox forks, but this is not a supported use case. Minor PRs to enable other forks to be used may be accepted.

    For basemaps:

    • You can load map data from Mapbox's own service.
    • You can create and host your own map data using one of the many open source tools.

    New to react-map-gl? Get Started

    Want to contribute? See our Developer Guide

    Design Philosophy

    At Uber, we make powerful web tools that contain maps. To manage the complexity of our applications, we fully embrace React and reactive programming.

    The stock mapbox-gl APIs are imperative. That is, you instruct the map to do something (for example, map.flyTo), and it will execute the command at its own pace.

    This does not scale when we have many components that need to synchronize with each other. One use case we have is to render two maps side by side, and when the user interacts with one, update both cameras. We draw UI on top of the map using React, pinned to a given geolocation. We also render visualization layers on top of the map using WebGL, most notably with deck.gl. The mapbox maps, the deck.gl canvas, and React controls' render cycles are all asynchronous. If we listen to the move event in the map and tell the other components to update, the other components would always be one frame behind.

    Ultimately, in the spirit of the reactive programming paradigm, data always flows down. In a complex application, any user input or data fetch can affect the rendering of many components. We might store the source of truth in a parent component state, or Redux store, or hooks, and let it propagate down to the map as well as its peers. As long as the map manages its own state, as mapbox-gl is designed to do, we risk the components going out of sync.

    react-map-gl creates a fully reactive wrapper for mapbox-gl. The InteractiveMap component is stateless. To move the map camera in anyway, the application must update the component's props. The application can also be confident that the map's camera would never deviate from the props that it's assigned. At first glance, its API may seem verbose to those who come from the imperative world of mapbox-gl. However, it is essential for the correctness of large applications.

    Limitations

    This library provides convenient wrappers around initializing and (to some degree) tracking the state of a Mapbox WebGL map. Because most of the functionality of Mapbox's JS API depends on the use of HTML5 canvases and WebGL, which React is not built to manipulate, the React component does not mirror all the functionality of Mapbox GL JS's Map class. You may access the native Mapbox API exposed by the getMap() function in this library. However, proceed with caution as calling the native APIs may break the connection between the React layer props and the underlying map state.

    Examples of replacing common native API calls with their React equivalents can be found on the FAQ page.

    \ No newline at end of file +

    Introduction

    react-map-gl is a suite of React components for +Mapbox GL JS-compatible libraries.

    LibraryDescription
    MapLibreAn open fork of mapbox-gl v1, that can be used without a mapbox token.
    Mapbox GL JS v1The previous version of mapbox GL JS. This version is free open source and can be used with non-mapbox basemaps without a mapbox token.
    Mapbox GL JS v2The latest version of Mapbox GL JS. Note that version 2 is not free open source, and a mapbox token is required and billable events are generated even if you do not use mapbox hosted basemaps.
    Other mapbox-gl forksIt may be possible to use react-map-gl with other mapbox forks, but this is not a supported use case. Minor PRs to enable other forks to be used may be accepted.

    For basemaps:

    • You can load map data from Mapbox's own service.
    • You can create and host your own map data using one of the many open source tools.

    New to react-map-gl? Get Started

    Want to contribute? See our Developer Guide

    Design Philosophy

    At Uber, we make powerful web tools that contain maps. To manage the complexity of our applications, we fully embrace React and reactive programming.

    The stock mapbox-gl APIs are imperative. That is, you instruct the map to do something (for example, map.flyTo), and it will execute the command at its own pace.

    This does not scale when we have many components that need to synchronize with each other. One use case we have is to render two maps side by side, and when the user interacts with one, update both cameras. We draw UI on top of the map using React, pinned to a given geolocation. We also render visualization layers on top of the map using WebGL, most notably with deck.gl. The mapbox maps, the deck.gl canvas, and React controls' render cycles are all asynchronous. If we listen to the move event in the map and tell the other components to update, the other components would always be one frame behind.

    Ultimately, in the spirit of the reactive programming paradigm, data always flows down. In a complex application, any user input or data fetch can affect the rendering of many components. We might store the source of truth in a parent component state, or Redux store, or hooks, and let it propagate down to the map as well as its peers. As long as the map manages its own state, as mapbox-gl is designed to do, we risk the components going out of sync.

    react-map-gl creates a fully reactive wrapper for mapbox-gl. The InteractiveMap component is stateless. To move the map camera in anyway, the application must update the component's props. The application can also be confident that the map's camera would never deviate from the props that it's assigned. At first glance, its API may seem verbose to those who come from the imperative world of mapbox-gl. However, it is essential for the correctness of large applications.

    Limitations

    This library provides convenient wrappers around initializing and (to some degree) tracking the state of a Mapbox WebGL map. Because most of the functionality of Mapbox's JS API depends on the use of HTML5 canvases and WebGL, which React is not built to manipulate, the React component does not mirror all the functionality of Mapbox GL JS's Map class. You may access the native Mapbox API exposed by the getMap() function in this library. However, proceed with caution as calling the native APIs may break the connection between the React layer props and the underlying map state.

    Examples of replacing common native API calls with their React equivalents can be found on the FAQ page.

    \ No newline at end of file diff --git a/docs/upgrade-guide/index.html b/docs/upgrade-guide/index.html index 4377c4a9..46a8a271 100644 --- a/docs/upgrade-guide/index.html +++ b/docs/upgrade-guide/index.html @@ -98,7 +98,7 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    Upgrade Guide

    Upgrading to v5.3/v6.1

    • MapContext is now an official API. The experimental _MapContext export will be removed in a future release.
    • react-virtualized-auto-sizer is no longer a dependency.
    • Inertia has been enabled by default on the map controller. To revert to the behavior in previous versions, set the interaction options:
    const CONTROLLER_OPTS = {
    +  

    Upgrade Guide

    Upgrading to v5.3/v6.1

    • MapContext is now an official API. The experimental _MapContext export will be removed in a future release.
    • react-virtualized-auto-sizer is no longer a dependency.
    • Inertia has been enabled by default on the map controller. To revert to the behavior in previous versions, set the interaction options:
    const CONTROLLER_OPTS = {
       dragPan: {inertia: 0},
       dragRotate: {inertia: 0},
       touchZoom: {inertia: 0}
    @@ -119,4 +119,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor
     
     // v0.6
     import MapGL from 'react-map-gl';
    -import SVGOverlay from 'react-map-gl/src/api-reference/svg-overlay';.
    • Map State - The map state reported by onViewportChanged will now contain additional state fields (tracking not only pitch and bearing needed for perspective mode, but also transient information about how the projection is being changed by the user).
      • This information must be passed back to the react-map-gl component in the next render.
      • To simplify and future proof applications, it is recommended to simply save the entire mapState in your app store whenever it changes and then pass it back to the component rather than trying to keep track of individual fields (like longitude, latitude and zoom).
    \ No newline at end of file +import SVGOverlay from 'react-map-gl/src/api-reference/svg-overlay';.
    • Map State - The map state reported by onViewportChanged will now contain additional state fields (tracking not only pitch and bearing needed for perspective mode, but also transient information about how the projection is being changed by the user).
      • This information must be passed back to the react-map-gl component in the next render.
      • To simplify and future proof applications, it is recommended to simply save the entire mapState in your app store whenever it changes and then pass it back to the component rather than trying to keep track of individual fields (like longitude, latitude and zoom).
    \ No newline at end of file diff --git a/docs/whats-new/index.html b/docs/whats-new/index.html index ee0fd73c..72184f59 100644 --- a/docs/whats-new/index.html +++ b/docs/whats-new/index.html @@ -90,6 +90,6 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    What's new

    react-map-gl v5.3/v6.1

    Release date: Jan 27, 2020

    Highlights

    • TypeScript and Flow typings are now published with the library
    • More controller customizations. Smooth easing on wheel scroll, three-finger gesture to change pitch, inertia after pan/pinch, and customizable keyboard navigation speed. See the updated interaction options for details.
    • A new eventRecognizerOptions prop is added for fine-tuning the interaction experience.
    • New component: AttributionControl
    • Promoted to official API: MapContext
    • Resolved React error over attempted state update during render
    • GeolocateControl added supports for showAccuracyCircle
    • All controls now support inline styling with a style prop
    • All components and examples have been rewritten as functional components

    react-map-gl v6.0

    Release date: Dec 16, 2020

    What's Changed

    The 6.0 release upgrades its Mapbox GL JS dependency to v2.0. There are important changes to mapbox-gl's license and pricing model in this milestone. If you are NOT using a Mapbox account (e.g. self-hosting map tiles), do NOT upgrade to this version, and consider your options discussed in this document.

    See upgrade guide for a complete list of breaking changes.

    react-map-gl v5.2

    Release date: Jan 6, 2020

    Highlights

    • New Components: ScaleControl
    • NavigationControl: new label prop
    • GeolocateControl: new label, onGeolocate, auto props
    • New Export: WebMercatorViewport is re-exported from the viewport-mercator-project library for ease of use. It's recommended to import it from react-map-gl instead to avoid future dependency change.
    • New Example: Clusters

    react-map-gl v5.1

    Release date: Oct 30, 2019

    Highlights

    • New Components: Layer and Source have been added to provide better React parity with the Mapbox GL JS API.
    • Viewport transition: transitionDuration can be set to 'auto' when using FlyToInterpolator.
    • New Example: Add an example with drawing library react-map-gl-draw.

    react-map-gl v5.0

    Release date: May 31, 2019

    What's Changed

    The only change between the 5.0 release and the latest 4.1 release is Mapbox GL JS v1.0. By using this version, you opt into Mapbox's new pricing model, which bills per map load instead of map views. 5.0.x and 4.1.x will continue to update in parallel with otherwise identical features until November 2019 when Mapbox moves all users of 0.xx to a new pricing scheme. For more details, see mapbox's changelog and blog post.

    Alongside Mapbox GL JS's new milestone, we have relaxed the mapbox-gl dependency from locking minor release (~0.53.0) to major release (^1.0.0). This will allow developers to upgrade faster without waiting for a new release from react-map-gl.

    react-map-gl v4.1

    Release date: Mar 14, 2019

    Highlights

    • New Components: FullscreenControl, GeolocateControl have been added to provide better React parity with the Mapbox GL JS API.
    • New callback props InteractiveMap supports more callbacks:
      • onNativeClick

    react-map-gl v4.0

    Release date: Nov 5, 2018

    Highlights

    • Relative dimensions Both InteractiveMap and StaticMap now support CSS strings supplied to map width and height props. New onResize callback is fired when the map resizes.
    • React 16 Upgrade to React 16.3 context and ref patterns
    • Babel 7 Upgrade build system to Babel 7, better support for tree-shaking
    • Style diffing Now use Mapbox's native style diffing. Immutable is no longer required.
    • Draggable Markers Marker component now supports a new prop draggable, along with callbacks onDragStart, onDrag, and onDragEnd.
    • 3d Popups Popup component now supports a new prop sortByDepth to enable proper occlusion when multiple popups are used in a tilted map.
    • Interaction states onViewportChange is now called with richer descriptors of the user interaction, including isPanning, isZooming and isRotating.
    • Interactive layers Dropped the requirement for the deprecated interactive property on the layer styles. Use the interactiveLayerIds prop to specify which layers are clickable.
    • New callback props InteractiveMap supports more callbacks:
      • onDblClick
      • onMouseDown
      • onMouseMove
      • onMouseUp
      • onTouchStart
      • onTouchMove
      • onTouchEnd
      • onMouseEnter
      • onMouseLeave
      • onWheel
      • onMouseOut

    See upgrade guide for breaking changes.

    react-map-gl v3.3

    Release date: July, 2018

    Highlights

    • New viewState Property: Makes it possible to specify all map state properties (longitude, latitude, zoom, bearing and pitch) as a single property.
    • New onViewStateChange callback: An alternative callback that matches the new viewState prop.

    react-map-gl v3.2

    Realease date: January, 2018

    Highlights

    • Viewport transition: feature equivalent to Mapbox's flyTo and easeTo; smooth transition when using keyboard navigation or the NavigationControl.
    • Better parity of Mapbox interaction: navigation using keyboard and the navigation control matches Mapbox behavior, including smooth transition when zooming and panning.
    • Support for Map Reuse (experimental): A new property reuseMaps is provided for applications that create and destroy maps, to help work around a mapbox-gl resource leak issue that can lead to a browser crash in certain situations.
    • mapbox-gl 0.42.2
    • New props of the InteractiveMap component:
      • Map creation: transformRequest, reuseMaps
      • Interaction: touchZoom, touchRotate
      • Transition: transitionDuration, transitionInterpolator, transitionEasing, transitionInterruption, onTransitionStart, onTransitionInterrupt, onTransitionEnd

    react-map-gl v3.1

    Release date: October 19, 2017

    Highlights

    • Event handling
      • Support right mouse drag to rotate
      • Support keyboard navigation
      • Allow controls and overlays to block map interactions
    • React 16 - react-map-gl is now being tested with React 16, but the React peer dependency requirement is unchanged at >=15.4.x.
    • mapbox-gl v0.40.1
    • No Token warning: react-map-gl now renders an HTML message if no mapbox token is supplied.

    react-map-gl v3.0

    Release date: July 27th, 2017

    Highlights

    • Latest Mapbox GL JS: Bumps Mapbox GL JS to 0.38.
    • Multi-Touch Support: Full support for multi-touch gestures such as pinch-to-zoom and rotate.
    • New Components: The MapGL component has been split into StaticMap and InteractiveMap (the default). Also, Popup, Marker, NavigationControl have been added to provide better React parity with the Mapbox GL JS API.
    • Improved Overlay Components: Supplying viewport props (width height zoom longitude and latitude) are no longer required if you render SVGOverlay, CanvasOverlay or HTMLOverlay as a child of the map. Perspective mode is now supported in all overlays.
    • New Props: maxPitch, minPitch, dragPan, doubleClickZoom, touchZoomRotate, +

      What's new

      react-map-gl v5.3/v6.1

      Release date: Jan 27, 2020

      Highlights

      • TypeScript and Flow typings are now published with the library
      • More controller customizations. Smooth easing on wheel scroll, three-finger gesture to change pitch, inertia after pan/pinch, and customizable keyboard navigation speed. See the updated interaction options for details.
      • A new eventRecognizerOptions prop is added for fine-tuning the interaction experience.
      • New component: AttributionControl
      • Promoted to official API: MapContext
      • Resolved React error over attempted state update during render
      • GeolocateControl added supports for showAccuracyCircle
      • All controls now support inline styling with a style prop
      • All components and examples have been rewritten as functional components

      react-map-gl v6.0

      Release date: Dec 16, 2020

      What's Changed

      The 6.0 release upgrades its Mapbox GL JS dependency to v2.0. There are important changes to mapbox-gl's license and pricing model in this milestone. If you are NOT using a Mapbox account (e.g. self-hosting map tiles), do NOT upgrade to this version, and consider your options discussed in this document.

      See upgrade guide for a complete list of breaking changes.

      react-map-gl v5.2

      Release date: Jan 6, 2020

      Highlights

      • New Components: ScaleControl
      • NavigationControl: new label prop
      • GeolocateControl: new label, onGeolocate, auto props
      • New Export: WebMercatorViewport is re-exported from the viewport-mercator-project library for ease of use. It's recommended to import it from react-map-gl instead to avoid future dependency change.
      • New Example: Clusters

      react-map-gl v5.1

      Release date: Oct 30, 2019

      Highlights

      • New Components: Layer and Source have been added to provide better React parity with the Mapbox GL JS API.
      • Viewport transition: transitionDuration can be set to 'auto' when using FlyToInterpolator.
      • New Example: Add an example with drawing library react-map-gl-draw.

      react-map-gl v5.0

      Release date: May 31, 2019

      What's Changed

      The only change between the 5.0 release and the latest 4.1 release is Mapbox GL JS v1.0. By using this version, you opt into Mapbox's new pricing model, which bills per map load instead of map views. 5.0.x and 4.1.x will continue to update in parallel with otherwise identical features until November 2019 when Mapbox moves all users of 0.xx to a new pricing scheme. For more details, see mapbox's changelog and blog post.

      Alongside Mapbox GL JS's new milestone, we have relaxed the mapbox-gl dependency from locking minor release (~0.53.0) to major release (^1.0.0). This will allow developers to upgrade faster without waiting for a new release from react-map-gl.

      react-map-gl v4.1

      Release date: Mar 14, 2019

      Highlights

      • New Components: FullscreenControl, GeolocateControl have been added to provide better React parity with the Mapbox GL JS API.
      • New callback props InteractiveMap supports more callbacks:
        • onNativeClick

      react-map-gl v4.0

      Release date: Nov 5, 2018

      Highlights

      • Relative dimensions Both InteractiveMap and StaticMap now support CSS strings supplied to map width and height props. New onResize callback is fired when the map resizes.
      • React 16 Upgrade to React 16.3 context and ref patterns
      • Babel 7 Upgrade build system to Babel 7, better support for tree-shaking
      • Style diffing Now use Mapbox's native style diffing. Immutable is no longer required.
      • Draggable Markers Marker component now supports a new prop draggable, along with callbacks onDragStart, onDrag, and onDragEnd.
      • 3d Popups Popup component now supports a new prop sortByDepth to enable proper occlusion when multiple popups are used in a tilted map.
      • Interaction states onViewportChange is now called with richer descriptors of the user interaction, including isPanning, isZooming and isRotating.
      • Interactive layers Dropped the requirement for the deprecated interactive property on the layer styles. Use the interactiveLayerIds prop to specify which layers are clickable.
      • New callback props InteractiveMap supports more callbacks:
        • onDblClick
        • onMouseDown
        • onMouseMove
        • onMouseUp
        • onTouchStart
        • onTouchMove
        • onTouchEnd
        • onMouseEnter
        • onMouseLeave
        • onWheel
        • onMouseOut

      See upgrade guide for breaking changes.

      react-map-gl v3.3

      Release date: July, 2018

      Highlights

      • New viewState Property: Makes it possible to specify all map state properties (longitude, latitude, zoom, bearing and pitch) as a single property.
      • New onViewStateChange callback: An alternative callback that matches the new viewState prop.

      react-map-gl v3.2

      Realease date: January, 2018

      Highlights

      • Viewport transition: feature equivalent to Mapbox's flyTo and easeTo; smooth transition when using keyboard navigation or the NavigationControl.
      • Better parity of Mapbox interaction: navigation using keyboard and the navigation control matches Mapbox behavior, including smooth transition when zooming and panning.
      • Support for Map Reuse (experimental): A new property reuseMaps is provided for applications that create and destroy maps, to help work around a mapbox-gl resource leak issue that can lead to a browser crash in certain situations.
      • mapbox-gl 0.42.2
      • New props of the InteractiveMap component:
        • Map creation: transformRequest, reuseMaps
        • Interaction: touchZoom, touchRotate
        • Transition: transitionDuration, transitionInterpolator, transitionEasing, transitionInterruption, onTransitionStart, onTransitionInterrupt, onTransitionEnd

      react-map-gl v3.1

      Release date: October 19, 2017

      Highlights

      • Event handling
        • Support right mouse drag to rotate
        • Support keyboard navigation
        • Allow controls and overlays to block map interactions
      • React 16 - react-map-gl is now being tested with React 16, but the React peer dependency requirement is unchanged at >=15.4.x.
      • mapbox-gl v0.40.1
      • No Token warning: react-map-gl now renders an HTML message if no mapbox token is supplied.

      react-map-gl v3.0

      Release date: July 27th, 2017

      Highlights

      • Latest Mapbox GL JS: Bumps Mapbox GL JS to 0.38.
      • Multi-Touch Support: Full support for multi-touch gestures such as pinch-to-zoom and rotate.
      • New Components: The MapGL component has been split into StaticMap and InteractiveMap (the default). Also, Popup, Marker, NavigationControl have been added to provide better React parity with the Mapbox GL JS API.
      • Improved Overlay Components: Supplying viewport props (width height zoom longitude and latitude) are no longer required if you render SVGOverlay, CanvasOverlay or HTMLOverlay as a child of the map. Perspective mode is now supported in all overlays.
      • New Props: maxPitch, minPitch, dragPan, doubleClickZoom, touchZoomRotate, scrollZoom are now provided to allow granular control of map interactivity.
      • Documentation: Significantly expanded and linked with our other geospatial frameworks.
      • Examples: New stand-alone examples to get you started instantly with the new features.
      • Event Handling: New event handling architecture that enables full customization of event handling (experimental).

      Components

      InteractiveMap (New, MapGL replacement)

      This is a wrapper on top of StaticMap. It takes all the props of StaticMap and additional ones such as onViewportChange, scrollZoom, dragRotate, etc. to control interactivity on the map. See Source Code for more information.

      StaticMap (New)

      This is the React wrapper around Mapbox GL JS and takes in viewport properties such as width, height, latitude, longitude. Style diffing and updating logic also live here. See Source Code for more information.

      Overlays

      • Three overlays (ScatterplotOverlay, DraggablePointsOverlay, ChoroplethOverlay), have been moved out of the library and are now only provided as examples.

      Property Changes

      • Property Names - some prop names have been modernized, the old ones will still work for now with a warning.
      • Internal Properties such as isHovering, isDragging, startDragLngLat have been removed. -These were never meant to be useful publicly and have caused confusions in the past.

      Utilities

      • fitBounds: fitBounds has been moved to another repository and has been rewritten to provide a more logical interface.

      For more information, see the Upgrade Guide.

      react-map-gl v2.0

      Date: Jan 17, 2017

      Highlights

      • Latest mapbox-gl: Bump mapbox-gl to v0.31.0
      • new maxZoom prop - Add maxZoom prop and defaults to 20
      • New onLoad prop - Add onLoad event handler
      • new onClick prop - Add onClick prop handler (#140)

      react-map-gl v1.0

      • Perspective Mode - Now supports bearing and pitch properties, per mapbox-gl api documentation. These props default to 0 which means that maps will still be rendered in flat/ortographic mode when they are not provided
      • Support for ES6 imports - The map overlay components (HTMLOverlay, CanvasOverlay, SVGOverlay etc) previously had to be imported via their relative source paths can now be imported directly using `import {SVGOverlay} from 'react-map-gl'.

      react-map-gl v0.6

      Initial public version

      \ No newline at end of file +These were never meant to be useful publicly and have caused confusions in the past.

    Utilities

    • fitBounds: fitBounds has been moved to another repository and has been rewritten to provide a more logical interface.

    For more information, see the Upgrade Guide.

    react-map-gl v2.0

    Date: Jan 17, 2017

    Highlights

    • Latest mapbox-gl: Bump mapbox-gl to v0.31.0
    • new maxZoom prop - Add maxZoom prop and defaults to 20
    • New onLoad prop - Add onLoad event handler
    • new onClick prop - Add onClick prop handler (#140)

    react-map-gl v1.0

    • Perspective Mode - Now supports bearing and pitch properties, per mapbox-gl api documentation. These props default to 0 which means that maps will still be rendered in flat/ortographic mode when they are not provided
    • Support for ES6 imports - The map overlay components (HTMLOverlay, CanvasOverlay, SVGOverlay etc) previously had to be imported via their relative source paths can now be imported directly using `import {SVGOverlay} from 'react-map-gl'.

    react-map-gl v0.6

    Initial public version

    \ No newline at end of file diff --git a/examples/clusters/index.html b/examples/clusters/index.html index 1bc813ea..092a2190 100644 --- a/examples/clusters/index.html +++ b/examples/clusters/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/controls/index.html b/examples/controls/index.html index 9eabc2a2..ecfd55e8 100644 --- a/examples/controls/index.html +++ b/examples/controls/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    Marker, Popup, NavigationControl and FullscreenControl

    Map showing top 20 most populated cities of the United States. Click on a marker to learn more.

    Data source: Wikipedia

    \ No newline at end of file +

    Marker, Popup, NavigationControl and FullscreenControl

    Map showing top 20 most populated cities of the United States. Click on a marker to learn more.

    Data source: Wikipedia

    \ No newline at end of file diff --git a/examples/custom-cursor/index.html b/examples/custom-cursor/index.html index 24a1fdb5..007e270b 100644 --- a/examples/custom-cursor/index.html +++ b/examples/custom-cursor/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/draggable-markers/index.html b/examples/draggable-markers/index.html index 3ec57adb..560489f7 100644 --- a/examples/draggable-markers/index.html +++ b/examples/draggable-markers/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/draw-polygon/index.html b/examples/draw-polygon/index.html index 0bad852a..47a3a736 100644 --- a/examples/draw-polygon/index.html +++ b/examples/draw-polygon/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/filter/index.html b/examples/filter/index.html index d1a7cfdf..19a52e42 100644 --- a/examples/filter/index.html +++ b/examples/filter/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/geojson-animation/index.html b/examples/geojson-animation/index.html index fabf1501..980d9af9 100644 --- a/examples/geojson-animation/index.html +++ b/examples/geojson-animation/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/geojson/index.html b/examples/geojson/index.html index ac9c6c97..cbc7be19 100644 --- a/examples/geojson/index.html +++ b/examples/geojson/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/heatmap/index.html b/examples/heatmap/index.html index 45946ae4..63589a2a 100644 --- a/examples/heatmap/index.html +++ b/examples/heatmap/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/index.html b/examples/index.html index 38b71435..8b94fcca 100644 --- a/examples/index.html +++ b/examples/index.html @@ -76,4 +76,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/interaction/index.html b/examples/interaction/index.html index 5ee47f85..738d7223 100644 --- a/examples/interaction/index.html +++ b/examples/interaction/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    Limit Map Interaction

    Turn interactive features off/on.



    \ No newline at end of file +

    Limit Map Interaction

    Turn interactive features off/on.



    \ No newline at end of file diff --git a/examples/layers/index.html b/examples/layers/index.html index e5c3163f..c51548ad 100644 --- a/examples/layers/index.html +++ b/examples/layers/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    Dynamic Styling

    Dynamically show/hide map layers and change color with Immutable map style.


    \ No newline at end of file +

    Dynamic Styling

    Dynamically show/hide map layers and change color with Immutable map style.


    \ No newline at end of file diff --git a/examples/locate-user/index.html b/examples/locate-user/index.html index 68259078..526db73a 100644 --- a/examples/locate-user/index.html +++ b/examples/locate-user/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/terrain/index.html b/examples/terrain/index.html index 013550da..ad44b835 100644 --- a/examples/terrain/index.html +++ b/examples/terrain/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/viewport-animation/index.html b/examples/viewport-animation/index.html index ddf731d6..4eb3434f 100644 --- a/examples/viewport-animation/index.html +++ b/examples/viewport-animation/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/examples/zoom-to-bounds/index.html b/examples/zoom-to-bounds/index.html index 4f8d54cd..4a9e40eb 100644 --- a/examples/zoom-to-bounds/index.html +++ b/examples/zoom-to-bounds/index.html @@ -68,4 +68,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) - \ No newline at end of file + \ No newline at end of file diff --git a/index.html b/index.html index 6002969c..00832868 100644 --- a/index.html +++ b/index.html @@ -84,4 +84,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -

    react-map-gl

    React wrapper for Mapbox GL JS

    GET STARTED

    react-map-gl makes using Mapbox GL JS in React applications easy.

    React Integration

    Integration on browser and Node.js, exposing the full power of mapbox-gl.

    Component Library

    react-map-gl comes with additional React components that synchronize with the map camera system. Use one of the supported overlays to visualize data, or build your own.

    Part of vis.gl's Framework Suite

    Use together with e.g. deck.gl to render performant and compelling 2D and 3D WebGL visualizations on top of your Mapbox GL JS based maps.

    Contributors

    Made by
    logo
    \ No newline at end of file +

    react-map-gl

    React wrapper for Mapbox GL JS

    GET STARTED

    react-map-gl makes using Mapbox GL JS in React applications easy.

    React Integration

    Integration on browser and Node.js, exposing the full power of mapbox-gl.

    Component Library

    react-map-gl comes with additional React components that synchronize with the map camera system. Use one of the supported overlays to visualize data, or build your own.

    Part of vis.gl's Framework Suite

    Use together with e.g. deck.gl to render performant and compelling 2D and 3D WebGL visualizations on top of your Mapbox GL JS based maps.

    Contributors

    Made by
    logo
    \ No newline at end of file diff --git a/page-data/app-data.json b/page-data/app-data.json index 2c34cc31..02aa5cf0 100644 --- a/page-data/app-data.json +++ b/page-data/app-data.json @@ -1 +1 @@ -{"webpackCompilationHash":"4abbe719336efa59776d"} +{"webpackCompilationHash":"fa52de29a9f545e1b706"} diff --git a/page-data/docs/api-reference/geolocate-control/page-data.json b/page-data/docs/api-reference/geolocate-control/page-data.json index 04e77403..526bef69 100644 --- a/page-data/docs/api-reference/geolocate-control/page-data.json +++ b/page-data/docs/api-reference/geolocate-control/page-data.json @@ -1 +1 @@ -{"componentChunkName":"component---node-modules-gatsby-theme-ocular-src-react-templates-documentation-jsx","path":"/docs/api-reference/geolocate-control","result":{"data":{"docBySlug":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {};\nvar layoutProps = {\n _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n var components = _ref.components,\n props = _objectWithoutProperties(_ref, [\"components\"]);\n\n return mdx(MDXLayout, _extends({}, layoutProps, props, {\n components: components,\n mdxType: \"MDXLayout\"\n }), mdx(\"h1\", {\n \"id\": \"geolocatecontrol\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h1\",\n \"href\": \"#geolocatecontrol\",\n \"aria-label\": \"geolocatecontrol permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"GeolocateControl\"), mdx(\"p\", null, mdx(\"img\", {\n parentName: \"p\",\n \"src\": \"https://img.shields.io/badge/since-v4.1-green\",\n \"alt\": \"Since v4.1\"\n })), mdx(\"p\", null, \"This is a React equivalent of Mapbox's \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://www.mapbox.com/mapbox-gl-js/api/#geolocatecontrol\"\n }, \"GeolocateControl\"), \".\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"*\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"as\"), \" React \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" ReactMapGL\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"GeolocateControl\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"\\\"react-map-gl\\\"\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"const\"), \" geolocateControlStyle\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n right\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"10\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n top\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"10\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"function\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"App\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"const\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"[\"), \"viewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \" setViewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"]\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" React\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"useState\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n longitude\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"-\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"122.45\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n latitude\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"37.78\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n zoom\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"14\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"return\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"<\"), \"ReactMapGL \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"...\"), \"viewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \" width\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"\\\"100vw\\\"\"), \" height\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"\\\"100vh\\\"\"), \" onViewportChange\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"setViewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \">\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"<\"), \"GeolocateControl\\n style\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"geolocateControlStyle\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n positionOptions\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"enableHighAccuracy\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token boolean\"\n }, \"true\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n trackUserLocation\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token boolean\"\n }, \"true\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n auto\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"/\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \">\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"<\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"/\"), \"ReactMapGL\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \">\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\")))), mdx(\"h2\", {\n \"id\": \"properties\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#properties\",\n \"aria-label\": \"properties permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Properties\"), mdx(\"p\", null, \"Accepts all the options of \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol\"\n }, \"Mapbox GeolocateControl\"), \".\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textonviewportchangecode-function-optional\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textonviewportchangecode-function-optional\",\n \"aria-label\": \"code classlanguage textonviewportchangecode function optional permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"onViewportChange\"), \" (Function, optional)\"), mdx(\"p\", null, \"Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"/react-map-gl/docs/api-reference/interactive-map.md\"\n }, \"InteractiveMap\"), \"'s \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"onViewportChange\"), \".\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textongeolocatecode-function-optional\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textongeolocatecode-function-optional\",\n \"aria-label\": \"code classlanguage textongeolocatecode function optional permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"onGeolocate\"), \" (Function, optional)\"), mdx(\"p\", null, \"Callback when Geolocation API position updates. It is called with a Geolocation API \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions\"\n }, \"PositionOptions\"), \" object.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textpositionoptionscode-object\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textpositionoptionscode-object\",\n \"aria-label\": \"code classlanguage textpositionoptionscode object permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"positionOptions\"), \" (Object)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"{enableHighAccuracy: false, timeout: 6000}\"))), mdx(\"p\", null, \"A Geolocation API \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions\"\n }, \"PositionOptions\"), \" object.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textfitboundsoptionscode-object\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textfitboundsoptionscode-object\",\n \"aria-label\": \"code classlanguage textfitboundsoptionscode object permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"fitBoundsOptions\"), \" (Object)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"{maxZoom: 15}\"))), mdx(\"p\", null, \"A \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"/react-map-gl/docs/api-reference/web-mercator-viewport.md#fitboundsbounds-options-object\"\n }, \"fitBounds\"), \" options object to use when the map is panned and zoomed to the user's location. The default is to use a maxZoom of 15 to limit how far the map will zoom in for very accurate locations.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-texttrackuserlocationcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-texttrackuserlocationcode-boolean\",\n \"aria-label\": \"code classlanguage texttrackuserlocationcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"trackUserLocation\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"If true the Geolocate Control becomes a toggle button and when active the map will receive updates to the user's location as it changes.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textshowuserlocationcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textshowuserlocationcode-boolean\",\n \"aria-label\": \"code classlanguage textshowuserlocationcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"showUserLocation\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"By default a dot will be shown on the map at the user's location. Set to false to disable.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textshowaccuracycirclecode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textshowaccuracycirclecode-boolean\",\n \"aria-label\": \"code classlanguage textshowaccuracycirclecode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"showAccuracyCircle\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"By default, if showUserLocation is \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"true\"), \" , a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"false\"), \" to disable. Always disabled when showUserLocation is \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"false\"), \".\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textclassnamecode-string\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textclassnamecode-string\",\n \"aria-label\": \"code classlanguage textclassnamecode string permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"className\"), \" (String)\"), mdx(\"p\", null, \"Assign a custom class name to the container of this control.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textstylecode-object\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textstylecode-object\",\n \"aria-label\": \"code classlanguage textstylecode object permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"style\"), \" (Object)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"{position: 'absolute'}\"))), mdx(\"p\", null, \"A \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://reactjs.org/docs/dom-elements.html#style\"\n }, \"React style\"), \" object applied to this control.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textlabelcode-string\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textlabelcode-string\",\n \"aria-label\": \"code classlanguage textlabelcode string permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"label\"), \" (String)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"'Find My Location'\"))), mdx(\"p\", null, \"Label applied to the Geolocate control button.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textdisabledlabelcode-string\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textdisabledlabelcode-string\",\n \"aria-label\": \"code classlanguage textdisabledlabelcode string permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"disabledLabel\"), \" (String)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"'Location Not Available'\"))), mdx(\"p\", null, \"Label applied to the Geolocate control button if geolocation is disabled by the user.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textautocode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textautocode-boolean\",\n \"aria-label\": \"code classlanguage textautocode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"auto\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"Programmatically triggers geolocate when set to true. Initializing the component with true triggers inside \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"componentDidMount\"), \" where as changing to true at a later point triggers inside \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"componentDidUpdate\"), \". Initally setting as or changing to false has no effect.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcapturescrollcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcapturescrollcode-boolean\",\n \"aria-label\": \"code classlanguage textcapturescrollcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"captureScroll\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcapturedragcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcapturedragcode-boolean\",\n \"aria-label\": \"code classlanguage textcapturedragcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"captureDrag\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcaptureclickcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcaptureclickcode-boolean\",\n \"aria-label\": \"code classlanguage textcaptureclickcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"captureClick\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"Stop propagation of click event to the map component. Can be used to stop map from calling the \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"onClick\"), \" callback when this component is clicked.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcapturedoubleclickcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcapturedoubleclickcode-boolean\",\n \"aria-label\": \"code classlanguage textcapturedoubleclickcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"captureDoubleClick\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcapturepointermovecode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcapturepointermovecode-boolean\",\n \"aria-label\": \"code classlanguage textcapturepointermovecode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"capturePointerMove\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"Stop propagation of pointermove event to the map component. Can be used to stop map from calling the \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"onMouseMove\"), \" or \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"onTouchMove\"), \" callback when this component is hovered.\"), mdx(\"h2\", {\n \"id\": \"styling\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#styling\",\n \"aria-label\": \"styling permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Styling\"), mdx(\"p\", null, \"Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.\"), mdx(\"h2\", {\n \"id\": \"source\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#source\",\n \"aria-label\": \"source permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Source\"), mdx(\"p\", null, mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/visgl/react-map-gl/tree/6.1-release/src/components/geolocate-control.js\"\n }, \"geolocate-control.js\")));\n}\n;\nMDXContent.isMDXComponent = true;","timeToRead":2,"excerpt":"GeolocateControl This is a React equivalent of Mapbox's GeolocateControl . Properties Accepts all the options of Mapbox GeolocateControl…","frontmatter":{"title":"GeolocateControl"}}},"pageContext":{"relativeLinks":{"docs":"/docs","../../../docs":"/docs","docs/advanced/custom-components":"/docs/advanced/custom-components","../../advanced/custom-components":"/docs/advanced/custom-components","docs/advanced/custom-map-controller":"/docs/advanced/custom-map-controller","../../advanced/custom-map-controller":"/docs/advanced/custom-map-controller","docs/advanced/viewport-transition":"/docs/advanced/viewport-transition","../../advanced/viewport-transition":"/docs/advanced/viewport-transition","docs/api-reference/attribution-control":"/docs/api-reference/attribution-control","../attribution-control":"/docs/api-reference/attribution-control","docs/api-reference/canvas-overlay":"/docs/api-reference/canvas-overlay","../canvas-overlay":"/docs/api-reference/canvas-overlay","docs/api-reference/fly-to-interpolator":"/docs/api-reference/fly-to-interpolator","../fly-to-interpolator":"/docs/api-reference/fly-to-interpolator","docs/api-reference/fullscreen-control":"/docs/api-reference/fullscreen-control","../fullscreen-control":"/docs/api-reference/fullscreen-control","docs/api-reference/geolocate-control":"/docs/api-reference/geolocate-control","../geolocate-control":"/docs/api-reference/geolocate-control","docs/api-reference/html-overlay":"/docs/api-reference/html-overlay","../html-overlay":"/docs/api-reference/html-overlay","docs/api-reference/interactive-map":"/docs/api-reference/interactive-map","../interactive-map":"/docs/api-reference/interactive-map","docs/api-reference/layer":"/docs/api-reference/layer","../layer":"/docs/api-reference/layer","docs/api-reference/linear-interpolator":"/docs/api-reference/linear-interpolator","../linear-interpolator":"/docs/api-reference/linear-interpolator","docs/api-reference/map-context":"/docs/api-reference/map-context","../map-context":"/docs/api-reference/map-context","docs/api-reference/map-controller":"/docs/api-reference/map-controller","../map-controller":"/docs/api-reference/map-controller","docs/api-reference/marker":"/docs/api-reference/marker","../marker":"/docs/api-reference/marker","docs/api-reference/navigation-control":"/docs/api-reference/navigation-control","../navigation-control":"/docs/api-reference/navigation-control","docs/api-reference/pointer-event":"/docs/api-reference/pointer-event","../pointer-event":"/docs/api-reference/pointer-event","docs/api-reference/popup":"/docs/api-reference/popup","../popup":"/docs/api-reference/popup","docs/api-reference/scale-control":"/docs/api-reference/scale-control","../scale-control":"/docs/api-reference/scale-control","docs/api-reference/source":"/docs/api-reference/source","../source":"/docs/api-reference/source","docs/api-reference/static-map":"/docs/api-reference/static-map","../static-map":"/docs/api-reference/static-map","docs/api-reference/svg-overlay":"/docs/api-reference/svg-overlay","../svg-overlay":"/docs/api-reference/svg-overlay","docs/api-reference/web-mercator-viewport":"/docs/api-reference/web-mercator-viewport","../web-mercator-viewport":"/docs/api-reference/web-mercator-viewport","docs/contributing":"/docs/contributing","../../contributing":"/docs/contributing","docs/upgrade-guide":"/docs/upgrade-guide","../../upgrade-guide":"/docs/upgrade-guide","docs/whats-new":"/docs/whats-new","../../whats-new":"/docs/whats-new","docs/get-started/adding-custom-data":"/docs/get-started/adding-custom-data","../../get-started/adding-custom-data":"/docs/get-started/adding-custom-data","docs/get-started/faq":"/docs/get-started/faq","../../get-started/faq":"/docs/get-started/faq","docs/get-started/get-started":"/docs/get-started/get-started","../../get-started/get-started":"/docs/get-started/get-started","docs/get-started/mapbox-tokens":"/docs/get-started/mapbox-tokens","../../get-started/mapbox-tokens":"/docs/get-started/mapbox-tokens","docs/get-started/state-management":"/docs/get-started/state-management","../../get-started/state-management":"/docs/get-started/state-management"},"title":"GeolocateControl","slug":"docs/api-reference/geolocate-control","toc":"docs"}},"staticQueryHashes":["484347790"]} \ No newline at end of file +{"componentChunkName":"component---node-modules-gatsby-theme-ocular-src-react-templates-documentation-jsx","path":"/docs/api-reference/geolocate-control","result":{"data":{"docBySlug":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {};\nvar layoutProps = {\n _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n var components = _ref.components,\n props = _objectWithoutProperties(_ref, [\"components\"]);\n\n return mdx(MDXLayout, _extends({}, layoutProps, props, {\n components: components,\n mdxType: \"MDXLayout\"\n }), mdx(\"h1\", {\n \"id\": \"geolocatecontrol\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h1\",\n \"href\": \"#geolocatecontrol\",\n \"aria-label\": \"geolocatecontrol permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"GeolocateControl\"), mdx(\"p\", null, mdx(\"img\", {\n parentName: \"p\",\n \"src\": \"https://img.shields.io/badge/since-v4.1-green\",\n \"alt\": \"Since v4.1\"\n })), mdx(\"p\", null, \"This is a React equivalent of Mapbox's \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://www.mapbox.com/mapbox-gl-js/api/#geolocatecontrol\"\n }, \"GeolocateControl\"), \".\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"*\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"as\"), \" React \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" ReactMapGL\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"GeolocateControl\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react-map-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"const\"), \" geolocateControlStyle \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n right\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"10\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n top\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"10\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"function\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"App\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"const\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"[\"), \"viewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \" setViewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"]\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" React\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"useState\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n longitude\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"-\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"122.45\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n latitude\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"37.78\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n zoom\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"14\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"return\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"<\"), \"ReactMapGL \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"...\"), \"viewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \" width\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"\\\"100vw\\\"\"), \" height\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"\\\"100vh\\\"\"), \" onViewportChange\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"setViewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \">\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"<\"), \"GeolocateControl\\n style\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"geolocateControlStyle\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n positionOptions\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"enableHighAccuracy\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token boolean\"\n }, \"true\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n trackUserLocation\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token boolean\"\n }, \"true\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n auto\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"/\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \">\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"<\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"/\"), \"ReactMapGL\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \">\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\")))), mdx(\"h2\", {\n \"id\": \"properties\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#properties\",\n \"aria-label\": \"properties permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Properties\"), mdx(\"p\", null, \"Accepts all the options of \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol\"\n }, \"Mapbox GeolocateControl\"), \".\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textonviewportchangecode-function-optional\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textonviewportchangecode-function-optional\",\n \"aria-label\": \"code classlanguage textonviewportchangecode function optional permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"onViewportChange\"), \" (Function, optional)\"), mdx(\"p\", null, \"Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"/react-map-gl/docs/api-reference/interactive-map.md\"\n }, \"InteractiveMap\"), \"'s \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"onViewportChange\"), \".\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textongeolocatecode-function-optional\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textongeolocatecode-function-optional\",\n \"aria-label\": \"code classlanguage textongeolocatecode function optional permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"onGeolocate\"), \" (Function, optional)\"), mdx(\"p\", null, \"Callback when Geolocation API position updates. It is called with a Geolocation API \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions\"\n }, \"PositionOptions\"), \" object.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textpositionoptionscode-object\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textpositionoptionscode-object\",\n \"aria-label\": \"code classlanguage textpositionoptionscode object permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"positionOptions\"), \" (Object)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"{enableHighAccuracy: false, timeout: 6000}\"))), mdx(\"p\", null, \"A Geolocation API \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions\"\n }, \"PositionOptions\"), \" object.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textfitboundsoptionscode-object\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textfitboundsoptionscode-object\",\n \"aria-label\": \"code classlanguage textfitboundsoptionscode object permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"fitBoundsOptions\"), \" (Object)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"{maxZoom: 15}\"))), mdx(\"p\", null, \"A \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"/react-map-gl/docs/api-reference/web-mercator-viewport.md#fitboundsbounds-options-object\"\n }, \"fitBounds\"), \" options object to use when the map is panned and zoomed to the user's location. The default is to use a maxZoom of 15 to limit how far the map will zoom in for very accurate locations.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-texttrackuserlocationcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-texttrackuserlocationcode-boolean\",\n \"aria-label\": \"code classlanguage texttrackuserlocationcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"trackUserLocation\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"If true the Geolocate Control becomes a toggle button and when active the map will receive updates to the user's location as it changes.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textshowuserlocationcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textshowuserlocationcode-boolean\",\n \"aria-label\": \"code classlanguage textshowuserlocationcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"showUserLocation\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"By default a dot will be shown on the map at the user's location. Set to false to disable.\"), mdx(\"h5\", {\n \"id\": \"showuserheading-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#showuserheading-boolean\",\n \"aria-label\": \"showuserheading boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"showUserHeading (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"If true a heading indicator will be shown on the map at the user's location.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textshowaccuracycirclecode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textshowaccuracycirclecode-boolean\",\n \"aria-label\": \"code classlanguage textshowaccuracycirclecode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"showAccuracyCircle\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"By default, if showUserLocation is \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"true\"), \" , a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"false\"), \" to disable. Always disabled when showUserLocation is \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"false\"), \".\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textclassnamecode-string\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textclassnamecode-string\",\n \"aria-label\": \"code classlanguage textclassnamecode string permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"className\"), \" (String)\"), mdx(\"p\", null, \"Assign a custom class name to the container of this control.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textstylecode-object\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textstylecode-object\",\n \"aria-label\": \"code classlanguage textstylecode object permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"style\"), \" (Object)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"{position: 'absolute'}\"))), mdx(\"p\", null, \"A \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://reactjs.org/docs/dom-elements.html#style\"\n }, \"React style\"), \" object applied to this control.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textlabelcode-string\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textlabelcode-string\",\n \"aria-label\": \"code classlanguage textlabelcode string permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"label\"), \" (String)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"'Find My Location'\"))), mdx(\"p\", null, \"Label applied to the Geolocate control button.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textdisabledlabelcode-string\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textdisabledlabelcode-string\",\n \"aria-label\": \"code classlanguage textdisabledlabelcode string permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"disabledLabel\"), \" (String)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"'Location Not Available'\"))), mdx(\"p\", null, \"Label applied to the Geolocate control button if geolocation is disabled by the user.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textautocode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textautocode-boolean\",\n \"aria-label\": \"code classlanguage textautocode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"auto\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"Programmatically triggers geolocate when set to true. Initializing the component with true triggers inside \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"componentDidMount\"), \" where as changing to true at a later point triggers inside \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"componentDidUpdate\"), \". Initally setting as or changing to false has no effect.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcapturescrollcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcapturescrollcode-boolean\",\n \"aria-label\": \"code classlanguage textcapturescrollcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"captureScroll\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcapturedragcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcapturedragcode-boolean\",\n \"aria-label\": \"code classlanguage textcapturedragcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"captureDrag\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcaptureclickcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcaptureclickcode-boolean\",\n \"aria-label\": \"code classlanguage textcaptureclickcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"captureClick\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"Stop propagation of click event to the map component. Can be used to stop map from calling the \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"onClick\"), \" callback when this component is clicked.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcapturedoubleclickcode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcapturedoubleclickcode-boolean\",\n \"aria-label\": \"code classlanguage textcapturedoubleclickcode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"captureDoubleClick\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"true\"))), mdx(\"p\", null, \"Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked.\"), mdx(\"h5\", {\n \"id\": \"code-classlanguage-textcapturepointermovecode-boolean\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h5\",\n \"href\": \"#code-classlanguage-textcapturepointermovecode-boolean\",\n \"aria-label\": \"code classlanguage textcapturepointermovecode boolean permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), mdx(\"code\", {\n parentName: \"h5\",\n \"className\": \"language-text\"\n }, \"capturePointerMove\"), \" (Boolean)\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, \"default: \", mdx(\"code\", {\n parentName: \"li\",\n \"className\": \"language-text\"\n }, \"false\"))), mdx(\"p\", null, \"Stop propagation of pointermove event to the map component. Can be used to stop map from calling the \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"onMouseMove\"), \" or \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"onTouchMove\"), \" callback when this component is hovered.\"), mdx(\"h2\", {\n \"id\": \"styling\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#styling\",\n \"aria-label\": \"styling permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Styling\"), mdx(\"p\", null, \"Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page.\"), mdx(\"h2\", {\n \"id\": \"source\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#source\",\n \"aria-label\": \"source permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Source\"), mdx(\"p\", null, mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/visgl/react-map-gl/tree/6.1-release/src/components/geolocate-control.js\"\n }, \"geolocate-control.js\")));\n}\n;\nMDXContent.isMDXComponent = true;","timeToRead":2,"excerpt":"GeolocateControl This is a React equivalent of Mapbox's GeolocateControl . Properties Accepts all the options of Mapbox GeolocateControl…","frontmatter":{"title":"GeolocateControl"}}},"pageContext":{"relativeLinks":{"docs":"/docs","../../../docs":"/docs","docs/advanced/custom-components":"/docs/advanced/custom-components","../../advanced/custom-components":"/docs/advanced/custom-components","docs/advanced/custom-map-controller":"/docs/advanced/custom-map-controller","../../advanced/custom-map-controller":"/docs/advanced/custom-map-controller","docs/advanced/viewport-transition":"/docs/advanced/viewport-transition","../../advanced/viewport-transition":"/docs/advanced/viewport-transition","docs/api-reference/attribution-control":"/docs/api-reference/attribution-control","../attribution-control":"/docs/api-reference/attribution-control","docs/api-reference/canvas-overlay":"/docs/api-reference/canvas-overlay","../canvas-overlay":"/docs/api-reference/canvas-overlay","docs/api-reference/fly-to-interpolator":"/docs/api-reference/fly-to-interpolator","../fly-to-interpolator":"/docs/api-reference/fly-to-interpolator","docs/api-reference/fullscreen-control":"/docs/api-reference/fullscreen-control","../fullscreen-control":"/docs/api-reference/fullscreen-control","docs/api-reference/geolocate-control":"/docs/api-reference/geolocate-control","../geolocate-control":"/docs/api-reference/geolocate-control","docs/api-reference/html-overlay":"/docs/api-reference/html-overlay","../html-overlay":"/docs/api-reference/html-overlay","docs/api-reference/interactive-map":"/docs/api-reference/interactive-map","../interactive-map":"/docs/api-reference/interactive-map","docs/api-reference/layer":"/docs/api-reference/layer","../layer":"/docs/api-reference/layer","docs/api-reference/linear-interpolator":"/docs/api-reference/linear-interpolator","../linear-interpolator":"/docs/api-reference/linear-interpolator","docs/api-reference/map-context":"/docs/api-reference/map-context","../map-context":"/docs/api-reference/map-context","docs/api-reference/map-controller":"/docs/api-reference/map-controller","../map-controller":"/docs/api-reference/map-controller","docs/api-reference/marker":"/docs/api-reference/marker","../marker":"/docs/api-reference/marker","docs/api-reference/navigation-control":"/docs/api-reference/navigation-control","../navigation-control":"/docs/api-reference/navigation-control","docs/api-reference/pointer-event":"/docs/api-reference/pointer-event","../pointer-event":"/docs/api-reference/pointer-event","docs/api-reference/popup":"/docs/api-reference/popup","../popup":"/docs/api-reference/popup","docs/api-reference/scale-control":"/docs/api-reference/scale-control","../scale-control":"/docs/api-reference/scale-control","docs/api-reference/source":"/docs/api-reference/source","../source":"/docs/api-reference/source","docs/api-reference/static-map":"/docs/api-reference/static-map","../static-map":"/docs/api-reference/static-map","docs/api-reference/svg-overlay":"/docs/api-reference/svg-overlay","../svg-overlay":"/docs/api-reference/svg-overlay","docs/api-reference/web-mercator-viewport":"/docs/api-reference/web-mercator-viewport","../web-mercator-viewport":"/docs/api-reference/web-mercator-viewport","docs/contributing":"/docs/contributing","../../contributing":"/docs/contributing","docs/upgrade-guide":"/docs/upgrade-guide","../../upgrade-guide":"/docs/upgrade-guide","docs/whats-new":"/docs/whats-new","../../whats-new":"/docs/whats-new","docs/get-started/adding-custom-data":"/docs/get-started/adding-custom-data","../../get-started/adding-custom-data":"/docs/get-started/adding-custom-data","docs/get-started/faq":"/docs/get-started/faq","../../get-started/faq":"/docs/get-started/faq","docs/get-started/get-started":"/docs/get-started/get-started","../../get-started/get-started":"/docs/get-started/get-started","docs/get-started/mapbox-tokens":"/docs/get-started/mapbox-tokens","../../get-started/mapbox-tokens":"/docs/get-started/mapbox-tokens","docs/get-started/state-management":"/docs/get-started/state-management","../../get-started/state-management":"/docs/get-started/state-management"},"title":"GeolocateControl","slug":"docs/api-reference/geolocate-control","toc":"docs"}},"staticQueryHashes":["484347790"]} \ No newline at end of file diff --git a/page-data/docs/get-started/get-started/page-data.json b/page-data/docs/get-started/get-started/page-data.json index e8747e59..c4a47fba 100644 --- a/page-data/docs/get-started/get-started/page-data.json +++ b/page-data/docs/get-started/get-started/page-data.json @@ -1 +1 @@ -{"componentChunkName":"component---node-modules-gatsby-theme-ocular-src-react-templates-documentation-jsx","path":"/docs/get-started/get-started","result":{"data":{"docBySlug":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {};\nvar layoutProps = {\n _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n var components = _ref.components,\n props = _objectWithoutProperties(_ref, [\"components\"]);\n\n return mdx(MDXLayout, _extends({}, layoutProps, props, {\n components: components,\n mdxType: \"MDXLayout\"\n }), mdx(\"h1\", {\n \"id\": \"get-started\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h1\",\n \"href\": \"#get-started\",\n \"aria-label\": \"get started permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Get Started\"), mdx(\"h2\", {\n \"id\": \"installation\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#installation\",\n \"aria-label\": \"installation permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Installation\"), mdx(\"p\", null, \"Using \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"react-map-gl\"), \" requires \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"node >= v4\"), \" and \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"react >= 16.3\"), \".\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"sh\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-sh\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-sh\"\n }, \"npm install --save react-map-gl\"))), mdx(\"h2\", {\n \"id\": \"example\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#example\",\n \"aria-label\": \"example permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Example\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"*\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"as\"), \" React \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \" useState \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" ReactMapGL \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react-map-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"function\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"Map\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"const\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"[\"), \"viewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \" setViewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"]\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"useState\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n width\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"400\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n height\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"400\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n latitude\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"37.7577\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n longitude\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"-\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"122.4376\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n zoom\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"8\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"return\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"<\"), \"ReactMapGL\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"...\"), \"viewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n onViewportChange\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token parameter\"\n }, \"nextViewport\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=>\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"setViewport\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), \"nextViewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"/\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \">\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\")))), mdx(\"p\", null, \"See full project setup in \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/visgl/react-map-gl/tree/6.1-release/examples/get-started\"\n }, \"get-started examples\")), mdx(\"h2\", {\n \"id\": \"styling\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#styling\",\n \"aria-label\": \"styling permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Styling\"), mdx(\"p\", null, \"The current mapbox-gl release requires its stylesheet be included at all times. The marker, popup and navigation components in react-map-gl also need the stylesheet to work properly.\"), mdx(\"p\", null, \"You may add the stylesheet to the head of your page:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"html\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-html\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-html\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token tag\"\n }, mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token tag\"\n }, mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"<\"), \"link\"), \" \", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token attr-name\"\n }, \"href\"), mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token attr-value\"\n }, mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation attr-equals\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"'\"), \"https://api.tiles.mapbox.com/mapbox-gl-js/v/mapbox-gl.css\", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"'\")), \" \", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token attr-name\"\n }, \"rel\"), mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token attr-value\"\n }, mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation attr-equals\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"'\"), \"stylesheet\", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"'\")), \" \", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"/>\"))))), mdx(\"p\", null, \"Find out your mapbox version by running \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"yarn list mapbox-gl\"), \" or \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"npm ls mapbox-gl\"), \".\"), mdx(\"p\", null, \"Or embed it in your app by using - \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://www.npmjs.com/package/browserify-css\"\n }, \"browserify-css\"), \"\\nwith Browserify or - \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://webpack.github.io/docs/stylesheets.html\"\n }, \"css-loader\"), \" with Webpack:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// app.js\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'mapbox-gl/dist/mapbox-gl.css'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\")))), mdx(\"h2\", {\n \"id\": \"using-with-browserify-webpack-and-other-javascript-bundlers\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#using-with-browserify-webpack-and-other-javascript-bundlers\",\n \"aria-label\": \"using with browserify webpack and other javascript bundlers permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Using with Browserify, Webpack, and other JavaScript Bundlers\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, mdx(\"p\", {\n parentName: \"li\"\n }, mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"browserify\"), \" - react-map-gl is extensively tested with \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"browserify\"), \" and works without configuration.\")), mdx(\"li\", {\n parentName: \"ul\"\n }, mdx(\"p\", {\n parentName: \"li\"\n }, mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"webpack\"), \" - Most of the provided react-map-gl examples use webpack. Look at the \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/visgl/react-map-gl/tree/6.1-release/examples/get-started\"\n }, \"get started examples\"), \" folder for minimalist templates.\")), mdx(\"li\", {\n parentName: \"ul\"\n }, mdx(\"p\", {\n parentName: \"li\"\n }, mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"create-react-app\"), \" - react-map-gl is compatible with \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/facebook/create-react-app\"\n }, \"create-react-app\"), \".\")), mdx(\"li\", {\n parentName: \"ul\"\n }, mdx(\"p\", {\n parentName: \"li\"\n }, mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"create-react-app-typescript\"), \" - react-map-gl is compatible with \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/wmonk/create-react-app-typescript\"\n }, \"create-react-app-typescript\"), \". You can see an example \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/zackhsi/react-map-gl-typescript\"\n }, \"here\"), \".\"))), mdx(\"p\", null, \"There's many other ready-to-run \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/visgl/react-map-gl/tree/6.1-release/examples\"\n }, \"examples\"), \" you can take a look at if you need more inspiration.\"), mdx(\"h2\", {\n \"id\": \"using-with-a-mapbox-gl-fork\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#using-with-a-mapbox-gl-fork\",\n \"aria-label\": \"using with a mapbox gl fork permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Using with a mapbox-gl Fork\"), mdx(\"p\", null, \"Install your choice of fork along with react-map-gl, for example:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"bash\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-bash\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-bash\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"npm\"), \" i react-map-gl maplibre-gl\"))), mdx(\"p\", null, \"In your bundler's configuration, set the forked library to replace any reference from mapbox-gl. This can be done in Webpack with something like:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// webpack.config.js\"), \"\\nmodule\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), \"export \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// ...\"), \"\\n resolve\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n alias\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'mapbox-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'maplibre-gl'\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\")))), mdx(\"p\", null, \"In rollup:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// rollup.config.js\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" alias \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'@rollup/plugin-alias'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\nmodule\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), \"exports \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// ...\"), \"\\n plugins\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"[\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"alias\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n entries\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"[\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \" find\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'mapbox-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \" replacement\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'maplibre-gl'\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"]\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"]\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\")))));\n}\n;\nMDXContent.isMDXComponent = true;","timeToRead":1,"excerpt":"Get Started Installation Using react-map-gl requires node >= v4 and react >= 16.3 . Example See full project setup in get-started…","frontmatter":{"title":"Get Started"}}},"pageContext":{"relativeLinks":{"docs":"/docs","../../../docs":"/docs","docs/advanced/custom-components":"/docs/advanced/custom-components","../../advanced/custom-components":"/docs/advanced/custom-components","docs/advanced/custom-map-controller":"/docs/advanced/custom-map-controller","../../advanced/custom-map-controller":"/docs/advanced/custom-map-controller","docs/advanced/viewport-transition":"/docs/advanced/viewport-transition","../../advanced/viewport-transition":"/docs/advanced/viewport-transition","docs/api-reference/attribution-control":"/docs/api-reference/attribution-control","../../api-reference/attribution-control":"/docs/api-reference/attribution-control","docs/api-reference/canvas-overlay":"/docs/api-reference/canvas-overlay","../../api-reference/canvas-overlay":"/docs/api-reference/canvas-overlay","docs/api-reference/fly-to-interpolator":"/docs/api-reference/fly-to-interpolator","../../api-reference/fly-to-interpolator":"/docs/api-reference/fly-to-interpolator","docs/api-reference/fullscreen-control":"/docs/api-reference/fullscreen-control","../../api-reference/fullscreen-control":"/docs/api-reference/fullscreen-control","docs/api-reference/geolocate-control":"/docs/api-reference/geolocate-control","../../api-reference/geolocate-control":"/docs/api-reference/geolocate-control","docs/api-reference/html-overlay":"/docs/api-reference/html-overlay","../../api-reference/html-overlay":"/docs/api-reference/html-overlay","docs/api-reference/interactive-map":"/docs/api-reference/interactive-map","../../api-reference/interactive-map":"/docs/api-reference/interactive-map","docs/api-reference/layer":"/docs/api-reference/layer","../../api-reference/layer":"/docs/api-reference/layer","docs/api-reference/linear-interpolator":"/docs/api-reference/linear-interpolator","../../api-reference/linear-interpolator":"/docs/api-reference/linear-interpolator","docs/api-reference/map-context":"/docs/api-reference/map-context","../../api-reference/map-context":"/docs/api-reference/map-context","docs/api-reference/map-controller":"/docs/api-reference/map-controller","../../api-reference/map-controller":"/docs/api-reference/map-controller","docs/api-reference/marker":"/docs/api-reference/marker","../../api-reference/marker":"/docs/api-reference/marker","docs/api-reference/navigation-control":"/docs/api-reference/navigation-control","../../api-reference/navigation-control":"/docs/api-reference/navigation-control","docs/api-reference/pointer-event":"/docs/api-reference/pointer-event","../../api-reference/pointer-event":"/docs/api-reference/pointer-event","docs/api-reference/popup":"/docs/api-reference/popup","../../api-reference/popup":"/docs/api-reference/popup","docs/api-reference/scale-control":"/docs/api-reference/scale-control","../../api-reference/scale-control":"/docs/api-reference/scale-control","docs/api-reference/source":"/docs/api-reference/source","../../api-reference/source":"/docs/api-reference/source","docs/api-reference/static-map":"/docs/api-reference/static-map","../../api-reference/static-map":"/docs/api-reference/static-map","docs/api-reference/svg-overlay":"/docs/api-reference/svg-overlay","../../api-reference/svg-overlay":"/docs/api-reference/svg-overlay","docs/api-reference/web-mercator-viewport":"/docs/api-reference/web-mercator-viewport","../../api-reference/web-mercator-viewport":"/docs/api-reference/web-mercator-viewport","docs/contributing":"/docs/contributing","../../contributing":"/docs/contributing","docs/upgrade-guide":"/docs/upgrade-guide","../../upgrade-guide":"/docs/upgrade-guide","docs/whats-new":"/docs/whats-new","../../whats-new":"/docs/whats-new","docs/get-started/adding-custom-data":"/docs/get-started/adding-custom-data","../adding-custom-data":"/docs/get-started/adding-custom-data","docs/get-started/faq":"/docs/get-started/faq","../faq":"/docs/get-started/faq","docs/get-started/get-started":"/docs/get-started/get-started","../get-started":"/docs/get-started/get-started","docs/get-started/mapbox-tokens":"/docs/get-started/mapbox-tokens","../mapbox-tokens":"/docs/get-started/mapbox-tokens","docs/get-started/state-management":"/docs/get-started/state-management","../state-management":"/docs/get-started/state-management"},"title":"Get Started","slug":"docs/get-started/get-started","toc":"docs"}},"staticQueryHashes":["484347790"]} \ No newline at end of file +{"componentChunkName":"component---node-modules-gatsby-theme-ocular-src-react-templates-documentation-jsx","path":"/docs/get-started/get-started","result":{"data":{"docBySlug":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {};\nvar layoutProps = {\n _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n var components = _ref.components,\n props = _objectWithoutProperties(_ref, [\"components\"]);\n\n return mdx(MDXLayout, _extends({}, layoutProps, props, {\n components: components,\n mdxType: \"MDXLayout\"\n }), mdx(\"h1\", {\n \"id\": \"get-started\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h1\",\n \"href\": \"#get-started\",\n \"aria-label\": \"get started permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Get Started\"), mdx(\"h2\", {\n \"id\": \"installation\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#installation\",\n \"aria-label\": \"installation permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Installation\"), mdx(\"p\", null, \"Using \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"react-map-gl\"), \" requires \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"node >= v4\"), \" and \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"react >= 16.3\"), \".\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"sh\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-sh\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-sh\"\n }, \"npm install --save react-map-gl\"))), mdx(\"h2\", {\n \"id\": \"example\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#example\",\n \"aria-label\": \"example permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Example\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"*\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"as\"), \" React \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \" useState \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" ReactMapGL \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'react-map-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"function\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"Map\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"const\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"[\"), \"viewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \" setViewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"]\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"useState\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n width\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"400\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n height\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"400\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n latitude\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"37.7577\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n longitude\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"-\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"122.4376\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n zoom\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token number\"\n }, \"8\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"return\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"<\"), \"ReactMapGL\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"...\"), \"viewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n onViewportChange\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token parameter\"\n }, \"nextViewport\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=>\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"setViewport\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), \"nextViewport\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"/\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \">\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\")))), mdx(\"p\", null, \"See full project setup in \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/visgl/react-map-gl/tree/6.1-release/examples/get-started\"\n }, \"get-started examples\")), mdx(\"h2\", {\n \"id\": \"styling\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#styling\",\n \"aria-label\": \"styling permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Styling\"), mdx(\"p\", null, \"The current mapbox-gl release requires its stylesheet be included at all times. The marker, popup and navigation components in react-map-gl also need the stylesheet to work properly.\"), mdx(\"p\", null, \"You may add the stylesheet to the head of your page:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"html\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-html\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-html\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token tag\"\n }, mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token tag\"\n }, mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"<\"), \"link\"), \" \", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token attr-name\"\n }, \"href\"), mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token attr-value\"\n }, mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation attr-equals\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"'\"), \"https://api.tiles.mapbox.com/mapbox-gl-js/v/mapbox-gl.css\", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"'\")), \" \", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token attr-name\"\n }, \"rel\"), mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token attr-value\"\n }, mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation attr-equals\"\n }, \"=\"), mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"'\"), \"stylesheet\", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"'\")), \" \", mdx(\"span\", {\n parentName: \"span\",\n \"className\": \"token punctuation\"\n }, \"/>\"))))), mdx(\"p\", null, \"Find out your mapbox version by running \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"yarn list mapbox-gl\"), \" or \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"npm ls mapbox-gl\"), \".\"), mdx(\"p\", null, \"Or embed it in your app by using - \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://www.npmjs.com/package/browserify-css\"\n }, \"browserify-css\"), \"\\nwith Browserify or - \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://webpack.github.io/docs/stylesheets.html\"\n }, \"css-loader\"), \" with Webpack:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// app.js\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'mapbox-gl/dist/mapbox-gl.css'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\")))), mdx(\"h2\", {\n \"id\": \"using-with-browserify-webpack-and-other-javascript-bundlers\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#using-with-browserify-webpack-and-other-javascript-bundlers\",\n \"aria-label\": \"using with browserify webpack and other javascript bundlers permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Using with Browserify, Webpack, and other JavaScript Bundlers\"), mdx(\"ul\", null, mdx(\"li\", {\n parentName: \"ul\"\n }, mdx(\"p\", {\n parentName: \"li\"\n }, mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"browserify\"), \" - react-map-gl is extensively tested with \", mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"browserify\"), \" and works without configuration.\")), mdx(\"li\", {\n parentName: \"ul\"\n }, mdx(\"p\", {\n parentName: \"li\"\n }, mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"webpack\"), \" - Most of the provided react-map-gl examples use webpack. Look at the \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/visgl/react-map-gl/tree/6.1-release/examples/get-started\"\n }, \"get started examples\"), \" folder for minimalist templates.\")), mdx(\"li\", {\n parentName: \"ul\"\n }, mdx(\"p\", {\n parentName: \"li\"\n }, mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"create-react-app\"), \" - react-map-gl is compatible with \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/facebook/create-react-app\"\n }, \"create-react-app\"), \".\")), mdx(\"li\", {\n parentName: \"ul\"\n }, mdx(\"p\", {\n parentName: \"li\"\n }, mdx(\"code\", {\n parentName: \"p\",\n \"className\": \"language-text\"\n }, \"create-react-app-typescript\"), \" - react-map-gl is compatible with \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/wmonk/create-react-app-typescript\"\n }, \"create-react-app-typescript\"), \". You can see an example \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/zackhsi/react-map-gl-typescript\"\n }, \"here\"), \".\"))), mdx(\"p\", null, \"There's many other ready-to-run \", mdx(\"a\", {\n parentName: \"p\",\n \"href\": \"https://github.com/visgl/react-map-gl/tree/6.1-release/examples\"\n }, \"examples\"), \" you can take a look at if you need more inspiration.\"), mdx(\"h2\", {\n \"id\": \"using-with-a-mapbox-gl-fork\",\n \"style\": {\n \"position\": \"relative\"\n }\n }, mdx(\"a\", {\n parentName: \"h2\",\n \"href\": \"#using-with-a-mapbox-gl-fork\",\n \"aria-label\": \"using with a mapbox gl fork permalink\",\n \"className\": \"anchor before\"\n }, mdx(\"svg\", {\n parentName: \"a\",\n \"aria-hidden\": \"true\",\n \"focusable\": \"false\",\n \"height\": \"16\",\n \"version\": \"1.1\",\n \"viewBox\": \"0 0 16 16\",\n \"width\": \"16\"\n }, mdx(\"path\", {\n parentName: \"svg\",\n \"fillRule\": \"evenodd\",\n \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n }))), \"Using with a mapbox-gl Fork\"), mdx(\"p\", null, \"Install your choice of fork along with react-map-gl, for example:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"bash\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-bash\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-bash\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"npm\"), \" i react-map-gl maplibre-gl\"))), mdx(\"p\", null, \"In your bundler's configuration, set the forked library to replace any reference from mapbox-gl. This can be done in Webpack with something like:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// webpack.config.js\"), \"\\nmodule\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), \"export \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// ...\"), \"\\n resolve\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n alias\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'mapbox-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'maplibre-gl'\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\")))), mdx(\"p\", null, \"In rollup:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// rollup.config.js\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"import\"), \" alias \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"from\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'@rollup/plugin-alias'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n\\nmodule\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), \"exports \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// ...\"), \"\\n plugins\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"[\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function\"\n }, \"alias\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n entries\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"[\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \" find\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'mapbox-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \" replacement\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'maplibre-gl'\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"]\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"]\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\")))), mdx(\"p\", null, \"In Next.js:\"), mdx(\"div\", {\n \"className\": \"gatsby-highlight\",\n \"data-language\": \"js\"\n }, mdx(\"pre\", {\n parentName: \"div\",\n \"className\": \"language-js\"\n }, mdx(\"code\", {\n parentName: \"pre\",\n \"className\": \"language-js\"\n }, mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// next.config.js\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token keyword\"\n }, \"const\"), \" nextConfig \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// ...\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token function-variable function\"\n }, \"webpack\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"(\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token parameter\"\n }, \"config\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \")\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=>\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n config\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), \"resolve\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), \"alias \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"=\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"{\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \"...\"), \"config\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), \"resolve\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \".\"), \"alias\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'mapbox-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token operator\"\n }, \":\"), \" \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token string\"\n }, \"'maplibre-gl'\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \",\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token comment\"\n }, \"// ...\"), \"\\n \", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), \"\\n\", mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \"}\"), mdx(\"span\", {\n parentName: \"code\",\n \"className\": \"token punctuation\"\n }, \";\")))));\n}\n;\nMDXContent.isMDXComponent = true;","timeToRead":1,"excerpt":"Get Started Installation Using react-map-gl requires node >= v4 and react >= 16.3 . Example See full project setup in get-started…","frontmatter":{"title":"Get Started"}}},"pageContext":{"relativeLinks":{"docs":"/docs","../../../docs":"/docs","docs/advanced/custom-components":"/docs/advanced/custom-components","../../advanced/custom-components":"/docs/advanced/custom-components","docs/advanced/custom-map-controller":"/docs/advanced/custom-map-controller","../../advanced/custom-map-controller":"/docs/advanced/custom-map-controller","docs/advanced/viewport-transition":"/docs/advanced/viewport-transition","../../advanced/viewport-transition":"/docs/advanced/viewport-transition","docs/api-reference/attribution-control":"/docs/api-reference/attribution-control","../../api-reference/attribution-control":"/docs/api-reference/attribution-control","docs/api-reference/canvas-overlay":"/docs/api-reference/canvas-overlay","../../api-reference/canvas-overlay":"/docs/api-reference/canvas-overlay","docs/api-reference/fly-to-interpolator":"/docs/api-reference/fly-to-interpolator","../../api-reference/fly-to-interpolator":"/docs/api-reference/fly-to-interpolator","docs/api-reference/fullscreen-control":"/docs/api-reference/fullscreen-control","../../api-reference/fullscreen-control":"/docs/api-reference/fullscreen-control","docs/api-reference/geolocate-control":"/docs/api-reference/geolocate-control","../../api-reference/geolocate-control":"/docs/api-reference/geolocate-control","docs/api-reference/html-overlay":"/docs/api-reference/html-overlay","../../api-reference/html-overlay":"/docs/api-reference/html-overlay","docs/api-reference/interactive-map":"/docs/api-reference/interactive-map","../../api-reference/interactive-map":"/docs/api-reference/interactive-map","docs/api-reference/layer":"/docs/api-reference/layer","../../api-reference/layer":"/docs/api-reference/layer","docs/api-reference/linear-interpolator":"/docs/api-reference/linear-interpolator","../../api-reference/linear-interpolator":"/docs/api-reference/linear-interpolator","docs/api-reference/map-context":"/docs/api-reference/map-context","../../api-reference/map-context":"/docs/api-reference/map-context","docs/api-reference/map-controller":"/docs/api-reference/map-controller","../../api-reference/map-controller":"/docs/api-reference/map-controller","docs/api-reference/marker":"/docs/api-reference/marker","../../api-reference/marker":"/docs/api-reference/marker","docs/api-reference/navigation-control":"/docs/api-reference/navigation-control","../../api-reference/navigation-control":"/docs/api-reference/navigation-control","docs/api-reference/pointer-event":"/docs/api-reference/pointer-event","../../api-reference/pointer-event":"/docs/api-reference/pointer-event","docs/api-reference/popup":"/docs/api-reference/popup","../../api-reference/popup":"/docs/api-reference/popup","docs/api-reference/scale-control":"/docs/api-reference/scale-control","../../api-reference/scale-control":"/docs/api-reference/scale-control","docs/api-reference/source":"/docs/api-reference/source","../../api-reference/source":"/docs/api-reference/source","docs/api-reference/static-map":"/docs/api-reference/static-map","../../api-reference/static-map":"/docs/api-reference/static-map","docs/api-reference/svg-overlay":"/docs/api-reference/svg-overlay","../../api-reference/svg-overlay":"/docs/api-reference/svg-overlay","docs/api-reference/web-mercator-viewport":"/docs/api-reference/web-mercator-viewport","../../api-reference/web-mercator-viewport":"/docs/api-reference/web-mercator-viewport","docs/contributing":"/docs/contributing","../../contributing":"/docs/contributing","docs/upgrade-guide":"/docs/upgrade-guide","../../upgrade-guide":"/docs/upgrade-guide","docs/whats-new":"/docs/whats-new","../../whats-new":"/docs/whats-new","docs/get-started/adding-custom-data":"/docs/get-started/adding-custom-data","../adding-custom-data":"/docs/get-started/adding-custom-data","docs/get-started/faq":"/docs/get-started/faq","../faq":"/docs/get-started/faq","docs/get-started/get-started":"/docs/get-started/get-started","../get-started":"/docs/get-started/get-started","docs/get-started/mapbox-tokens":"/docs/get-started/mapbox-tokens","../mapbox-tokens":"/docs/get-started/mapbox-tokens","docs/get-started/state-management":"/docs/get-started/state-management","../state-management":"/docs/get-started/state-management"},"title":"Get Started","slug":"docs/get-started/get-started","toc":"docs"}},"staticQueryHashes":["484347790"]} \ No newline at end of file diff --git a/page-data/search/page-data.json b/page-data/search/page-data.json index 6e77906e..6e4fb4f6 100644 --- a/page-data/search/page-data.json +++ b/page-data/search/page-data.json @@ -1 +1 @@ -{"componentChunkName":"component---node-modules-gatsby-theme-ocular-src-react-templates-search-jsx","path":"/search","result":{"pageContext":{"data":[{"excerpt":"Introduction react-map-gl is a suite of React components for\nMapbox GL JS-compatible libraries. Library Description MapLibre An open fork of mapbox-gl v1, that can be used without a mapbox token. Mapbox GL JS v1 The previous version of mapbox GL JS. This version is free open source and can be used with non-mapbox basemaps without a mapbox token. Mapbox GL JS v2 The latest version of Mapbox GL JS. Note that version 2 is not free open source, and a mapbox token is required and billable events are generated even if you do not use mapbox hosted basemaps. Other mapbox-gl forks It may be possible to use react-map-gl with other mapbox forks, but this is not a supported use case. Minor PRs to enable other forks to be used may be accepted. For basemaps: You can load map data from Mapbox's own service. You can create and host your own map data using one of the many open source tools . New to react-map-gl? Get Started Want to contribute? See our Developer Guide Design Philosophy At Uber, we make powerful web tools that contain maps. To manage the complexity of our applications, we fully embrace React and reactive programming. The stock mapbox-gl APIs are imperative . That is, you instruct the map to do something (for example, map.flyTo ), and it will execute the command at its own pace. This does not scale when we have many components that need to synchronize with each other. One use case we have is to render two maps side by side, and when the user interacts with one, update both cameras. We draw UI on top of the map using React, pinned to a given geolocation. We also render visualization layers on top of the map using WebGL, most notably with deck.gl . The mapbox maps, the deck.gl canvas, and React controls' render cycles are all asynchronous. If we listen to the move event in the map and tell the other components to update, the other components would always be one frame behind. Ultimately, in the spirit of the reactive programming paradigm , data always flows down . In a complex application, any user input or data fetch can affect the rendering of many components. We might store the source of truth in a parent component state, or Redux store, or hooks, and let it propagate down to the map as well as its peers. As long as the map manages its own state, as mapbox-gl is designed to do, we risk the components going out of sync. react-map-gl creates a fully reactive wrapper for mapbox-gl. The InteractiveMap component is stateless. To move the map camera in anyway, the application must update the component's props. The application can also be confident that the map's camera would never deviate from the props that it's assigned. At first glance, its API may seem verbose to those who come from the imperative world of mapbox-gl. However, it is essential for the correctness of large applications. Limitations This library provides convenient wrappers around initializing and (to some degree) tracking the state of a Mapbox WebGL map. Because most of the functionality of Mapbox's JS API depends on the use of HTML5 canvases and WebGL, which React is not built to manipulate, the React component does not mirror all the functionality of Mapbox GL JS's Map class. You may access the native Mapbox API exposed by the getMap() function in this library. However, proceed with caution as calling the native APIs may break the connection between the React layer props and the underlying map state. Examples of replacing common native API calls with their React equivalents can be found on the FAQ page.","headings":[{"value":"Introduction","depth":1},{"value":"Design Philosophy","depth":2},{"value":"Limitations","depth":2}],"slug":"docs","title":"Introduction"},{"excerpt":"Custom Components You may create your own map control components by consuming MapContext . Using the MapContext The following component renders a label \"(longitude, latitude)\" at the given coordinate: Using the useMapControl hook useMapControl is an experimental API that makes it easier to create controls with event handling. Calling useMapControl(opts) returns an object containing the following fields: context (MapContext) - the current context value containerRef (RefObject) - this should be assigned to the ref prop of the DOM element that the event listeners should attach to. This hook supports the following options: onScroll (Function) - called on mouse wheel event. Can be used to stop map from zooming when this component is scrolled. onDragStart (Function) - called on dragstart event. Can be used to stop map from panning when this component is dragged. onClick (Function) - called on click event. Can be used to stop map from calling the onClick callback when this component is clicked. onDoubleClick (Function) - called on double click event. Can be used to stop map from zooming when this component is double clicked. onPointerMove (Function) - called on pointermove event. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.","headings":[{"value":"Custom Components","depth":1},{"value":"Using the MapContext","depth":2},{"value":"Using the useMapControl hook","depth":2}],"slug":"docs/advanced/custom-components","title":"Custom Components"},{"excerpt":"Custom Map Controller Overriding The Default Map Controller To change the default behavior of map interaction, you can provide a custom map control to the controller prop of InteractiveMap . This custom map control must offer the following interface: setOptions(options) - called by InteractiveMap when props change. Documentation of the MapController class . Examples A simple example to swap drag pan and drag rotate: Overwrite existing event handling: Listen to additional events: Add a custom callback:","headings":[{"value":"Custom Map Controller","depth":1},{"value":"Overriding The Default Map Controller","depth":2},{"value":"Examples","depth":2}],"slug":"docs/advanced/custom-map-controller","title":"Custom Map Controller"},{"excerpt":"Viewport Transition react-map-gl does not expose the transition API from mapbox-gl-js since it is designed to be a stateless component, and needs to synchronize with separate overlay systems such as deck.gl. Instead, transitions can be defined using InteractiveMap 's transition props. Example: Fly to a New Location See viewport animation for a complete example. Example: Transition Viewport To A Bounding Box You can use the WebMercatorViewport utility to find the target viewport that fits around a lngLat bounding box: Documentation of WebMercatorViewport Controlling Map Transitions InteractiveMap's Transition Props See properties of InteractiveMap . transitionDuration (Number) transitionInterpolator (Object) transitionEasing (Function) transitionInterruption (Number) onTransitionStart (Function) onTransitionInterrupt (Function) onTransitionEnd (Function) Transition and the onViewportChange Callback InteractiveMap is designed to be a stateless component. For transitions to work, the application must update the viewport props returned by the onViewportChange callback: Remarks: The props returned by the callback may contain transition properties. For example, during panning and rotating, the callback is invoked with transitionDuration: 0 , meaning that the map movement instantly matches the change of the pointer. When panning or zooming with keyboard, the callback is invoked with a 300ms linear transition. It is recommended that when programatically triggering a transition, always explicitly set the transition properties (interpolator, easing and duration). \"Set and forget\": the values of the following props at the start of a transition carry through the entire duration of the transition: transitionDuration transitionInterpolator transitionEasing transitionInterruption The default interaction/transition behavior can always be intercepted and overwritten in the handler for onViewportChange . However, if a transition is in progress, the properties that are being transitioned (e.g. longitude and latitude) should not be manipulated, otherwise the change will be interpreted as an interruption of the transition. When using FlyToInterpolator for transitionInterpolator , transitionDuration can be set to 'auto' where actual duration is auto calculated based on start and end viewports and is linear to the distance between them. This duration can be further customized using speed parameter to FlyToInterpolator constructor. Transition Interpolators A TransitionInterpolator instance must be supplied to the transitionInterpolator prop. It contains the following methods: arePropsEqual(currentProps, nextProps) - called to determine if transition should be triggered when viewport props update. initiateProps(startProps, endProps) - called before transition starts to pre-process the start and end viewport props. interpolateProps(startProps, endProps, t) - called to get viewport props in transition. t is a time factor between [0, 1] . react-map-gl offers two built-in interpolator classes: LinearInterpolator FlyToInterpolator","headings":[{"value":"Viewport Transition","depth":1},{"value":"Example: Fly to a New Location","depth":2},{"value":"Example: Transition Viewport To A Bounding Box","depth":2},{"value":"Controlling Map Transitions","depth":2},{"value":"InteractiveMap's Transition Props","depth":3},{"value":"Transition and the onViewportChange Callback","depth":3},{"value":"Transition Interpolators","depth":3}],"slug":"docs/advanced/viewport-transition","title":"Viewport Transition"},{"excerpt":"AttributionControl This is a React equivalent of Mapbox's AttributionControl . Properties toggleLabel (String) default: 'Toggle Attribution' Label applied to the toggle button. compact (Boolean) If true , force a compact attribution that shows the full attribution on mouse hover. If false , force the full attribution control. When undefined, shows a responsive attribution that collapses when the map is less than 640 pixels wide. customAttribution (String| String ) String or strings to show in addition to any other attributions. className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source attribution-control.js","headings":[{"value":"AttributionControl","depth":1},{"value":"Properties","depth":2},{"value":"toggleLabel (String)","depth":5},{"value":"compact (Boolean)","depth":5},{"value":"customAttribution (String|String)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/attribution-control","title":"AttributionControl"},{"excerpt":"CanvasOverlay Allows applications to overlay data on top of maps using a canvas. Properties redraw (Function) Called every time the map updates. Parameters: ctx {CanvasRenderingContext2D} - rendering context of the canvas width {Number} - width of the viewport height {Number} - height of the viewport project {Function} - get screen position [x, y] from geo coordinates [lng, lat] unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y] captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: false Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: false Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: false Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Source canvas-overlay.js","headings":[{"value":"CanvasOverlay","depth":1},{"value":"Properties","depth":2},{"value":"redraw (Function)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/canvas-overlay","title":"CanvasOverlay"},{"excerpt":"FlyToInterpolator Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap . This interpolator offers similar behavior to Mapbox's flyTo method. Constructor new FlyToInterpolator([options]) Parameters: options {Object} (optional) curve (Number, optional, default: 1.414) - The zooming \"curve\" that will occur along the flight path. speed (Number, optional, default: 1.2) - The average speed of the animation defined in relation to options.curve , it linearly affects the duration, higher speed returns smaller durations and vice versa. screenSpeed (Number, optional) - The average speed of the animation measured in screenfuls per second. Similar to opts.speed it linearly affects the duration, when specified opts.speed is ignored. maxDuration (Number, optional) - Maximum duration in milliseconds, if calculated duration exceeds this value, 0 is returned. Source viewport-fly-to-interpolator.js","headings":[{"value":"FlyToInterpolator","depth":1},{"value":"Constructor","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/fly-to-interpolator","title":"FlyToInterpolator"},{"excerpt":"FullscreenControl This is a React equivalent of Mapbox's FullscreenControl . Properties container (HTMLElement) container is the compatible DOM element which should be made full screen. By default, the map container element will be made full screen. label (String) default: Toggle fullscreen Label applied to the fullscreen control button. className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source fullscreen-control.js","headings":[{"value":"FullscreenControl","depth":1},{"value":"Properties","depth":2},{"value":"container (HTMLElement)","depth":5},{"value":"label (String)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/fullscreen-control","title":"FullscreenControl"},{"excerpt":"GeolocateControl This is a React equivalent of Mapbox's GeolocateControl . Properties Accepts all the options of Mapbox GeolocateControl . onViewportChange (Function, optional) Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing InteractiveMap 's onViewportChange . onGeolocate (Function, optional) Callback when Geolocation API position updates. It is called with a Geolocation API PositionOptions object. positionOptions (Object) default: {enableHighAccuracy: false, timeout: 6000} A Geolocation API PositionOptions object. fitBoundsOptions (Object) default: {maxZoom: 15} A fitBounds options object to use when the map is panned and zoomed to the user's location. The default is to use a maxZoom of 15 to limit how far the map will zoom in for very accurate locations. trackUserLocation (Boolean) default: false If true the Geolocate Control becomes a toggle button and when active the map will receive updates to the user's location as it changes. showUserLocation (Boolean) default: true By default a dot will be shown on the map at the user's location. Set to false to disable. showAccuracyCircle (Boolean) default: true By default, if showUserLocation is true , a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to false to disable. Always disabled when showUserLocation is false . className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. label (String) default: 'Find My Location' Label applied to the Geolocate control button. disabledLabel (String) default: 'Location Not Available' Label applied to the Geolocate control button if geolocation is disabled by the user. auto (Boolean) default: false Programmatically triggers geolocate when set to true. Initializing the component with true triggers inside componentDidMount where as changing to true at a later point triggers inside componentDidUpdate . Initally setting as or changing to false has no effect. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source geolocate-control.js","headings":[{"value":"GeolocateControl","depth":1},{"value":"Properties","depth":2},{"value":"onViewportChange (Function, optional)","depth":5},{"value":"onGeolocate (Function, optional)","depth":5},{"value":"positionOptions (Object)","depth":5},{"value":"fitBoundsOptions (Object)","depth":5},{"value":"trackUserLocation (Boolean)","depth":5},{"value":"showUserLocation (Boolean)","depth":5},{"value":"showAccuracyCircle (Boolean)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"label (String)","depth":5},{"value":"disabledLabel (String)","depth":5},{"value":"auto (Boolean)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/geolocate-control","title":"GeolocateControl"},{"excerpt":"HTMLOverlay Allows applications to overlay data on top of maps using a HTML container. Properties redraw (Function) Called every time the map updates. Parameters: width {Number} - width of the viewport height {Number} - height of the viewport project {Function} - get screen position [x, y] from geo coordinates [lng, lat] unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y] style (Object) Additional css styles of the div container. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: false Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: false Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: false Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Source html-overlay.js","headings":[{"value":"HTMLOverlay","depth":1},{"value":"Properties","depth":2},{"value":"redraw (Function)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/html-overlay","title":"HTMLOverlay"},{"excerpt":"default (InteractiveMap) This component renders MapboxGL and provides full interactivity support.\nIt uses StaticMap underneath to render the final map component.\nThis is the default exported component from react-map-gl . Properties Initialization Inherit the following props from StaticMap : attributionControl (Boolean) disableTokenWarning (Boolean) gl (WebGLContext) mapboxApiAccessToken (String) mapboxApiUrl (String) mapOptions (Object) preserveDrawingBuffer (Boolean) preventStyleDiffing (Boolean) reuseMaps (Boolean) transformRequest (Function) Map State Inherit the following props from StaticMap : mapStyle (String | Object | Immutable.Map) width (Number | String) height (Number | String) latitude (Number) longitude (Number) zoom (Number) bearing (Number) pitch (Number) altitude (Number) viewState (Object) Render Options Inherit the following props from StaticMap : style (Object) visible (Boolean) visibilityConstraints (Object) getCursor (Function) Accessor that returns a cursor style to show interactive state. Called when the component is being rendered. Parameters state - The current state of the component. state.isDragging - If the map is being dragged. state.isHovering - If the pointer is over an interactive feature. See interactiveLayerIds prop. The default implementation of getCursor returns 'pointer' if isHovering , 'grabbing' if isDragging and 'grab' otherwise. Interaction Options maxZoom (Number) default: 20 Max zoom level. minZoom (Number) default: 0 Min zoom level. maxPitch (Number) default: 85 Max pitch in degrees. minPitch (Number) default: 0 Min pitch in degrees. scrollZoom (Boolean|Object) default: true Enable scroll to zoom. If an object is provided, may contain the following options to customize the scroll zoom behavior: speed (Number) - Multiplier for the wheel delta. Default 0.01 . smooth (Boolean) - Smoothly transition to the new zoom. If enabled, will provide a slightly lagged but smoother experience. Default false . dragPan (Boolean|Object) default: true Enable drag to pan. If an object is provided, may contain the following options to customize its behavior: inertia (Number) - Enable momentum/inertia when the gesture ends. The value specifies after how long the panning comes to a stop, in milliseconds. Default 300 . dragRotate (Boolean) default: true Enable drag to rotate. If an object is provided, may contain the following options to customize its behavior: inertia (Number) - Enable momentum/inertia when the gesture ends. The value specifies after how long the rotation comes to a stop, in milliseconds. Default 300 . doubleClickZoom (Boolean) default: true Enable double click to zoom. touchZoom (Boolean|Object) default: true Enable multitouch zoom. If an object is provided, may contain the following options to customize its behavior: inertia (Number) - Enable momentum/inertia when the gesture ends. The value specifies after how long the zooming comes to a stop, in milliseconds. Default 300 . touchRotate (Boolean|Object) default: false Enable multitouch rotate, including two-finger rotation to change bearing and three-finger swipe to change pitch. If an object is provided, may contain the following options to customize its behavior: inertia (Number) - Enable momentum/inertia when the gesture ends. The value specifies after how long the rotation comes to a stop, in milliseconds. Default 300 . keyboard (Boolean|Object) default: true Enable keyboard navigation. If an object is provided, may contain the following options to customize its behavior: zoomSpeed (Number) - speed of zoom using +/- keys. Default 2 . moveSpeed (Number) - speed of movement using arrow keys, in pixels. rotateSpeedX (Number) - speed of rotation using shift + left/right arrow keys, in degrees. Default 15 . rotateSpeedY (Number) - speed of rotation using shift + up/down arrow keys, in degrees. Default 10 . touchAction (String) default: 'none' Allow browser default touch actions. Default none . See hammer.js doc . By default, the map captures all touch interactions. This prop is useful for mobile applications to unblock default scrolling behavior. For example, use the combination dragPan: false and touchAction: 'pan-y' to allow vertical page scroll when dragging over the map. eventRecognizerOptions (Object) default: {} Set options for gesture recognition. My contain the following fields: pan - an object that is Hammer.Pan options. This gesture is used for drag events. pinch - an object that is Hammer.Pinch options This gesture is used for two-finger touch events. tripan - an object that is Hammer.Pan options. This gesture is used for three-finger touch events. tap - an object that is Hammer.Tap options. This gesture is used for the onClick callback. anytap - an object that is Hammer.Tap options. This gesture is used for the onNativeClick callback. doubletap - an object that is Hammer.Tap options. This gesture is used for double click events. For example, the following setting makes panning less sensitive and clicking easier on mobile: Note that the value of this prop is used once when the component mounts. Subsequent changes will be ignored. clickRadius (Number) default: 0 Radius to detect features around a clicked point. controller (Object) A map controller instance to replace the default map controller. This object must implement the following interface: events - An array of subscribed events handleEvent(event, context) - A method that handles interactive events interactiveLayerIds (Array) default: null A list of layer ids that are interactive. If specified: Pointer event callbacks will only query the features under the pointer of these layers. The getCursor callback will receive isHovering: true when hover over features of these layers. If not specified: Pointer event callbacks will query the features under the pointer of all layers. The getCursor callback will always receive isHovering: false . Transitions transitionDuration (Number) default: 0 Duration of transition in milliseconds. If specified, the map's viewport will smoothly move from the previous props to the current one. transitionInterpolator (Object) default: new LinearInterpolator() An interpolator object that defines the transition behavior between two map states. react-map-gl offers two interpolators: LinearInterpolator - similar to Mapbox's easeTo behavior. FlyToInterpolator - similar to Mapbox's flyTo behavior. You may import them as follows: For details about using transition interpolators, see transitions . transitionEasing (Function) default: t => t Easing function that maps a value from [0, 1] to [0, 1] . Check out http://easings.net/ for common easing curves. transitionInterruption (Number) default: TRANSITION_EVENTS.BREAK What to do if an ongoing transition is interrupted by another transition. There are 4 options: TRANSITION_EVENTS.BREAK - Start new transition from the current view. TRANSITION_EVENTS.SNAP_TO_END - Jump to the end of the previous transition before starting the new transition. TRANSITION_EVENTS.IGNORE - Complete the previous transition and ignore the new viewport change. TRANSITION_EVENTS.UPDATE - Continue the ongoing transition but change its destination to the new viewport. You may import the constants as follows: Callbacks Inherit the following props from StaticMap : onLoad (Function) onResize (Function) onError (Function) onViewportChange (Function) Callback that is fired when the map's viewport properties should be updated. If not supplied, the map is not interactive. Arguments: viewState (Object) The next viewport properties, including: width , height , latitude , longitude , zoom , bearing , pitch , altitude , maxZoom , minZoom , maxPitch , minPitch , transitionDuration , transitionEasing , transitionInterpolator , transitionInterruption . interactionState (Object) The current interaction that caused this viewport change. See onInteractionStateChange for possible fields. oldViewState (Object) The current viewport properties. onViewStateChange (Function) A newer version of the onViewportChange callback. Both are supported and provide equivalent functionality. onInteractionStateChange (Function) Callback that is fired when the user interacted with the map. Possible fields include: interactionState.inTransition (Boolean) interactionState.isDragging (Boolean) interactionState.isPanning (Boolean) interactionState.isRotating (Boolean) interactionState.isZooming (Boolean) Note: onInteractionStateChange may be fired without onViewportChange . For example, when the pointer is released at the end of a drag-pan, isDragging are reset to false , without the viewport's longitude and latitude changing. onHover (Function) Called when the mouse moves over the map (without button pressed). Receives a PointerEvent object. onClick (Function) Called when the map is single clicked. Receives a PointerEvent object. This event is not fired on double click therefore there may be a delay between pointer up and the event. onNativeClick (Function) Called when the map is clicked. Receives a PointerEvent object. This event is fired twice on double click. onDblClick (Function) Called when the map is double clicked. Receives a PointerEvent object. onMouseDown (Function) Called when a pointing device (usually a mouse) is pressed within the map. Receives a PointerEvent object. onMouseMove (Function) Called when a pointing device (usually a mouse) is moved within the map. Receives a PointerEvent object. onMouseUp (Function) Called when a pointing device (usually a mouse) is released within the map. Receives a PointerEvent object. onTouchStart (Function) Called when a touchstart event occurs within the map. Receives a PointerEvent object. onTouchMove (Function) Called when a touchmove event occurs within the map. Receives a PointerEvent object. onTouchEnd (Function) Called when a touchend event occurs within the map. Receives a PointerEvent object. onMouseEnter (Function) Called when a pointing device (usually a mouse) enters a visible portion of one of the interactive layers, defined by the interactiveLayerIds prop. Receives a PointerEvent object. onMouseLeave (Function) Called when a pointing device (usually a mouse) leaves a visible portion of one of the interactive layers, defined by the interactiveLayerIds prop. Receives a PointerEvent object. onWheel (Function) Called when a wheel event occurs within the map. Receives a PointerEvent object. onMouseOut (Function) Called when a point device (usually a mouse) leaves the map's canvas. Receives a PointerEvent object. onContextMenu (Function) Called when the context menu is activated. Prevent default here to enable right button interaction. Default: event => event.preventDefault() onTransitionStart (Function) Callback that is fired when a transition is triggered. onTransitionInterrupt (Function) Callback that is fired when an ongoing transition is interrupted by another transition. onTransitionEnd (Function) Callback that is fired when a transition is complete. Methods Inherit the following methods from StaticMap : getMap() queryRenderedFeatures(geometry, parameters) Source interactive-map.js","headings":[{"value":"default (InteractiveMap)","depth":1},{"value":"Properties","depth":2},{"value":"Initialization","depth":3},{"value":"Map State","depth":3},{"value":"Render Options","depth":3},{"value":"getCursor (Function)","depth":5},{"value":"Interaction Options","depth":3},{"value":"maxZoom (Number)","depth":5},{"value":"minZoom (Number)","depth":5},{"value":"maxPitch (Number)","depth":5},{"value":"minPitch (Number)","depth":5},{"value":"scrollZoom (Boolean|Object)","depth":5},{"value":"dragPan (Boolean|Object)","depth":5},{"value":"dragRotate (Boolean)","depth":5},{"value":"doubleClickZoom (Boolean)","depth":5},{"value":"touchZoom (Boolean|Object)","depth":5},{"value":"touchRotate (Boolean|Object)","depth":5},{"value":"keyboard (Boolean|Object)","depth":5},{"value":"touchAction (String)","depth":5},{"value":"eventRecognizerOptions (Object)","depth":5},{"value":"clickRadius (Number)","depth":5},{"value":"controller (Object)","depth":5},{"value":"interactiveLayerIds (Array)","depth":5},{"value":"Transitions","depth":3},{"value":"transitionDuration (Number)","depth":5},{"value":"transitionInterpolator (Object)","depth":5},{"value":"transitionEasing (Function)","depth":5},{"value":"transitionInterruption (Number)","depth":5},{"value":"Callbacks","depth":3},{"value":"onViewportChange (Function)","depth":5},{"value":"onViewStateChange (Function)","depth":5},{"value":"onInteractionStateChange (Function)","depth":5},{"value":"onHover (Function)","depth":5},{"value":"onClick (Function)","depth":5},{"value":"onNativeClick (Function)","depth":5},{"value":"onDblClick (Function)","depth":5},{"value":"onMouseDown (Function)","depth":5},{"value":"onMouseMove (Function)","depth":5},{"value":"onMouseUp (Function)","depth":5},{"value":"onTouchStart (Function)","depth":5},{"value":"onTouchMove (Function)","depth":5},{"value":"onTouchEnd (Function)","depth":5},{"value":"onMouseEnter (Function)","depth":5},{"value":"onMouseLeave (Function)","depth":5},{"value":"onWheel (Function)","depth":5},{"value":"onMouseOut (Function)","depth":5},{"value":"onContextMenu (Function)","depth":5},{"value":"onTransitionStart (Function)","depth":5},{"value":"onTransitionInterrupt (Function)","depth":5},{"value":"onTransitionEnd (Function)","depth":5},{"value":"Methods","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/interactive-map","title":"default (InteractiveMap)"},{"excerpt":"Layer This component allows apps to create a map layer using React. Properties The props provided to this component should be conforming to the Mapbox layer specification . When props change shallowly , the component will perform style diffing to update the layer. Avoid defining constant objects/arrays inline may help performance. Identity Properties Once a is mounted, the following props should not change. If you add/remove multiple JSX layers dynamically, make sure you use React's key prop to give each element a stable identity. id (String) Unique identifier of the layer. If not provided, a default id will be assigned. type (String, required) Type of the layer. Options beforeId (String) The ID of an existing layer to insert this layer before. If this prop is omitted, the layer will be appended to the end of the layers array. This is useful when using dynamic layers with a map style from a URL. Note that layers are added by the order that they mount. They are NOT reordered later if their relative positions in the JSX tree change. If dynamic reordering is desired, you should manipulate beforeId for consistent behavior. source (String) source is required by some layer types in the Mapbox style specification. If is used as the child of a Source component, this prop will be overwritten by the id of the parent source. Source layer.js","headings":[{"value":"Layer","depth":1},{"value":"Properties","depth":2},{"value":"Identity Properties","depth":3},{"value":"id (String)","depth":5},{"value":"type (String, required)","depth":5},{"value":"Options","depth":3},{"value":"beforeId (String)","depth":5},{"value":"source (String)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/layer","title":"Layer"},{"excerpt":"LinearInterpolator Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap . Interpolates all viewport props linearly. This interpolator offers similar behavior to Mapbox's easeTo when combined with a transitionEasing function. You may optionally limit the transition to selected viewport props, for example new LinearInterpolator(['pitch', 'bearing']) animates pitch and bearing while the user is still allowed to pan and zoom. Constructor new LinearInterpolator([options]) Parameters: options {Object} (optional) transitionProps {Array} (optional) - list of prop names to interpolate. Default: ['longitude', 'latitude', 'zoom', 'pitch', 'bearing'] . around {Array} (optional) - a point to zoom/rotate the map around, as [x, y] in screen position. Source linear-interpolator.js","headings":[{"value":"LinearInterpolator","depth":1},{"value":"Constructor","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/linear-interpolator","title":"LinearInterpolator"},{"excerpt":"MapContext MapContext allows components to interact with InteractiveMap or StaticMap via React's context API. It is also possible to consume MapContext outside the map component, if you render your own Provider . Note that not all context fields are available if you use it this way. Fields The context value object may contain the following fields: map (Map) - the mapbox-gl Map instance viewport (WebMercatorViewport) - the current viewport container (HTMLDivElement) - the outer container of the map component onViewportChange (Function) - a callback invoked when a map control requests a viewport change, with the signature onViewportChange(viewState, interactionState, oldViewState) onViewStateChange (Function) - an alternative callback invoked when a map control requests a viewport change, with the signature onViewStateChange({viewState, interactionState, oldViewState}) eventManager (EventManager) - an EventManager instance used to register all interactive events Source map-context.js","headings":[{"value":"MapContext","depth":1},{"value":"Fields","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/map-context","title":"MapContext"},{"excerpt":"MapController The easiest way to create a custom map control is to extend the default MapController class. Properties events (Array) A list of additional event names that this control subscribes to. Available events: click , dblclick , tap , doubletap , press , pinch , pinchin , pinchout , pinchstart , pinchmove , pinchend , pinchcancel , rotate , rotatestart , rotatemove , rotateend , rotatecancel , pan , panstart , panmove , panup , pandown , panleft , panright , panend , pancancel , swipe , swipeleft , swiperight , swipeup , swipedown , pointerdown , pointermove , pointerup , keydown , and keyup . The following events are toggled on/off by InteractiveMap props: scrollZoom - ['wheel'] dragPan and dragRotate - ['panstart', 'panmove', 'panend'] touchZoomRotate - ['pinchstart', 'pinchmove', 'pinchend'] doubleClickZoom - ['doubletap'] keyboard - ['keydown'] Event object is generated by mjolnir.js . It always has the following properties: type (string) - The event type to which the event handler is subscribed, e.g. 'click' or 'pointermove' center (Object {x, y} ) - The center of the event location (e.g. the centroid of a touch) relative to the viewport (basically, clientX/Y ) offsetCenter (Object {x, y} ) - The center of the event location relative to the map. target (Object) - The target of the event, as specified by the original srcEvent srcEvent (Object) - The original event object dispatched by the browser to the JS runtime Additionally, event objects for different event types contain a subset of the following properties: key (number) - The keycode of the keyboard event leftButton (boolean) - Flag indicating whether the left button is involved during the event middleButton (boolean) - Flag indicating whether the middle button is involved during the event rightButton (boolean) - Flag indicating whether the right button is involved during the event pointerType (string) - A string indicating the type of input (e.g. 'mouse' , 'touch' , 'pointer' ) delta (number) - The scroll magnitude/distance of a wheel event Methods handleEvent handleEvent(event) Called by the event manager to handle pointer events. This method delegate to the following methods to handle the default events: _onPanStart(event) _onPan(event) _onPanEnd(event) _onPinchStart(event) _onPinch(event) _onPinchEnd(event) _onDoubleTap(event) _onWheel(event) _onKeyDown(event) getMapState getMapState(overrides) Get a new descriptor object of the map state. If specified, props in the overrides object override the current map props. setOptions setOptions(options) Add/remove event listeners based on the latest InteractiveMap props. updateViewport updateViewport(newMapState, extraProps, interactionState) Invoke onViewportChange callback with a new map state. Source map-controller.js","headings":[{"value":"MapController","depth":1},{"value":"Properties","depth":2},{"value":"events (Array)","depth":5},{"value":"Methods","depth":2},{"value":"handleEvent","depth":5},{"value":"getMapState","depth":5},{"value":"setOptions","depth":5},{"value":"updateViewport","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/map-controller","title":"MapController"},{"excerpt":"Marker This is a React equivalent of Mapbox's\n Marker Control , which can\nbe used to render custom icons at specific locations on the map. Performance notes: if a large number of markers are needed, it's generally favorable to cache the nodes, so that we don't rerender them when the viewport changes. Properties latitude (Number, required) Latitude of the marker. longitude (Number, required) Longitude of the marker. offsetLeft (Number) default: 0 Offset of the marker from the left in pixels, negative number indicates left. offsetTop (Number) default: 0 Offset of the marker from the top in pixels, negative number indicates up. draggable (Boolean) default: false Allows this marker component to be dragged around the map. (Use onDragEnd to capture the final position and update longitude and latitude ). onDragStart (Function) Called when a draggable marker starts being dragged. Parameters: event - The pointer event. event.lngLat - The geo coordinates where the drag started, as [lng, lat] . onDrag (Function) Continuously called while a draggable marker is being dragged. Parameters: event - The pointer event. event.lngLat - The geo coordinates of the drag event, as [lng, lat] . onDragEnd (Function) Called when a draggable marker is released at its final position. This is usually a good time to capture event.lngLat and update the marker's longitude and latitude props. Parameters: event - The pointer event. event.lngLat - The geo coordinates where the drag ended, as [lng, lat] . className (String) Assign a custom class name to the container of this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source marker.js","headings":[{"value":"Marker","depth":1},{"value":"Properties","depth":2},{"value":"latitude (Number, required)","depth":5},{"value":"longitude (Number, required)","depth":5},{"value":"offsetLeft (Number)","depth":5},{"value":"offsetTop (Number)","depth":5},{"value":"draggable (Boolean)","depth":5},{"value":"onDragStart (Function)","depth":5},{"value":"onDrag (Function)","depth":5},{"value":"onDragEnd (Function)","depth":5},{"value":"className (String)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/marker","title":"Marker"},{"excerpt":"NavigationControl This is a React equivalent of Mapbox's NavigationControl ,\nwhich provides zoom buttons and a compass button. Properties onViewportChange (Function) Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing InteractiveMap 's onViewportChange . showCompass (Boolean) default: true Show or hide the compass button showZoom (Boolean) default: true Show or hide the zoom buttons zoomInLabel (String) default: Zoom In Label applied to the zoom in control button. zoomOutLabel (String) default: Zoom Out Label applied to the zoom out control button. compassLabel (String) default: Reset North Label applied to the compass control button. className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source navigation-control.js","headings":[{"value":"NavigationControl","depth":1},{"value":"Properties","depth":2},{"value":"onViewportChange (Function)","depth":5},{"value":"showCompass (Boolean)","depth":5},{"value":"showZoom (Boolean)","depth":5},{"value":"zoomInLabel (String)","depth":5},{"value":"zoomOutLabel (String)","depth":5},{"value":"compassLabel (String)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/navigation-control","title":"NavigationControl"},{"excerpt":"PointerEvent Event object passed to some of InteractiveMap 's callback props. Members type (String) The name of the event. point (Array) The screen coordinates that is being clicked. lngLat (Array) The geo coordinates that is being clicked. target (Element) The target element of the pointer event. srcEvent (Object) The original browser event.","headings":[{"value":"PointerEvent","depth":1},{"value":"Members","depth":2},{"value":"type (String)","depth":5},{"value":"point (Array)","depth":5},{"value":"lngLat (Array)","depth":5},{"value":"target (Element)","depth":5},{"value":"srcEvent (Object)","depth":5}],"slug":"docs/api-reference/pointer-event","title":"PointerEvent"},{"excerpt":"Popup This is a React equivalent of Mapbox's Popup Control , which can be used to\nshow tooltip popups with custom HTML content at specific locations on the map. Properties latitude (Number, required) Latitude of the anchor. longitude (Number, required) Longitude of the anchor. altitude (Number) default: 0 Altitude of the anchor. offsetLeft (Number) default: 0 Offset of the anchor from the left in pixels, negative number indicates left. offsetTop (Number) default: 0 Offset of the anchor from the top in pixels, negative number indicates up. closeButton (Boolean) default: true If true , a close button will appear in the top right corner of the popup. closeOnClick (Boolean) default: true If true , the popup will be closed when the map is clicked. tipSize (Number) default: 10 Size of the tip pointing to the coordinate. anchor (String) default: bottom A string indicating the popup's position relative to the coordinate.\nOptions are top , bottom , left , right , top-left , top-right , bottom-left , and bottom-right . dynamicPosition (Boolean) default: true If true , the anchor will be dynamically adjusted to ensure the popup falls within the map container. sortByDepth (Boolean) default: false If true , the order of the popups will be dynamically rearranged to ensure that the ones anchored closer to the camera are rendered on top. Useful when showing multiple popups in a tilted map. onClose (Function) Callback when the user closes the popup. className (String) Assign a custom class name to the container of this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source popup.js","headings":[{"value":"Popup","depth":1},{"value":"Properties","depth":2},{"value":"latitude (Number, required)","depth":5},{"value":"longitude (Number, required)","depth":5},{"value":"altitude (Number)","depth":5},{"value":"offsetLeft (Number)","depth":5},{"value":"offsetTop (Number)","depth":5},{"value":"closeButton (Boolean)","depth":5},{"value":"closeOnClick (Boolean)","depth":5},{"value":"tipSize (Number)","depth":5},{"value":"anchor (String)","depth":5},{"value":"dynamicPosition (Boolean)","depth":5},{"value":"sortByDepth (Boolean)","depth":5},{"value":"onClose (Function)","depth":5},{"value":"className (String)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/popup","title":"Popup"},{"excerpt":"ScaleControl This is a React equivalent of Mapbox's ScaleControl . Properties maxWidth (Number) default: 100 The maximum length of the scale control in pixels. unit (String) default: 'metric' Unit of the distance, one of 'imperial' , 'metric' or 'nautical' . className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source scale-control.js","headings":[{"value":"ScaleControl","depth":1},{"value":"Properties","depth":2},{"value":"maxWidth (Number)","depth":5},{"value":"unit (String)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/scale-control","title":"ScaleControl"},{"excerpt":"Source This component allows apps to create a map source using React. It may contain Layer components as children. Properties The props provided to this component should be conforming to the Mapbox source specification or CanvasSourceOptions . Note that the map component's mapStyle prop defaults to mapbox://styles/mapbox/light-v8 . To use an empty base map with your own sources, you need to override the prop, e.g.: When props change shallowly , the component will attempt to update the source. Do not define objects/arrays inline to avoid perf hit. Once a is mounted, the following props should not change. If add/remove multiple JSX sources dynamically, make sure you use React's key prop to give each element a stable identity. id (String) Unique identifier of the source. If not provided, a default id will be assigned. type (String, required) Type of the source. Source source.js","headings":[{"value":"Source","depth":1},{"value":"Properties","depth":2},{"value":"id (String)","depth":5},{"value":"type (String, required)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/source","title":"Source"},{"excerpt":"StaticMap The simplest React wrapper around MapboxGL . This is designed to be completely\nstatic, and should be used to render a map with no interactivity. For a component\nthat supports full user interactivity, see InteractiveMap . Properties Initialization The following props are used during the creation of the Mapbox map. attributionControl (Boolean) default: true Equivalent to Mapbox's attributionControl option . If true , shows Mapbox's attribution control. disableTokenWarning (Boolean) default: false If the provided API access token is rejected by Mapbox, StaticMap renders a warning instead of failing silently. If you know what you are doing and want to hide this warning anyways, set this prop to true . gl (WebGLContext) This prop is experimental. Use an existing WebGLContext instead of creating a new one. This allows multiple libraries to render into a shared buffer. Use with caution. mapboxApiAccessToken (String) Mapbox API access token for MapboxGL . Required when using Mapbox vector tiles/styles\nMapbox WebGL context creation option. Useful when you want to export the canvas as a PNG mapboxApiUrl (String) default: https://api.mapbox.com Enables the use of private and country specific servers Mapbox servers, e.g. https://api.mapbox.cn/ . mapOptions (Object) default: {} Non-public API, see https://github.com/visgl/react-map-gl/issues/545 An object of additional options to be passed to Mapbox's Map constructor . Options specified here\nwill take precedence over those same options if set via props. preserveDrawingBuffer (Boolean) default: false Equivalent to Mapbox's preserveDrawingBuffer option . If true , the map's canvas can be exported to a PNG using map.getCanvas().toDataURL() . preventStyleDiffing (Boolean) default: false If mapStyle is assigned an Immutable object, when the prop changes, StaticMap can diff between the two values and call the appropriate Mapbox API such as addLayer , removeLayer , setStyle , setData , etc.\nThis allows apps to update data sources and layer styles efficiently. In use cases such as animation or dynamic showing/hiding layers, style diffing prevents the map from reloading and flickering when the map style changes. There are known issues with style diffing. As stopgap, use this option to prevent style diffing. reuseMaps (Boolean) default: false This prop is experimental. If true , when the map component is unmounted, instead of calling remove on the Mapbox map instance, save it for later reuse. This will avoid repeatedly creating new Mapbox map instances if possible. Applications that frequently mount and unmount maps may try this prop to help work around a mapbox-gl resource leak issue that can lead to a browser crash in certain situations. transformRequest (Function) default: null 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.\nExpected to return an object with a url property and optionally headers and credentials properties. Equivalent to Mapbox's transformRequest map option . Map State mapStyle (String | Object | Immutable.Map) default: 'mapbox://styles/mapbox/light-v8' The Mapbox style. A string url or a\n MapboxGL style \nobject (regular JS object or Immutable.Map). Whenever the mapStyle prop changes, the component will attempt to update the style of the underlying Mapbox map. The behavior can be further customized with the preventStyleDiffing prop. mapStyle is ignored when explicitly set to null . width (Number | String, required) The width of the map. Can be either a number in pixels, or a valid CSS string. height (Number | String, required) The height of the map. Can be either a number in pixels, or a valid CSS string. latitude (Number) The latitude of the center of the map, as a top level prop. Only used if viewState is not supplied. longitude (Number) The longitude of the center of the map, as a top level prop. Only used if viewState is not supplied. zoom (Number) The tile zoom level of the map, as a top level prop. Only used if viewState is not supplied. Bounded implicitly by default minZoom and maxZoom of MapboxGL bearing (Number) default: 0 Specify the bearing of the viewport, as a top level prop. Only used if viewState is not supplied. pitch (Number) default: 0 Specify the pitch of the viewport, as a top level prop. Only used if viewState is not supplied.. altitude (Number) default: 1.5 Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137 . Altitude of the viewport camera, relative to screen height. viewState (Object) An object containing the view state of the map specified by the following fields: latitude (Number) - The latitude of the center of the map. longitude (Number) - The longitude of the center of the map. zoom (Number) - The tile zoom level of the map. Bounded implicitly by default minZoom and maxZoom of MapboxGL . bearing (Number) - default: 0 - The bearing of the viewport. pitch (Number) - default: 0 - The pitch of the viewport. altitude (Number) - default: 1.5 screen heights Note: Either the viewState , or the latitude , longitude and zoom properties need to be specified. Render Options asyncRender (Boolean) default: false If true , let Mapbox manage its own render cycle. This is the behavior prior to v4.1. If false , force Mapbox canvas to redraw with DOM updates. This will make the map synchronize better with other controls during prop-driven viewport changes. style (Object) The CSS style of the map container. visible (Boolean) default: true Whether the map is visible. Unmounting and re-mounting a Mapbox instance is known to be costly. This option offers a way to hide a map using CSS style. visibilityConstraints (Object) An object that specifies bounds for viewport props with min* , max* keys. If the viewport props are outside of these constraints, the Mapbox map is automatically hidden. Default: { minZoom: 0, maxZoom: 20, minPitch: 0, maxPitch: 60 } Callbacks onLoad (Function) default: () => {} A callback run when the map emits a load event. Mapbox docs onResize (Function) default: () => {} A callback run when the map size has changed. onError (Function) default: console.error A callback run when the map emits an error event. Mapbox docs Methods getMap Returns the Mapbox instance if initialized. The Map instance will have full access to MapboxGL's API . getMap() queryRenderedFeatures Use Mapbox's queryRenderedFeatures API to find features at point or in a bounding box. If the parameters argument is not specified, only queries the layers with the interactive property in the layer style. queryRenderedFeatures(geometry, parameters) geometry { [Number, Number | [[Number, Number, [Number, Number - Point or an array of two points defining the bounding box. Coordinates in pixels. parameters - Query options. For more details, see Mapbox API documentation . Source static-map.js","headings":[{"value":"StaticMap","depth":1},{"value":"Properties","depth":2},{"value":"Initialization","depth":3},{"value":"attributionControl (Boolean)","depth":5},{"value":"disableTokenWarning (Boolean)","depth":5},{"value":"gl (WebGLContext)","depth":5},{"value":"mapboxApiAccessToken (String)","depth":5},{"value":"mapboxApiUrl (String)","depth":5},{"value":"mapOptions (Object)","depth":5},{"value":"preserveDrawingBuffer (Boolean)","depth":5},{"value":"preventStyleDiffing (Boolean)","depth":5},{"value":"reuseMaps (Boolean)","depth":5},{"value":"transformRequest (Function)","depth":5},{"value":"Map State","depth":3},{"value":"mapStyle (String | Object | Immutable.Map)","depth":5},{"value":"width (Number | String, required)","depth":5},{"value":"height (Number | String, required)","depth":5},{"value":"latitude (Number)","depth":5},{"value":"longitude (Number)","depth":5},{"value":"zoom (Number)","depth":5},{"value":"bearing (Number)","depth":5},{"value":"pitch (Number)","depth":5},{"value":"altitude (Number)","depth":5},{"value":"viewState (Object)","depth":5},{"value":"Render Options","depth":3},{"value":"asyncRender (Boolean)","depth":5},{"value":"style (Object)","depth":5},{"value":"visible (Boolean)","depth":5},{"value":"visibilityConstraints (Object)","depth":5},{"value":"Callbacks","depth":3},{"value":"onLoad (Function)","depth":5},{"value":"onResize (Function)","depth":5},{"value":"onError (Function)","depth":5},{"value":"Methods","depth":2},{"value":"getMap","depth":5},{"value":"queryRenderedFeatures","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/static-map","title":"StaticMap"},{"excerpt":"SVGOverlay Allows applications to overlay data on top of maps using a SVG container. Properties redraw (Function) Called every time the map updates. Parameters: width (Number) - width of the viewport height (Number) - height of the viewport project (Function) - get screen position [x, y] from geo coordinates [lng, lat] unproject (Function) - get geo coordinates [lng, lat] from screen position [x, y] style (Object) Additional css styles of the svg container. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: false Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: false Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: false Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Source svg-overlay.js","headings":[{"value":"SVGOverlay","depth":1},{"value":"Properties","depth":2},{"value":"redraw (Function)","depth":5},{"value":"style (Object)","depth":3},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/svg-overlay","title":"SVGOverlay"},{"excerpt":"WebMercatorViewport The WebMercatorViewport class takes map camera states ( latitude , longitude , zoom , pitch , bearing etc.),\nand performs projections between world and screen coordinates. Constructor Parameter Type Default Description width number 1 Width of viewport height number 1 Height of viewport latitude number 0 Latitude of viewport center longitude number 0 Longitude of viewport center zoom number 11 Map zoom (scale is calculated as 2^zoom ) pitch number 0 The pitch (tilt) of the map from the screen, in degrees (0 is straight down) bearing number 0 The bearing (rotation) of the map from north, in degrees counter-clockwise (0 means north is up) fovy number see below Field of view of camera in degrees altitude number see below Altitude of camera in screen units position number[] null Offset of the camera, in meters Remarks: If either altitude or fovy is not provided, the missing value is computed from the other using altitudeToFovy() / fovyToAltitude() . Altitude has a default value that matches assumptions in mapbox-gl. It is only used if both altitude and fovy are not supplied. Field of view is independent from altitude, provide altitudeToFovy(1.5) (default value) to match assumptions in mapbox-gl width and height are forced to 1 if supplied as 0, to avoid\ndivision by zero. This is intended to reduce the burden of apps to\nto check values before instantiating a Viewport . When using Mercator projection, per cartographic tradition, longitudes and\nlatitudes are specified as degrees. Methods project(lngLatZ, options) Projects latitude and longitude to pixel coordinates on screen. Parameter Type Default Description lngLatZ Array (required) map coordinates, [lng, lat] or [lng, lat, Z] where Z is elevation in meters options Object {} named options options.topLeft Boolean true If true projected coords are top left, otherwise bottom left Returns: [x, y] or [x, y, z] in pixels coordinates. z is pixel depth. If input is [lng, lat] : returns [x, y] . If input is [lng, lat, Z] : returns [x, y, z] . Remarks: By default, returns top-left coordinates suitable for canvas/SVG type\nrendering. unproject(xyz, options) Unproject pixel coordinates on screen to longitude and latitude on map. Parameter Type Default Description xyz Array (required) pixel coordinates, [x, y] or [x, y, z] where z is pixel depth options Object {} named options options.topLeft Boolean true If true projected coords are top left, otherwise bottom left options.targetZ number 0 If pixel depth z is not specified in xyz , use options.targetZ as the desired elevation Returns: [lng, lat] or [longitude, lat, Z] in map coordinates. Z is elevation in meters. If input is [x, y] without specifying options.targetZ : returns [lng, lat] . If input is [x, y] with options.targetZ : returns [lng, lat, targetZ] . If input is [x, y, z] : returns [lng, lat, Z] . projectFlat(lngLat, scale) Project longitude and latitude onto Web Mercator coordinates. Parameter Type Default Description lngLat Array (required) map coordinates, [lng, lat] scale number this.scale Web Mercator scale Returns: [x, y] , representing Web Mercator coordinates. unprojectFlat(xy, scale) Unprojects a Web Mercator coordinate to longitude and latitude. Parameter Type Default Description xy Array (required) Web Mercator coordinates, [x, y] scale number this.scale Web Mercator scale Returns: [longitude, latitude] getBounds(options) Get the axis-aligned bounding box of the current visible area. options.z (number, optional) - To calculate a bounding volume for fetching 3D data, this option can be used to get the bounding box at a specific elevation. Default 0 . Returns: [[lon, lat], [lon, lat]] as the south west and north east corners of the smallest orthogonal bounds that encompasses the visible region. getBoundingRegion(options) Get the vertices of the current visible region. options.z (number, optional) - To calculate a bounding volume for fetching 3D data, this option can be used to get the bounding region at a specific elevation. Default 0 . Returns: An array of 4 corners in [longitude, latitude, altitude] that define the visible region. fitBounds(bounds, options: object) Get a new flat viewport that fits around the given bounding box. bounds ([ number,number , number,number ]) - an array of two opposite corners of\nthe bounding box. Each corner is specified in [lon, lat] . options.padding (number|{top:number, bottom: number, left: number, right: number}, optional) - The amount of\npadding in pixels to add to the given bounds from the edge of the viewport. If padding is set as object, all parameters are\nrequired. options.offset ( number,number , optional) - The center of the given bounds relative to the viewport's center, [x, y] measured in pixels. opts.minExtent (number, optional) - If supplied, the bounds used to calculate the new map settings will be expanded if the delta width or height of the supplied bounds is smaller than this value. opts.maxZoom = 24 (number, optional) - The returned zoom value will be capped to this value. Avoids returning infinite zoom when the supplied bounds have zero width or height deltas. Returns: A new WebMercatorViewport instance getMapCenterByLngLatPosition(options: object): [number, number] Get the map center that place a given lng, lat coordinate at screen point x, y . Parameters: options.lngLat (Array, required) - lng,lat coordinates of a location on the sphere. options.pos (Array, required) - x,y coordinates of a pixel on screen. Returns: [longitude, latitude] as the new map center","headings":[{"value":"WebMercatorViewport","depth":1},{"value":"Constructor","depth":2},{"value":"Methods","depth":2},{"value":"project(lngLatZ, options)","depth":5},{"value":"unproject(xyz, options)","depth":5},{"value":"projectFlat(lngLat, scale)","depth":5},{"value":"unprojectFlat(xy, scale)","depth":5},{"value":"getBounds(options)","depth":5},{"value":"getBoundingRegion(options)","depth":5},{"value":"fitBounds(bounds, options: object)","depth":5},{"value":"getMapCenterByLngLatPosition(options: object): [number, number]","depth":5}],"slug":"docs/api-reference/web-mercator-viewport","title":"WebMercatorViewport"},{"excerpt":"Contributing to react-map-gl Thanks for taking the time to contribute! PRs and bug reports are welcome, and we are actively looking for new maintainers. Setting Up Dev Environment The master branch is the active development branch. Building react-map-gl locally from the source requires node.js >=8 .\nWe use yarn to manage the dependencies. Test: Test in Node: Test in browser (can use Chrome dev tools for debugging): Pull Requests Any intended change to the code base must open a pull request and be approved. Generally speaking, all PRs are open against the master branch, unless the feature being affected no longer exists on master. PR Checklist Tests npm run test must be successful. New code should be covered by unit tests whenever possible. Documentation If public APIs are added/modified, update component documentation in docs/api-reference . Breaking changes and deprecations must be added to docs/upgrade-guide.md . Noteworthy new features should be added to docs/whats-new.md . Description on GitHub Link to relevant issue. Label with a milestone (latest release or vNext). If public APIs are added/modified, describe the intended behavior. If visual/interaction is affected, consider attaching a screenshot/GIF. Release react-map-gl follows the Semantic Versioning guidelines. Steps for publishing releases can be found here . Community Governance vis.gl is part of the Urban Computing Foundation . See the organization's Technical Charter . Technical Steering Committee react-map-gl development is governed by the vis.gl Technical Steering Committee (TSC). Maintainers Xiaoji Chen Xintong Xia Maintainers of react-map-gl have commit access to this GitHub repository, and take part in the decision making process. If you are interested in becoming a maintainer, read the governance guidelines . The vis.gl TSC meets monthly and publishes meeting notes via a mailing list .\nThis mailing list can also be utilized to reach out to the TSC. Code of Conduct Please be mindful of and adhere to the Linux Foundation's Code of Conduct when contributing to react-map-gl.","headings":[{"value":"Contributing to react-map-gl","depth":1},{"value":"Setting Up Dev Environment","depth":2},{"value":"Pull Requests","depth":2},{"value":"PR Checklist","depth":3},{"value":"Release","depth":2},{"value":"Community Governance","depth":2},{"value":"Technical Steering Committee","depth":3},{"value":"Maintainers","depth":3},{"value":"Code of Conduct","depth":2}],"slug":"docs/contributing","title":"Contributing to react-map-gl"},{"excerpt":"Upgrade Guide Upgrading to v5.3/v6.1 MapContext is now an official API. The experimental _MapContext export will be removed in a future release. react-virtualized-auto-sizer is no longer a dependency. Inertia has been enabled by default on the map controller. To revert to the behavior in previous versions, set the interaction options : Source and Layer components no longer expose imperative methods via ref as part of the migration to functional components. This is to comply with the pattern recommended by the latest React. If you used to call sourceRef.getSource() , it can be replaced with mapRef().getMap().getSource(sourceId) . If you used to call layerRef.getLayer() , it can be replaced with mapRef().getMap().getLayer(layerId) . Upgrading to v6 A valid Mapbox access token is always required. The default value of InteractiveMap 's maxPitch prop is changed to 85 from 60 . mapbox-gl v2 introduced a breaking change to the build system. Transpiling it may result in a crash in the production build with the message m is not defined . Find solutions in this thread . Upgrading to v4 onChangeViewport is removed, use onViewportChange instead Immutable.js is no longer a dependency Export experimental.MapControls is removed, use MapController instead InteractiveMap 's mapControls prop is renamed to controller Removed support for the deprecated interactive property on the layer styles. Use the interactiveLayerIds prop to specify which layers are clickable. Upgrading to v3.2 The latest mapbox-gl release requires stylesheet to be included at all times. See Get Started for information about styling. Immutable.js is no longer a hard dependency and will be removed in the next major release. If you are importing immutable in your application, it is recommended that you explicitly list it in the application's dependencies. Upgrading to v3 v3 is a major upgrade of react-map-gl. While we have tried to gently deprecated any changed or removed features, a few breaking changes could not be avoided. Version Requirements The Node Version Requirement for building react-map-gl is now >=v6.4.0 . Using prebuilt react-map-gl does NOT has this limitation. This is introduced by Mapbox GL JS v0.38.0 MapGL Component Two Map Components - v3 now splits the Map component into two React components: StaticMap and InteractiveMap . InteractiveMap is the default export, and designed to be as compatible as possible with the v2 default component. onChangeViewport callback now includes width and height . The viewport parameter passed to the onChangeViewport callback now includes width and height . Application code that composed the viewport with width and height may have to be updated. Please double check your render code if you relied on this behavior. Overlays Some Overlays Moved to Examples - Some less frequently used overlays ( DraggablePointsOverlay , ChoroplethOverlay , ScatterplotOverlay ), have been moved to examples. Most users are now using mapbox styles or deck.gl layers and removing these overlays reduces the size of the react-map-gl library for the majority of users that don't need them. If you still use them, simply copy the overlay source file(s) into your application. Overlays must be Children of the Map - Overlays must now be rendered as children of the main react-map-gl component to automatically sync with the map viewport. fitBounds utility function The fitBounds utility has been moved to the math.gl library. The function can now be called as follows: Deprecations We have started to deprecate a few React props. In all the cases below, the old props will still work (you'll get a warning in the console), but they will likely be removed in the next major version of react-map-gl so you should start using the new props as soon as possible. Old Prop New Prop onChangeViewport() onViewportChange() onHoverFeatures() onHover() onClickFeatures() onClick() perspectiveEnabled [default: false] dragRotate [default: true] Upgrading to v2 v2 is API compatible with v1, however if you are still using v1 of react-map-gl, make sure that you first upgrade: Your node version to v4 or higher Your react version to 15.4 or higher. Background: mapbox-gl 0.31.0 introduced a hard dependency on Node >= v4. Upgrading to v1 (Upgrading from 0.6.x) Importing Overlays - The map overlay components ( HTMLOverlay , CanvasOverlay , SVGOverlay etc) are now named exports. They previously had to be imported via their relative source paths: Map State - The map state reported by onViewportChanged will now contain additional state fields (tracking not only pitch and bearing needed for perspective mode, but also transient information about how the projection is being changed by the user). This information must be passed back to the react-map-gl component in the next render. To simplify and future proof applications, it is recommended to simply save the entire mapState in your app store whenever it changes and then pass it back to the component rather than trying to keep track of individual fields (like longitude , latitude and zoom ).","headings":[{"value":"Upgrade Guide","depth":1},{"value":"Upgrading to v5.3/v6.1","depth":2},{"value":"Upgrading to v6","depth":2},{"value":"Upgrading to v4","depth":2},{"value":"Upgrading to v3.2","depth":2},{"value":"Upgrading to v3","depth":2},{"value":"Version Requirements","depth":3},{"value":"MapGL Component","depth":3},{"value":"onChangeViewport callback now includes width and height.","depth":4},{"value":"Overlays","depth":3},{"value":"fitBounds utility function","depth":3},{"value":"Deprecations","depth":3},{"value":"Upgrading to v2","depth":2},{"value":"Upgrading to v1","depth":2}],"slug":"docs/upgrade-guide","title":"Upgrade Guide"},{"excerpt":"What's new react-map-gl v5.3/v6.1 Release date: Jan 27, 2020 Highlights TypeScript and Flow typings are now published with the library More controller customizations. Smooth easing on wheel scroll, three-finger gesture to change pitch, inertia after pan/pinch, and customizable keyboard navigation speed. See the updated interaction options for details. A new eventRecognizerOptions prop is added for fine-tuning the interaction experience. New component: AttributionControl Promoted to official API: MapContext Resolved React error over attempted state update during render GeolocateControl added supports for showAccuracyCircle All controls now support inline styling with a style prop All components and examples have been rewritten as functional components react-map-gl v6.0 Release date: Dec 16, 2020 What's Changed The 6.0 release upgrades its Mapbox GL JS dependency to v2.0. There are important changes to mapbox-gl's license and pricing model in this milestone. If you are NOT using a Mapbox account (e.g. self-hosting map tiles), do NOT upgrade to this version, and consider your options discussed in this document . See upgrade guide for a complete list of breaking changes. react-map-gl v5.2 Release date: Jan 6, 2020 Highlights New Components : ScaleControl NavigationControl : new label prop GeolocateControl : new label , onGeolocate , auto props New Export : WebMercatorViewport is re-exported from the viewport-mercator-project library for ease of use. It's recommended to import it from react-map-gl instead to avoid future dependency change. New Example : Clusters react-map-gl v5.1 Release date: Oct 30, 2019 Highlights New Components : Layer and Source have been added to provide better React parity with the Mapbox GL JS API. Viewport transition : transitionDuration can be set to 'auto' when using FlyToInterpolator . New Example : Add an example with drawing library react-map-gl-draw . react-map-gl v5.0 Release date: May 31, 2019 What's Changed The only change between the 5.0 release and the latest 4.1 release is Mapbox GL JS v1.0. By using this version, you opt into Mapbox's new pricing model, which bills per map load instead of map views. 5.0.x and 4.1.x will continue to update in parallel with otherwise identical features until November 2019 when Mapbox moves all users of 0.xx to a new pricing scheme. For more details, see mapbox's changelog and blog post . Alongside Mapbox GL JS's new milestone, we have relaxed the mapbox-gl dependency from locking minor release ( ~0.53.0 ) to major release ( ^1.0.0 ). This will allow developers to upgrade faster without waiting for a new release from react-map-gl. react-map-gl v4.1 Release date: Mar 14, 2019 Highlights New Components : FullscreenControl , GeolocateControl have been added to provide better React parity with the Mapbox GL JS API. New callback props InteractiveMap supports more callbacks: onNativeClick react-map-gl v4.0 Release date: Nov 5, 2018 Highlights Relative dimensions Both InteractiveMap and StaticMap now support CSS strings supplied to map width and height props. New onResize callback is fired when the map resizes. React 16 Upgrade to React 16.3 context and ref patterns Babel 7 Upgrade build system to Babel 7, better support for tree-shaking Style diffing Now use Mapbox's native style diffing. Immutable is no longer required. Draggable Markers Marker component now supports a new prop draggable , along with callbacks onDragStart , onDrag , and onDragEnd . 3d Popups Popup component now supports a new prop sortByDepth to enable proper occlusion when multiple popups are used in a tilted map. Interaction states onViewportChange is now called with richer descriptors of the user interaction, including isPanning , isZooming and isRotating . Interactive layers Dropped the requirement for the deprecated interactive property on the layer styles. Use the interactiveLayerIds prop to specify which layers are clickable. New callback props InteractiveMap supports more callbacks: onDblClick onMouseDown onMouseMove onMouseUp onTouchStart onTouchMove onTouchEnd onMouseEnter onMouseLeave onWheel onMouseOut See upgrade guide for breaking changes. react-map-gl v3.3 Release date: July, 2018 Highlights New viewState Property : Makes it possible to specify all map state properties ( longitude , latitude , zoom , bearing and pitch ) as a single property. New onViewStateChange callback : An alternative callback that matches the new viewState prop. react-map-gl v3.2 Realease date: January, 2018 Highlights Viewport transition : feature equivalent to Mapbox's flyTo and easeTo; smooth transition when using keyboard navigation or the NavigationControl. Better parity of Mapbox interaction : navigation using keyboard and the navigation control matches Mapbox behavior, including smooth transition when zooming and panning. Support for Map Reuse (experimental) : A new property reuseMaps is provided for applications that create and destroy maps, to help work around a mapbox-gl resource leak issue that can lead to a browser crash in certain situations. mapbox-gl 0.42.2 New props of the InteractiveMap component: Map creation: transformRequest , reuseMaps Interaction: touchZoom , touchRotate Transition: transitionDuration , transitionInterpolator , transitionEasing , transitionInterruption , onTransitionStart , onTransitionInterrupt , onTransitionEnd react-map-gl v3.1 Release date: October 19, 2017 Highlights Event handling Support right mouse drag to rotate Support keyboard navigation Allow controls and overlays to block map interactions React 16 - react-map-gl is now being tested with React 16, but the React peer dependency requirement is unchanged at >=15.4.x . mapbox-gl v0.40.1 No Token warning : react-map-gl now renders an HTML message if no mapbox token is supplied. react-map-gl v3.0 Release date: July 27th, 2017 Highlights Latest Mapbox GL JS : Bumps Mapbox GL JS to 0.38 . Multi-Touch Support : Full support for multi-touch gestures such as pinch-to-zoom and rotate. New Components : The MapGL component has been split into StaticMap and InteractiveMap (the default). Also, Popup , Marker , NavigationControl have been added to provide better React parity with the Mapbox GL JS API. Improved Overlay Components : Supplying viewport props ( width height zoom longitude and latitude ) are no longer required if you render SVGOverlay , CanvasOverlay or HTMLOverlay as a child of the map. Perspective mode is now supported in all overlays. New Props : maxPitch , minPitch , dragPan , doubleClickZoom , touchZoomRotate ,\n scrollZoom are now provided to allow granular control of map interactivity. Documentation : Significantly expanded and linked with our other geospatial frameworks. Examples : New stand-alone examples to get you started instantly with the new features. Event Handling : New event handling architecture that enables full customization of event handling (experimental). Components InteractiveMap (New, MapGL replacement) This is a wrapper on top of StaticMap . It takes all the props of StaticMap and additional ones such as onViewportChange , scrollZoom , dragRotate , etc. to control interactivity on the map. See Source Code for more information. StaticMap (New) This is the React wrapper around Mapbox GL JS and takes in viewport properties such as width , height , latitude , longitude . Style diffing and updating logic also live here. See Source Code for more information. Overlays Three overlays ( ScatterplotOverlay , DraggablePointsOverlay , ChoroplethOverlay ), have been moved out of the library and are now only provided as examples. Property Changes Property Names - some prop names have been modernized, the old ones will still work for now with a warning. Internal Properties such as isHovering , isDragging , startDragLngLat have been removed.\nThese were never meant to be useful publicly and have caused confusions in the past. Utilities fitBounds : fitBounds has been moved to another repository and has been rewritten to provide a more logical interface. For more information, see the Upgrade Guide . react-map-gl v2.0 Date: Jan 17, 2017 Highlights Latest mapbox-gl : Bump mapbox-gl to v0.31.0 new maxZoom prop - Add maxZoom prop and defaults to 20 New onLoad prop - Add onLoad event handler new onClick prop - Add onClick prop handler (#140) react-map-gl v1.0 Perspective Mode - Now supports bearing and pitch properties, per mapbox-gl api documentation. These props default to 0 which means that maps will still be rendered in flat/ortographic mode when they are not provided Support for ES6 imports - The map overlay components (HTMLOverlay, CanvasOverlay, SVGOverlay etc) previously had to be imported via their relative source paths can now be imported directly using `import {SVGOverlay} from 'react-map-gl'. react-map-gl v0.6 Initial public version","headings":[{"value":"What's new","depth":1},{"value":"react-map-gl v5.3/v6.1","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v6.0","depth":2},{"value":"What's Changed","depth":3},{"value":"react-map-gl v5.2","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v5.1","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v5.0","depth":2},{"value":"What's Changed","depth":3},{"value":"react-map-gl v4.1","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v4.0","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v3.3","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v3.2","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v3.1","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v3.0","depth":2},{"value":"Highlights","depth":3},{"value":"Components","depth":3},{"value":"InteractiveMap (New, MapGL replacement)","depth":4},{"value":"StaticMap (New)","depth":4},{"value":"Overlays","depth":4},{"value":"Property Changes","depth":3},{"value":"Utilities","depth":3},{"value":"react-map-gl v2.0","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v1.0","depth":2},{"value":"react-map-gl v0.6","depth":2}],"slug":"docs/whats-new","title":"What's new"},{"excerpt":"Adding Custom Data Native Mapbox Layers You can inject data and mapbox native layers using the Source and Layer components: For details about data sources and layer configuration, check out the Mapbox style specification . For dynamically updating data sources and layers, check out the GeoJSON and GeoJSON animation examples. Overlays react-map-gl provides a basic overlay API that enables applications to overlay data on top of maps.\nThey are great for creating light-weight custom drawings. Example Built-in Overlays SVGOverlay HTMLOverlay CanvasOverlay Example Overlays There are a couple of additional overlays in the examples folder that can be copied into applications ScatterplotOverlay , ChoroplethOverlay . Third-party overlays are also available. For example, the heatmap-overlay module uses webgl-heatmap to create geographic heatmaps. Other vis.gl Libraries For more feature rich and performant data visualization overlay use cases, you may consider using other visualization libraries. react-map-gl is part of the vis.gl ecosystem, a suite of high-performance data visualization tools for the Web. deck.gl - WebGL-powered framework for the visualization of large datasets. loaders.gl - loaders for file formats focused on visualization of big data, including point clouds, 3D geometries, images, geospatial formats as well as tabular data. nebula.gl - 3D-enabled GeoJSON editing based on deck.gl and React.","headings":[{"value":"Adding Custom Data","depth":1},{"value":"Native Mapbox Layers","depth":2},{"value":"Overlays","depth":2},{"value":"Example","depth":3},{"value":"Built-in Overlays","depth":3},{"value":"Example Overlays","depth":3},{"value":"Other vis.gl Libraries","depth":2}],"slug":"docs/get-started/adding-custom-data","title":"Adding Custom Data"},{"excerpt":"FAQ Enable Right-to-Left Language Support This is the same as import {setRTLTextPlugin} from 'mapbox-gl' in the browser, but will not crash in node. The export mainly offers a convenience when using server-side rendering. To use this API, consult Mapbox's setRTLTextPlugin documentation. Where is fitBounds? You can use the WebMercatorViewport utility to find the target viewport that fits around a longitude-latitude bounding box: Documentation of WebMercatorViewport I called flyTo/panTo and all controls went out of sync You cannot manipulate the map camera via getMap() and the native mapbox-gl API. To conform to the reactive programming paradigm, all camera changes should be driven by prop changes on the React component. Circumventing this will break the binding between React components and the underlying map instance. Instead, use the InteractiveMap 's transition props. See viewport transition for examples. mapbox-gl-draw does not work with react-map-gl Unfortunately, react-map-gl implements its own interative logic and disables the native event handling of mapbox-gl. Short explanation: mapbox-gl is not designed to support React. Long explanation: When using react-map-gl, we have two asynchronous rendering loops, React and Mapbox. Mapbox's move events are only fired after the camera changes and there is no way to control how and when the map rerenders. If we update React states upon the move events, all React controls/overlays may only get updated one animation frame after the map rerender. You can find discussions here and here . Because of this, any mapbox-gl control that listens to the native map events will not work. An equivelant to mapbox-gl-draw is react-map-gl-draw . You can find an example here .","headings":[{"value":"FAQ","depth":1},{"value":"Enable Right-to-Left Language Support","depth":2},{"value":"Where is fitBounds?","depth":2},{"value":"I called flyTo/panTo and all controls went out of sync","depth":2},{"value":"mapbox-gl-draw does not work with react-map-gl","depth":2}],"slug":"docs/get-started/faq","title":"FAQ"},{"excerpt":"Get Started Installation Using react-map-gl requires node >= v4 and react >= 16.3 . Example See full project setup in get-started examples Styling The current mapbox-gl release requires its stylesheet be included at all times. The marker, popup and navigation components in react-map-gl also need the stylesheet to work properly. You may add the stylesheet to the head of your page: Find out your mapbox version by running yarn list mapbox-gl or npm ls mapbox-gl . Or embed it in your app by using - browserify-css \nwith Browserify or - css-loader with Webpack: Using with Browserify, Webpack, and other JavaScript Bundlers browserify - react-map-gl is extensively tested with browserify and works without configuration. webpack - Most of the provided react-map-gl examples use webpack. Look at the get started examples folder for minimalist templates. create-react-app - react-map-gl is compatible with create-react-app . create-react-app-typescript - react-map-gl is compatible with create-react-app-typescript . You can see an example here . There's many other ready-to-run examples you can take a look at if you need more inspiration. Using with a mapbox-gl Fork Install your choice of fork along with react-map-gl, for example: In your bundler's configuration, set the forked library to replace any reference from mapbox-gl. This can be done in Webpack with something like: In rollup:","headings":[{"value":"Get Started","depth":1},{"value":"Installation","depth":2},{"value":"Example","depth":2},{"value":"Styling","depth":2},{"value":"Using with Browserify, Webpack, and other JavaScript Bundlers","depth":2},{"value":"Using with a mapbox-gl Fork","depth":2}],"slug":"docs/get-started/get-started","title":"Get Started"},{"excerpt":"About Mapbox Tokens react-map-gl itself is open source and free. It provides a React wrapper for mapbox-gl or derived projects.\nDepending on which Mapbox GL JS version (or fork) you use, you may need a Mapbox token. You will need a Mapbox token if you use: react-map-gl@>=6.0.0 , depending on mapbox-gl@>=2.0.0 and above - requires a mapbox access token in order to access the map renderer, and generates billable events regardlesss of whether you are displaying your own maps. react-map-gl@5.x , depending on mapbox-gl@1.x - requires an access token only if you load the map styles and tiles from Mapbox's data service. See \"Display Maps Without A Mapbox Token\" section below for using non-Mapbox tiles. To get a Mapbox token, you will need to register on their website . The token will be used to identify you and start serving up map tiles. The service is free until a certain level of traffic is exceeded. There are several ways to provide a token to your app, as showcased in some of the example folders: Provide a mapboxApiAccessToken prop to the map component Set the MapboxAccessToken environment variable (or set REACT_APP_MAPBOX_ACCESS_TOKEN if you are using Create React App) Provide it in the URL, e.g ?access_token=TOKEN Provide mapboxApiUrl prop to the map component to override the default mapbox API URL But we would recommend using something like dotenv and put your key in an untracked .env file, that will then expose it as a process.env variable, with much less leaking risks. Display Maps Without A Mapbox Token It is possible to use the map component without the Mapbox service, if you use another tile source (for example, if you host your own map tiles). Note that this is no longer allowed using mapbox-gl v2.0 and above. The options are: Stay on react-map-gl@5.x and mapbox-gl@1.x . react-map-gl plans to continue supporting this release in the foreseeable future, however, this version will not include any of the latest features of the map renderer, nor get any future updates from Mapbox. Use a community fork of mapbox-gl, for example maplibre-gl . See using with a mapbox-gl fork for how to configure your project. To use your own map service, you will need a custom Mapbox GL style that points to your own vector tile source , and pass it to ReactMapGL using the mapStyle prop. This custom style must match the schema of your tile source. Open source tile schemas include: TileZen schema OpenMapTiles schema Some useful resources for creating your own map service: Mapbox Vector Tile Spec Open source tools If you are using a third party service that requires header based authentication, you can do this by defining a function to pass to ReactMapGL using the transformRequest prop. An example function:","headings":[{"value":"About Mapbox Tokens","depth":1},{"value":"Display Maps Without A Mapbox Token","depth":2}],"slug":"docs/get-started/mapbox-tokens","title":"About Mapbox Tokens"},{"excerpt":"State Management InteractiveMap is designed to be a stateless component. Its appearance is entirely controlled by the properties that are passed in from its parent. In this architecture, transition works the same way as interaction: the component shall notify the application of \"user intent\" by calling the onViewportChange callback, but ultimately the application needs to decide what to do with it. The most simple handling of this intent is to save it and pass it back to the component: User interaction and transition will not work without a valid onViewportChange handler. The advantage of this practice is that it ensures a single source of truth regarding the viewport state (in the example above, saved in the state of the container component). When you use this viewport state to direct the rendering of other components, it is guaranteed that they will always be synced with the map. You may apply additional constraints to the viewport: Or manipulate the viewport outside of the ReactMap component: Using with Redux If you're using redux, it is very easy to hook this component up to store state in the redux state tree.\nThe simplest way is to take all properties passed to the onViewportChange function property and add them\ndirectly into the store. This state can then be passed back to the component without any transformation.","headings":[{"value":"State Management","depth":1},{"value":"Using with Redux","depth":2}],"slug":"docs/get-started/state-management","title":"State Management"}]}},"staticQueryHashes":["484347790"]} \ No newline at end of file +{"componentChunkName":"component---node-modules-gatsby-theme-ocular-src-react-templates-search-jsx","path":"/search","result":{"pageContext":{"data":[{"excerpt":"Introduction react-map-gl is a suite of React components for\nMapbox GL JS-compatible libraries. Library Description MapLibre An open fork of mapbox-gl v1, that can be used without a mapbox token. Mapbox GL JS v1 The previous version of mapbox GL JS. This version is free open source and can be used with non-mapbox basemaps without a mapbox token. Mapbox GL JS v2 The latest version of Mapbox GL JS. Note that version 2 is not free open source, and a mapbox token is required and billable events are generated even if you do not use mapbox hosted basemaps. Other mapbox-gl forks It may be possible to use react-map-gl with other mapbox forks, but this is not a supported use case. Minor PRs to enable other forks to be used may be accepted. For basemaps: You can load map data from Mapbox's own service. You can create and host your own map data using one of the many open source tools . New to react-map-gl? Get Started Want to contribute? See our Developer Guide Design Philosophy At Uber, we make powerful web tools that contain maps. To manage the complexity of our applications, we fully embrace React and reactive programming. The stock mapbox-gl APIs are imperative . That is, you instruct the map to do something (for example, map.flyTo ), and it will execute the command at its own pace. This does not scale when we have many components that need to synchronize with each other. One use case we have is to render two maps side by side, and when the user interacts with one, update both cameras. We draw UI on top of the map using React, pinned to a given geolocation. We also render visualization layers on top of the map using WebGL, most notably with deck.gl . The mapbox maps, the deck.gl canvas, and React controls' render cycles are all asynchronous. If we listen to the move event in the map and tell the other components to update, the other components would always be one frame behind. Ultimately, in the spirit of the reactive programming paradigm , data always flows down . In a complex application, any user input or data fetch can affect the rendering of many components. We might store the source of truth in a parent component state, or Redux store, or hooks, and let it propagate down to the map as well as its peers. As long as the map manages its own state, as mapbox-gl is designed to do, we risk the components going out of sync. react-map-gl creates a fully reactive wrapper for mapbox-gl. The InteractiveMap component is stateless. To move the map camera in anyway, the application must update the component's props. The application can also be confident that the map's camera would never deviate from the props that it's assigned. At first glance, its API may seem verbose to those who come from the imperative world of mapbox-gl. However, it is essential for the correctness of large applications. Limitations This library provides convenient wrappers around initializing and (to some degree) tracking the state of a Mapbox WebGL map. Because most of the functionality of Mapbox's JS API depends on the use of HTML5 canvases and WebGL, which React is not built to manipulate, the React component does not mirror all the functionality of Mapbox GL JS's Map class. You may access the native Mapbox API exposed by the getMap() function in this library. However, proceed with caution as calling the native APIs may break the connection between the React layer props and the underlying map state. Examples of replacing common native API calls with their React equivalents can be found on the FAQ page.","headings":[{"value":"Introduction","depth":1},{"value":"Design Philosophy","depth":2},{"value":"Limitations","depth":2}],"slug":"docs","title":"Introduction"},{"excerpt":"Custom Components You may create your own map control components by consuming MapContext . Using the MapContext The following component renders a label \"(longitude, latitude)\" at the given coordinate: Using the useMapControl hook useMapControl is an experimental API that makes it easier to create controls with event handling. Calling useMapControl(opts) returns an object containing the following fields: context (MapContext) - the current context value containerRef (RefObject) - this should be assigned to the ref prop of the DOM element that the event listeners should attach to. This hook supports the following options: onScroll (Function) - called on mouse wheel event. Can be used to stop map from zooming when this component is scrolled. onDragStart (Function) - called on dragstart event. Can be used to stop map from panning when this component is dragged. onClick (Function) - called on click event. Can be used to stop map from calling the onClick callback when this component is clicked. onDoubleClick (Function) - called on double click event. Can be used to stop map from zooming when this component is double clicked. onPointerMove (Function) - called on pointermove event. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered.","headings":[{"value":"Custom Components","depth":1},{"value":"Using the MapContext","depth":2},{"value":"Using the useMapControl hook","depth":2}],"slug":"docs/advanced/custom-components","title":"Custom Components"},{"excerpt":"Custom Map Controller Overriding The Default Map Controller To change the default behavior of map interaction, you can provide a custom map control to the controller prop of InteractiveMap . This custom map control must offer the following interface: setOptions(options) - called by InteractiveMap when props change. Documentation of the MapController class . Examples A simple example to swap drag pan and drag rotate: Overwrite existing event handling: Listen to additional events: Add a custom callback:","headings":[{"value":"Custom Map Controller","depth":1},{"value":"Overriding The Default Map Controller","depth":2},{"value":"Examples","depth":2}],"slug":"docs/advanced/custom-map-controller","title":"Custom Map Controller"},{"excerpt":"Viewport Transition react-map-gl does not expose the transition API from mapbox-gl-js since it is designed to be a stateless component, and needs to synchronize with separate overlay systems such as deck.gl. Instead, transitions can be defined using InteractiveMap 's transition props. Example: Fly to a New Location See viewport animation for a complete example. Example: Transition Viewport To A Bounding Box You can use the WebMercatorViewport utility to find the target viewport that fits around a lngLat bounding box: Documentation of WebMercatorViewport Controlling Map Transitions InteractiveMap's Transition Props See properties of InteractiveMap . transitionDuration (Number) transitionInterpolator (Object) transitionEasing (Function) transitionInterruption (Number) onTransitionStart (Function) onTransitionInterrupt (Function) onTransitionEnd (Function) Transition and the onViewportChange Callback InteractiveMap is designed to be a stateless component. For transitions to work, the application must update the viewport props returned by the onViewportChange callback: Remarks: The props returned by the callback may contain transition properties. For example, during panning and rotating, the callback is invoked with transitionDuration: 0 , meaning that the map movement instantly matches the change of the pointer. When panning or zooming with keyboard, the callback is invoked with a 300ms linear transition. It is recommended that when programatically triggering a transition, always explicitly set the transition properties (interpolator, easing and duration). \"Set and forget\": the values of the following props at the start of a transition carry through the entire duration of the transition: transitionDuration transitionInterpolator transitionEasing transitionInterruption The default interaction/transition behavior can always be intercepted and overwritten in the handler for onViewportChange . However, if a transition is in progress, the properties that are being transitioned (e.g. longitude and latitude) should not be manipulated, otherwise the change will be interpreted as an interruption of the transition. When using FlyToInterpolator for transitionInterpolator , transitionDuration can be set to 'auto' where actual duration is auto calculated based on start and end viewports and is linear to the distance between them. This duration can be further customized using speed parameter to FlyToInterpolator constructor. Transition Interpolators A TransitionInterpolator instance must be supplied to the transitionInterpolator prop. It contains the following methods: arePropsEqual(currentProps, nextProps) - called to determine if transition should be triggered when viewport props update. initiateProps(startProps, endProps) - called before transition starts to pre-process the start and end viewport props. interpolateProps(startProps, endProps, t) - called to get viewport props in transition. t is a time factor between [0, 1] . react-map-gl offers two built-in interpolator classes: LinearInterpolator FlyToInterpolator","headings":[{"value":"Viewport Transition","depth":1},{"value":"Example: Fly to a New Location","depth":2},{"value":"Example: Transition Viewport To A Bounding Box","depth":2},{"value":"Controlling Map Transitions","depth":2},{"value":"InteractiveMap's Transition Props","depth":3},{"value":"Transition and the onViewportChange Callback","depth":3},{"value":"Transition Interpolators","depth":3}],"slug":"docs/advanced/viewport-transition","title":"Viewport Transition"},{"excerpt":"AttributionControl This is a React equivalent of Mapbox's AttributionControl . Properties toggleLabel (String) default: 'Toggle Attribution' Label applied to the toggle button. compact (Boolean) If true , force a compact attribution that shows the full attribution on mouse hover. If false , force the full attribution control. When undefined, shows a responsive attribution that collapses when the map is less than 640 pixels wide. customAttribution (String| String ) String or strings to show in addition to any other attributions. className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source attribution-control.js","headings":[{"value":"AttributionControl","depth":1},{"value":"Properties","depth":2},{"value":"toggleLabel (String)","depth":5},{"value":"compact (Boolean)","depth":5},{"value":"customAttribution (String|String)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/attribution-control","title":"AttributionControl"},{"excerpt":"CanvasOverlay Allows applications to overlay data on top of maps using a canvas. Properties redraw (Function) Called every time the map updates. Parameters: ctx {CanvasRenderingContext2D} - rendering context of the canvas width {Number} - width of the viewport height {Number} - height of the viewport project {Function} - get screen position [x, y] from geo coordinates [lng, lat] unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y] captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: false Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: false Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: false Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Source canvas-overlay.js","headings":[{"value":"CanvasOverlay","depth":1},{"value":"Properties","depth":2},{"value":"redraw (Function)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/canvas-overlay","title":"CanvasOverlay"},{"excerpt":"FlyToInterpolator Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap . This interpolator offers similar behavior to Mapbox's flyTo method. Constructor new FlyToInterpolator([options]) Parameters: options {Object} (optional) curve (Number, optional, default: 1.414) - The zooming \"curve\" that will occur along the flight path. speed (Number, optional, default: 1.2) - The average speed of the animation defined in relation to options.curve , it linearly affects the duration, higher speed returns smaller durations and vice versa. screenSpeed (Number, optional) - The average speed of the animation measured in screenfuls per second. Similar to opts.speed it linearly affects the duration, when specified opts.speed is ignored. maxDuration (Number, optional) - Maximum duration in milliseconds, if calculated duration exceeds this value, 0 is returned. Source viewport-fly-to-interpolator.js","headings":[{"value":"FlyToInterpolator","depth":1},{"value":"Constructor","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/fly-to-interpolator","title":"FlyToInterpolator"},{"excerpt":"FullscreenControl This is a React equivalent of Mapbox's FullscreenControl . Properties container (HTMLElement) container is the compatible DOM element which should be made full screen. By default, the map container element will be made full screen. label (String) default: Toggle fullscreen Label applied to the fullscreen control button. className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source fullscreen-control.js","headings":[{"value":"FullscreenControl","depth":1},{"value":"Properties","depth":2},{"value":"container (HTMLElement)","depth":5},{"value":"label (String)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/fullscreen-control","title":"FullscreenControl"},{"excerpt":"GeolocateControl This is a React equivalent of Mapbox's GeolocateControl . Properties Accepts all the options of Mapbox GeolocateControl . onViewportChange (Function, optional) Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing InteractiveMap 's onViewportChange . onGeolocate (Function, optional) Callback when Geolocation API position updates. It is called with a Geolocation API PositionOptions object. positionOptions (Object) default: {enableHighAccuracy: false, timeout: 6000} A Geolocation API PositionOptions object. fitBoundsOptions (Object) default: {maxZoom: 15} A fitBounds options object to use when the map is panned and zoomed to the user's location. The default is to use a maxZoom of 15 to limit how far the map will zoom in for very accurate locations. trackUserLocation (Boolean) default: false If true the Geolocate Control becomes a toggle button and when active the map will receive updates to the user's location as it changes. showUserLocation (Boolean) default: true By default a dot will be shown on the map at the user's location. Set to false to disable. showUserHeading (Boolean) default: false If true a heading indicator will be shown on the map at the user's location. showAccuracyCircle (Boolean) default: true By default, if showUserLocation is true , a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to false to disable. Always disabled when showUserLocation is false . className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. label (String) default: 'Find My Location' Label applied to the Geolocate control button. disabledLabel (String) default: 'Location Not Available' Label applied to the Geolocate control button if geolocation is disabled by the user. auto (Boolean) default: false Programmatically triggers geolocate when set to true. Initializing the component with true triggers inside componentDidMount where as changing to true at a later point triggers inside componentDidUpdate . Initally setting as or changing to false has no effect. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source geolocate-control.js","headings":[{"value":"GeolocateControl","depth":1},{"value":"Properties","depth":2},{"value":"onViewportChange (Function, optional)","depth":5},{"value":"onGeolocate (Function, optional)","depth":5},{"value":"positionOptions (Object)","depth":5},{"value":"fitBoundsOptions (Object)","depth":5},{"value":"trackUserLocation (Boolean)","depth":5},{"value":"showUserLocation (Boolean)","depth":5},{"value":"showUserHeading (Boolean)","depth":5},{"value":"showAccuracyCircle (Boolean)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"label (String)","depth":5},{"value":"disabledLabel (String)","depth":5},{"value":"auto (Boolean)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/geolocate-control","title":"GeolocateControl"},{"excerpt":"HTMLOverlay Allows applications to overlay data on top of maps using a HTML container. Properties redraw (Function) Called every time the map updates. Parameters: width {Number} - width of the viewport height {Number} - height of the viewport project {Function} - get screen position [x, y] from geo coordinates [lng, lat] unproject {Function} - get geo coordinates [lng, lat] from screen position [x, y] style (Object) Additional css styles of the div container. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: false Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: false Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: false Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Source html-overlay.js","headings":[{"value":"HTMLOverlay","depth":1},{"value":"Properties","depth":2},{"value":"redraw (Function)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/html-overlay","title":"HTMLOverlay"},{"excerpt":"default (InteractiveMap) This component renders MapboxGL and provides full interactivity support.\nIt uses StaticMap underneath to render the final map component.\nThis is the default exported component from react-map-gl . Properties Initialization Inherit the following props from StaticMap : attributionControl (Boolean) disableTokenWarning (Boolean) gl (WebGLContext) mapboxApiAccessToken (String) mapboxApiUrl (String) mapOptions (Object) preserveDrawingBuffer (Boolean) preventStyleDiffing (Boolean) reuseMaps (Boolean) transformRequest (Function) Map State Inherit the following props from StaticMap : mapStyle (String | Object | Immutable.Map) width (Number | String) height (Number | String) latitude (Number) longitude (Number) zoom (Number) bearing (Number) pitch (Number) altitude (Number) viewState (Object) Render Options Inherit the following props from StaticMap : style (Object) visible (Boolean) visibilityConstraints (Object) getCursor (Function) Accessor that returns a cursor style to show interactive state. Called when the component is being rendered. Parameters state - The current state of the component. state.isDragging - If the map is being dragged. state.isHovering - If the pointer is over an interactive feature. See interactiveLayerIds prop. The default implementation of getCursor returns 'pointer' if isHovering , 'grabbing' if isDragging and 'grab' otherwise. Interaction Options maxZoom (Number) default: 20 Max zoom level. minZoom (Number) default: 0 Min zoom level. maxPitch (Number) default: 85 Max pitch in degrees. minPitch (Number) default: 0 Min pitch in degrees. scrollZoom (Boolean|Object) default: true Enable scroll to zoom. If an object is provided, may contain the following options to customize the scroll zoom behavior: speed (Number) - Multiplier for the wheel delta. Default 0.01 . smooth (Boolean) - Smoothly transition to the new zoom. If enabled, will provide a slightly lagged but smoother experience. Default false . dragPan (Boolean|Object) default: true Enable drag to pan. If an object is provided, may contain the following options to customize its behavior: inertia (Number) - Enable momentum/inertia when the gesture ends. The value specifies after how long the panning comes to a stop, in milliseconds. Default 300 . dragRotate (Boolean) default: true Enable drag to rotate. If an object is provided, may contain the following options to customize its behavior: inertia (Number) - Enable momentum/inertia when the gesture ends. The value specifies after how long the rotation comes to a stop, in milliseconds. Default 300 . doubleClickZoom (Boolean) default: true Enable double click to zoom. touchZoom (Boolean|Object) default: true Enable multitouch zoom. If an object is provided, may contain the following options to customize its behavior: inertia (Number) - Enable momentum/inertia when the gesture ends. The value specifies after how long the zooming comes to a stop, in milliseconds. Default 300 . touchRotate (Boolean|Object) default: false Enable multitouch rotate, including two-finger rotation to change bearing and three-finger swipe to change pitch. If an object is provided, may contain the following options to customize its behavior: inertia (Number) - Enable momentum/inertia when the gesture ends. The value specifies after how long the rotation comes to a stop, in milliseconds. Default 300 . keyboard (Boolean|Object) default: true Enable keyboard navigation. If an object is provided, may contain the following options to customize its behavior: zoomSpeed (Number) - speed of zoom using +/- keys. Default 2 . moveSpeed (Number) - speed of movement using arrow keys, in pixels. rotateSpeedX (Number) - speed of rotation using shift + left/right arrow keys, in degrees. Default 15 . rotateSpeedY (Number) - speed of rotation using shift + up/down arrow keys, in degrees. Default 10 . touchAction (String) default: 'none' Allow browser default touch actions. Default none . See hammer.js doc . By default, the map captures all touch interactions. This prop is useful for mobile applications to unblock default scrolling behavior. For example, use the combination dragPan: false and touchAction: 'pan-y' to allow vertical page scroll when dragging over the map. eventRecognizerOptions (Object) default: {} Set options for gesture recognition. My contain the following fields: pan - an object that is Hammer.Pan options. This gesture is used for drag events. pinch - an object that is Hammer.Pinch options This gesture is used for two-finger touch events. tripan - an object that is Hammer.Pan options. This gesture is used for three-finger touch events. tap - an object that is Hammer.Tap options. This gesture is used for the onClick callback. anytap - an object that is Hammer.Tap options. This gesture is used for the onNativeClick callback. doubletap - an object that is Hammer.Tap options. This gesture is used for double click events. For example, the following setting makes panning less sensitive and clicking easier on mobile: Note that the value of this prop is used once when the component mounts. Subsequent changes will be ignored. clickRadius (Number) default: 0 Radius to detect features around a clicked point. controller (Object) A map controller instance to replace the default map controller. This object must implement the following interface: events - An array of subscribed events handleEvent(event, context) - A method that handles interactive events interactiveLayerIds (Array) default: null A list of layer ids that are interactive. If specified: Pointer event callbacks will only query the features under the pointer of these layers. The getCursor callback will receive isHovering: true when hover over features of these layers. If not specified: Pointer event callbacks will query the features under the pointer of all layers. The getCursor callback will always receive isHovering: false . Transitions transitionDuration (Number) default: 0 Duration of transition in milliseconds. If specified, the map's viewport will smoothly move from the previous props to the current one. transitionInterpolator (Object) default: new LinearInterpolator() An interpolator object that defines the transition behavior between two map states. react-map-gl offers two interpolators: LinearInterpolator - similar to Mapbox's easeTo behavior. FlyToInterpolator - similar to Mapbox's flyTo behavior. You may import them as follows: For details about using transition interpolators, see transitions . transitionEasing (Function) default: t => t Easing function that maps a value from [0, 1] to [0, 1] . Check out http://easings.net/ for common easing curves. transitionInterruption (Number) default: TRANSITION_EVENTS.BREAK What to do if an ongoing transition is interrupted by another transition. There are 4 options: TRANSITION_EVENTS.BREAK - Start new transition from the current view. TRANSITION_EVENTS.SNAP_TO_END - Jump to the end of the previous transition before starting the new transition. TRANSITION_EVENTS.IGNORE - Complete the previous transition and ignore the new viewport change. TRANSITION_EVENTS.UPDATE - Continue the ongoing transition but change its destination to the new viewport. You may import the constants as follows: Callbacks Inherit the following props from StaticMap : onLoad (Function) onResize (Function) onError (Function) onViewportChange (Function) Callback that is fired when the map's viewport properties should be updated. If not supplied, the map is not interactive. Arguments: viewState (Object) The next viewport properties, including: width , height , latitude , longitude , zoom , bearing , pitch , altitude , maxZoom , minZoom , maxPitch , minPitch , transitionDuration , transitionEasing , transitionInterpolator , transitionInterruption . interactionState (Object) The current interaction that caused this viewport change. See onInteractionStateChange for possible fields. oldViewState (Object) The current viewport properties. onViewStateChange (Function) A newer version of the onViewportChange callback. Both are supported and provide equivalent functionality. onInteractionStateChange (Function) Callback that is fired when the user interacted with the map. Possible fields include: interactionState.inTransition (Boolean) interactionState.isDragging (Boolean) interactionState.isPanning (Boolean) interactionState.isRotating (Boolean) interactionState.isZooming (Boolean) Note: onInteractionStateChange may be fired without onViewportChange . For example, when the pointer is released at the end of a drag-pan, isDragging are reset to false , without the viewport's longitude and latitude changing. onHover (Function) Called when the mouse moves over the map (without button pressed). Receives a PointerEvent object. onClick (Function) Called when the map is single clicked. Receives a PointerEvent object. This event is not fired on double click therefore there may be a delay between pointer up and the event. onNativeClick (Function) Called when the map is clicked. Receives a PointerEvent object. This event is fired twice on double click. onDblClick (Function) Called when the map is double clicked. Receives a PointerEvent object. onMouseDown (Function) Called when a pointing device (usually a mouse) is pressed within the map. Receives a PointerEvent object. onMouseMove (Function) Called when a pointing device (usually a mouse) is moved within the map. Receives a PointerEvent object. onMouseUp (Function) Called when a pointing device (usually a mouse) is released within the map. Receives a PointerEvent object. onTouchStart (Function) Called when a touchstart event occurs within the map. Receives a PointerEvent object. onTouchMove (Function) Called when a touchmove event occurs within the map. Receives a PointerEvent object. onTouchEnd (Function) Called when a touchend event occurs within the map. Receives a PointerEvent object. onMouseEnter (Function) Called when a pointing device (usually a mouse) enters a visible portion of one of the interactive layers, defined by the interactiveLayerIds prop. Receives a PointerEvent object. onMouseLeave (Function) Called when a pointing device (usually a mouse) leaves a visible portion of one of the interactive layers, defined by the interactiveLayerIds prop. Receives a PointerEvent object. onWheel (Function) Called when a wheel event occurs within the map. Receives a PointerEvent object. onMouseOut (Function) Called when a point device (usually a mouse) leaves the map's canvas. Receives a PointerEvent object. onContextMenu (Function) Called when the context menu is activated. Prevent default here to enable right button interaction. Default: event => event.preventDefault() onTransitionStart (Function) Callback that is fired when a transition is triggered. onTransitionInterrupt (Function) Callback that is fired when an ongoing transition is interrupted by another transition. onTransitionEnd (Function) Callback that is fired when a transition is complete. Methods Inherit the following methods from StaticMap : getMap() queryRenderedFeatures(geometry, parameters) Source interactive-map.js","headings":[{"value":"default (InteractiveMap)","depth":1},{"value":"Properties","depth":2},{"value":"Initialization","depth":3},{"value":"Map State","depth":3},{"value":"Render Options","depth":3},{"value":"getCursor (Function)","depth":5},{"value":"Interaction Options","depth":3},{"value":"maxZoom (Number)","depth":5},{"value":"minZoom (Number)","depth":5},{"value":"maxPitch (Number)","depth":5},{"value":"minPitch (Number)","depth":5},{"value":"scrollZoom (Boolean|Object)","depth":5},{"value":"dragPan (Boolean|Object)","depth":5},{"value":"dragRotate (Boolean)","depth":5},{"value":"doubleClickZoom (Boolean)","depth":5},{"value":"touchZoom (Boolean|Object)","depth":5},{"value":"touchRotate (Boolean|Object)","depth":5},{"value":"keyboard (Boolean|Object)","depth":5},{"value":"touchAction (String)","depth":5},{"value":"eventRecognizerOptions (Object)","depth":5},{"value":"clickRadius (Number)","depth":5},{"value":"controller (Object)","depth":5},{"value":"interactiveLayerIds (Array)","depth":5},{"value":"Transitions","depth":3},{"value":"transitionDuration (Number)","depth":5},{"value":"transitionInterpolator (Object)","depth":5},{"value":"transitionEasing (Function)","depth":5},{"value":"transitionInterruption (Number)","depth":5},{"value":"Callbacks","depth":3},{"value":"onViewportChange (Function)","depth":5},{"value":"onViewStateChange (Function)","depth":5},{"value":"onInteractionStateChange (Function)","depth":5},{"value":"onHover (Function)","depth":5},{"value":"onClick (Function)","depth":5},{"value":"onNativeClick (Function)","depth":5},{"value":"onDblClick (Function)","depth":5},{"value":"onMouseDown (Function)","depth":5},{"value":"onMouseMove (Function)","depth":5},{"value":"onMouseUp (Function)","depth":5},{"value":"onTouchStart (Function)","depth":5},{"value":"onTouchMove (Function)","depth":5},{"value":"onTouchEnd (Function)","depth":5},{"value":"onMouseEnter (Function)","depth":5},{"value":"onMouseLeave (Function)","depth":5},{"value":"onWheel (Function)","depth":5},{"value":"onMouseOut (Function)","depth":5},{"value":"onContextMenu (Function)","depth":5},{"value":"onTransitionStart (Function)","depth":5},{"value":"onTransitionInterrupt (Function)","depth":5},{"value":"onTransitionEnd (Function)","depth":5},{"value":"Methods","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/interactive-map","title":"default (InteractiveMap)"},{"excerpt":"Layer This component allows apps to create a map layer using React. Properties The props provided to this component should be conforming to the Mapbox layer specification . When props change shallowly , the component will perform style diffing to update the layer. Avoid defining constant objects/arrays inline may help performance. Identity Properties Once a is mounted, the following props should not change. If you add/remove multiple JSX layers dynamically, make sure you use React's key prop to give each element a stable identity. id (String) Unique identifier of the layer. If not provided, a default id will be assigned. type (String, required) Type of the layer. Options beforeId (String) The ID of an existing layer to insert this layer before. If this prop is omitted, the layer will be appended to the end of the layers array. This is useful when using dynamic layers with a map style from a URL. Note that layers are added by the order that they mount. They are NOT reordered later if their relative positions in the JSX tree change. If dynamic reordering is desired, you should manipulate beforeId for consistent behavior. source (String) source is required by some layer types in the Mapbox style specification. If is used as the child of a Source component, this prop will be overwritten by the id of the parent source. Source layer.js","headings":[{"value":"Layer","depth":1},{"value":"Properties","depth":2},{"value":"Identity Properties","depth":3},{"value":"id (String)","depth":5},{"value":"type (String, required)","depth":5},{"value":"Options","depth":3},{"value":"beforeId (String)","depth":5},{"value":"source (String)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/layer","title":"Layer"},{"excerpt":"LinearInterpolator Implements the TransitionInterpolator interface. Designed to use with the transitionInterpolator prop of InteractiveMap . Interpolates all viewport props linearly. This interpolator offers similar behavior to Mapbox's easeTo when combined with a transitionEasing function. You may optionally limit the transition to selected viewport props, for example new LinearInterpolator(['pitch', 'bearing']) animates pitch and bearing while the user is still allowed to pan and zoom. Constructor new LinearInterpolator([options]) Parameters: options {Object} (optional) transitionProps {Array} (optional) - list of prop names to interpolate. Default: ['longitude', 'latitude', 'zoom', 'pitch', 'bearing'] . around {Array} (optional) - a point to zoom/rotate the map around, as [x, y] in screen position. Source linear-interpolator.js","headings":[{"value":"LinearInterpolator","depth":1},{"value":"Constructor","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/linear-interpolator","title":"LinearInterpolator"},{"excerpt":"MapContext MapContext allows components to interact with InteractiveMap or StaticMap via React's context API. It is also possible to consume MapContext outside the map component, if you render your own Provider . Note that not all context fields are available if you use it this way. Fields The context value object may contain the following fields: map (Map) - the mapbox-gl Map instance viewport (WebMercatorViewport) - the current viewport container (HTMLDivElement) - the outer container of the map component onViewportChange (Function) - a callback invoked when a map control requests a viewport change, with the signature onViewportChange(viewState, interactionState, oldViewState) onViewStateChange (Function) - an alternative callback invoked when a map control requests a viewport change, with the signature onViewStateChange({viewState, interactionState, oldViewState}) eventManager (EventManager) - an EventManager instance used to register all interactive events Source map-context.js","headings":[{"value":"MapContext","depth":1},{"value":"Fields","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/map-context","title":"MapContext"},{"excerpt":"MapController The easiest way to create a custom map control is to extend the default MapController class. Properties events (Array) A list of additional event names that this control subscribes to. Available events: click , dblclick , tap , doubletap , press , pinch , pinchin , pinchout , pinchstart , pinchmove , pinchend , pinchcancel , rotate , rotatestart , rotatemove , rotateend , rotatecancel , pan , panstart , panmove , panup , pandown , panleft , panright , panend , pancancel , swipe , swipeleft , swiperight , swipeup , swipedown , pointerdown , pointermove , pointerup , keydown , and keyup . The following events are toggled on/off by InteractiveMap props: scrollZoom - ['wheel'] dragPan and dragRotate - ['panstart', 'panmove', 'panend'] touchZoomRotate - ['pinchstart', 'pinchmove', 'pinchend'] doubleClickZoom - ['doubletap'] keyboard - ['keydown'] Event object is generated by mjolnir.js . It always has the following properties: type (string) - The event type to which the event handler is subscribed, e.g. 'click' or 'pointermove' center (Object {x, y} ) - The center of the event location (e.g. the centroid of a touch) relative to the viewport (basically, clientX/Y ) offsetCenter (Object {x, y} ) - The center of the event location relative to the map. target (Object) - The target of the event, as specified by the original srcEvent srcEvent (Object) - The original event object dispatched by the browser to the JS runtime Additionally, event objects for different event types contain a subset of the following properties: key (number) - The keycode of the keyboard event leftButton (boolean) - Flag indicating whether the left button is involved during the event middleButton (boolean) - Flag indicating whether the middle button is involved during the event rightButton (boolean) - Flag indicating whether the right button is involved during the event pointerType (string) - A string indicating the type of input (e.g. 'mouse' , 'touch' , 'pointer' ) delta (number) - The scroll magnitude/distance of a wheel event Methods handleEvent handleEvent(event) Called by the event manager to handle pointer events. This method delegate to the following methods to handle the default events: _onPanStart(event) _onPan(event) _onPanEnd(event) _onPinchStart(event) _onPinch(event) _onPinchEnd(event) _onDoubleTap(event) _onWheel(event) _onKeyDown(event) getMapState getMapState(overrides) Get a new descriptor object of the map state. If specified, props in the overrides object override the current map props. setOptions setOptions(options) Add/remove event listeners based on the latest InteractiveMap props. updateViewport updateViewport(newMapState, extraProps, interactionState) Invoke onViewportChange callback with a new map state. Source map-controller.js","headings":[{"value":"MapController","depth":1},{"value":"Properties","depth":2},{"value":"events (Array)","depth":5},{"value":"Methods","depth":2},{"value":"handleEvent","depth":5},{"value":"getMapState","depth":5},{"value":"setOptions","depth":5},{"value":"updateViewport","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/map-controller","title":"MapController"},{"excerpt":"Marker This is a React equivalent of Mapbox's\n Marker Control , which can\nbe used to render custom icons at specific locations on the map. Performance notes: if a large number of markers are needed, it's generally favorable to cache the nodes, so that we don't rerender them when the viewport changes. Properties latitude (Number, required) Latitude of the marker. longitude (Number, required) Longitude of the marker. offsetLeft (Number) default: 0 Offset of the marker from the left in pixels, negative number indicates left. offsetTop (Number) default: 0 Offset of the marker from the top in pixels, negative number indicates up. draggable (Boolean) default: false Allows this marker component to be dragged around the map. (Use onDragEnd to capture the final position and update longitude and latitude ). onDragStart (Function) Called when a draggable marker starts being dragged. Parameters: event - The pointer event. event.lngLat - The geo coordinates where the drag started, as [lng, lat] . onDrag (Function) Continuously called while a draggable marker is being dragged. Parameters: event - The pointer event. event.lngLat - The geo coordinates of the drag event, as [lng, lat] . onDragEnd (Function) Called when a draggable marker is released at its final position. This is usually a good time to capture event.lngLat and update the marker's longitude and latitude props. Parameters: event - The pointer event. event.lngLat - The geo coordinates where the drag ended, as [lng, lat] . className (String) Assign a custom class name to the container of this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source marker.js","headings":[{"value":"Marker","depth":1},{"value":"Properties","depth":2},{"value":"latitude (Number, required)","depth":5},{"value":"longitude (Number, required)","depth":5},{"value":"offsetLeft (Number)","depth":5},{"value":"offsetTop (Number)","depth":5},{"value":"draggable (Boolean)","depth":5},{"value":"onDragStart (Function)","depth":5},{"value":"onDrag (Function)","depth":5},{"value":"onDragEnd (Function)","depth":5},{"value":"className (String)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/marker","title":"Marker"},{"excerpt":"NavigationControl This is a React equivalent of Mapbox's NavigationControl ,\nwhich provides zoom buttons and a compass button. Properties onViewportChange (Function) Callback when the user interaction with this control requests a viewport update. If provided, will be called instead of the containing InteractiveMap 's onViewportChange . showCompass (Boolean) default: true Show or hide the compass button showZoom (Boolean) default: true Show or hide the zoom buttons zoomInLabel (String) default: Zoom In Label applied to the zoom in control button. zoomOutLabel (String) default: Zoom Out Label applied to the zoom out control button. compassLabel (String) default: Reset North Label applied to the compass control button. className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source navigation-control.js","headings":[{"value":"NavigationControl","depth":1},{"value":"Properties","depth":2},{"value":"onViewportChange (Function)","depth":5},{"value":"showCompass (Boolean)","depth":5},{"value":"showZoom (Boolean)","depth":5},{"value":"zoomInLabel (String)","depth":5},{"value":"zoomOutLabel (String)","depth":5},{"value":"compassLabel (String)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/navigation-control","title":"NavigationControl"},{"excerpt":"PointerEvent Event object passed to some of InteractiveMap 's callback props. Members type (String) The name of the event. point (Array) The screen coordinates that is being clicked. lngLat (Array) The geo coordinates that is being clicked. target (Element) The target element of the pointer event. srcEvent (Object) The original browser event.","headings":[{"value":"PointerEvent","depth":1},{"value":"Members","depth":2},{"value":"type (String)","depth":5},{"value":"point (Array)","depth":5},{"value":"lngLat (Array)","depth":5},{"value":"target (Element)","depth":5},{"value":"srcEvent (Object)","depth":5}],"slug":"docs/api-reference/pointer-event","title":"PointerEvent"},{"excerpt":"Popup This is a React equivalent of Mapbox's Popup Control , which can be used to\nshow tooltip popups with custom HTML content at specific locations on the map. Properties latitude (Number, required) Latitude of the anchor. longitude (Number, required) Longitude of the anchor. altitude (Number) default: 0 Altitude of the anchor. offsetLeft (Number) default: 0 Offset of the anchor from the left in pixels, negative number indicates left. offsetTop (Number) default: 0 Offset of the anchor from the top in pixels, negative number indicates up. closeButton (Boolean) default: true If true , a close button will appear in the top right corner of the popup. closeOnClick (Boolean) default: true If true , the popup will be closed when the map is clicked. tipSize (Number) default: 10 Size of the tip pointing to the coordinate. anchor (String) default: bottom A string indicating the popup's position relative to the coordinate.\nOptions are top , bottom , left , right , top-left , top-right , bottom-left , and bottom-right . dynamicPosition (Boolean) default: true If true , the anchor will be dynamically adjusted to ensure the popup falls within the map container. sortByDepth (Boolean) default: false If true , the order of the popups will be dynamically rearranged to ensure that the ones anchored closer to the camera are rendered on top. Useful when showing multiple popups in a tilted map. onClose (Function) Callback when the user closes the popup. className (String) Assign a custom class name to the container of this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source popup.js","headings":[{"value":"Popup","depth":1},{"value":"Properties","depth":2},{"value":"latitude (Number, required)","depth":5},{"value":"longitude (Number, required)","depth":5},{"value":"altitude (Number)","depth":5},{"value":"offsetLeft (Number)","depth":5},{"value":"offsetTop (Number)","depth":5},{"value":"closeButton (Boolean)","depth":5},{"value":"closeOnClick (Boolean)","depth":5},{"value":"tipSize (Number)","depth":5},{"value":"anchor (String)","depth":5},{"value":"dynamicPosition (Boolean)","depth":5},{"value":"sortByDepth (Boolean)","depth":5},{"value":"onClose (Function)","depth":5},{"value":"className (String)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/popup","title":"Popup"},{"excerpt":"ScaleControl This is a React equivalent of Mapbox's ScaleControl . Properties maxWidth (Number) default: 100 The maximum length of the scale control in pixels. unit (String) default: 'metric' Unit of the distance, one of 'imperial' , 'metric' or 'nautical' . className (String) Assign a custom class name to the container of this control. style (Object) default: {position: 'absolute'} A React style object applied to this control. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: true Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: true Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: true Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Styling Like its Mapbox counterpart, this control relies on the mapbox-gl stylesheet to work properly. Make sure to add the stylesheet to your page. Source scale-control.js","headings":[{"value":"ScaleControl","depth":1},{"value":"Properties","depth":2},{"value":"maxWidth (Number)","depth":5},{"value":"unit (String)","depth":5},{"value":"className (String)","depth":5},{"value":"style (Object)","depth":5},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Styling","depth":2},{"value":"Source","depth":2}],"slug":"docs/api-reference/scale-control","title":"ScaleControl"},{"excerpt":"Source This component allows apps to create a map source using React. It may contain Layer components as children. Properties The props provided to this component should be conforming to the Mapbox source specification or CanvasSourceOptions . Note that the map component's mapStyle prop defaults to mapbox://styles/mapbox/light-v8 . To use an empty base map with your own sources, you need to override the prop, e.g.: When props change shallowly , the component will attempt to update the source. Do not define objects/arrays inline to avoid perf hit. Once a is mounted, the following props should not change. If add/remove multiple JSX sources dynamically, make sure you use React's key prop to give each element a stable identity. id (String) Unique identifier of the source. If not provided, a default id will be assigned. type (String, required) Type of the source. Source source.js","headings":[{"value":"Source","depth":1},{"value":"Properties","depth":2},{"value":"id (String)","depth":5},{"value":"type (String, required)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/source","title":"Source"},{"excerpt":"StaticMap The simplest React wrapper around MapboxGL . This is designed to be completely\nstatic, and should be used to render a map with no interactivity. For a component\nthat supports full user interactivity, see InteractiveMap . Properties Initialization The following props are used during the creation of the Mapbox map. attributionControl (Boolean) default: true Equivalent to Mapbox's attributionControl option . If true , shows Mapbox's attribution control. disableTokenWarning (Boolean) default: false If the provided API access token is rejected by Mapbox, StaticMap renders a warning instead of failing silently. If you know what you are doing and want to hide this warning anyways, set this prop to true . gl (WebGLContext) This prop is experimental. Use an existing WebGLContext instead of creating a new one. This allows multiple libraries to render into a shared buffer. Use with caution. mapboxApiAccessToken (String) Mapbox API access token for MapboxGL . Required when using Mapbox vector tiles/styles\nMapbox WebGL context creation option. Useful when you want to export the canvas as a PNG mapboxApiUrl (String) default: https://api.mapbox.com Enables the use of private and country specific servers Mapbox servers, e.g. https://api.mapbox.cn/ . mapOptions (Object) default: {} Non-public API, see https://github.com/visgl/react-map-gl/issues/545 An object of additional options to be passed to Mapbox's Map constructor . Options specified here\nwill take precedence over those same options if set via props. preserveDrawingBuffer (Boolean) default: false Equivalent to Mapbox's preserveDrawingBuffer option . If true , the map's canvas can be exported to a PNG using map.getCanvas().toDataURL() . preventStyleDiffing (Boolean) default: false If mapStyle is assigned an Immutable object, when the prop changes, StaticMap can diff between the two values and call the appropriate Mapbox API such as addLayer , removeLayer , setStyle , setData , etc.\nThis allows apps to update data sources and layer styles efficiently. In use cases such as animation or dynamic showing/hiding layers, style diffing prevents the map from reloading and flickering when the map style changes. There are known issues with style diffing. As stopgap, use this option to prevent style diffing. reuseMaps (Boolean) default: false This prop is experimental. If true , when the map component is unmounted, instead of calling remove on the Mapbox map instance, save it for later reuse. This will avoid repeatedly creating new Mapbox map instances if possible. Applications that frequently mount and unmount maps may try this prop to help work around a mapbox-gl resource leak issue that can lead to a browser crash in certain situations. transformRequest (Function) default: null 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.\nExpected to return an object with a url property and optionally headers and credentials properties. Equivalent to Mapbox's transformRequest map option . Map State mapStyle (String | Object | Immutable.Map) default: 'mapbox://styles/mapbox/light-v8' The Mapbox style. A string url or a\n MapboxGL style \nobject (regular JS object or Immutable.Map). Whenever the mapStyle prop changes, the component will attempt to update the style of the underlying Mapbox map. The behavior can be further customized with the preventStyleDiffing prop. mapStyle is ignored when explicitly set to null . width (Number | String, required) The width of the map. Can be either a number in pixels, or a valid CSS string. height (Number | String, required) The height of the map. Can be either a number in pixels, or a valid CSS string. latitude (Number) The latitude of the center of the map, as a top level prop. Only used if viewState is not supplied. longitude (Number) The longitude of the center of the map, as a top level prop. Only used if viewState is not supplied. zoom (Number) The tile zoom level of the map, as a top level prop. Only used if viewState is not supplied. Bounded implicitly by default minZoom and maxZoom of MapboxGL bearing (Number) default: 0 Specify the bearing of the viewport, as a top level prop. Only used if viewState is not supplied. pitch (Number) default: 0 Specify the pitch of the viewport, as a top level prop. Only used if viewState is not supplied.. altitude (Number) default: 1.5 Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137 . Altitude of the viewport camera, relative to screen height. viewState (Object) An object containing the view state of the map specified by the following fields: latitude (Number) - The latitude of the center of the map. longitude (Number) - The longitude of the center of the map. zoom (Number) - The tile zoom level of the map. Bounded implicitly by default minZoom and maxZoom of MapboxGL . bearing (Number) - default: 0 - The bearing of the viewport. pitch (Number) - default: 0 - The pitch of the viewport. altitude (Number) - default: 1.5 screen heights Note: Either the viewState , or the latitude , longitude and zoom properties need to be specified. Render Options asyncRender (Boolean) default: false If true , let Mapbox manage its own render cycle. This is the behavior prior to v4.1. If false , force Mapbox canvas to redraw with DOM updates. This will make the map synchronize better with other controls during prop-driven viewport changes. style (Object) The CSS style of the map container. visible (Boolean) default: true Whether the map is visible. Unmounting and re-mounting a Mapbox instance is known to be costly. This option offers a way to hide a map using CSS style. visibilityConstraints (Object) An object that specifies bounds for viewport props with min* , max* keys. If the viewport props are outside of these constraints, the Mapbox map is automatically hidden. Default: { minZoom: 0, maxZoom: 20, minPitch: 0, maxPitch: 60 } Callbacks onLoad (Function) default: () => {} A callback run when the map emits a load event. Mapbox docs onResize (Function) default: () => {} A callback run when the map size has changed. onError (Function) default: console.error A callback run when the map emits an error event. Mapbox docs Methods getMap Returns the Mapbox instance if initialized. The Map instance will have full access to MapboxGL's API . getMap() queryRenderedFeatures Use Mapbox's queryRenderedFeatures API to find features at point or in a bounding box. If the parameters argument is not specified, only queries the layers with the interactive property in the layer style. queryRenderedFeatures(geometry, parameters) geometry { [Number, Number | [[Number, Number, [Number, Number - Point or an array of two points defining the bounding box. Coordinates in pixels. parameters - Query options. For more details, see Mapbox API documentation . Source static-map.js","headings":[{"value":"StaticMap","depth":1},{"value":"Properties","depth":2},{"value":"Initialization","depth":3},{"value":"attributionControl (Boolean)","depth":5},{"value":"disableTokenWarning (Boolean)","depth":5},{"value":"gl (WebGLContext)","depth":5},{"value":"mapboxApiAccessToken (String)","depth":5},{"value":"mapboxApiUrl (String)","depth":5},{"value":"mapOptions (Object)","depth":5},{"value":"preserveDrawingBuffer (Boolean)","depth":5},{"value":"preventStyleDiffing (Boolean)","depth":5},{"value":"reuseMaps (Boolean)","depth":5},{"value":"transformRequest (Function)","depth":5},{"value":"Map State","depth":3},{"value":"mapStyle (String | Object | Immutable.Map)","depth":5},{"value":"width (Number | String, required)","depth":5},{"value":"height (Number | String, required)","depth":5},{"value":"latitude (Number)","depth":5},{"value":"longitude (Number)","depth":5},{"value":"zoom (Number)","depth":5},{"value":"bearing (Number)","depth":5},{"value":"pitch (Number)","depth":5},{"value":"altitude (Number)","depth":5},{"value":"viewState (Object)","depth":5},{"value":"Render Options","depth":3},{"value":"asyncRender (Boolean)","depth":5},{"value":"style (Object)","depth":5},{"value":"visible (Boolean)","depth":5},{"value":"visibilityConstraints (Object)","depth":5},{"value":"Callbacks","depth":3},{"value":"onLoad (Function)","depth":5},{"value":"onResize (Function)","depth":5},{"value":"onError (Function)","depth":5},{"value":"Methods","depth":2},{"value":"getMap","depth":5},{"value":"queryRenderedFeatures","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/static-map","title":"StaticMap"},{"excerpt":"SVGOverlay Allows applications to overlay data on top of maps using a SVG container. Properties redraw (Function) Called every time the map updates. Parameters: width (Number) - width of the viewport height (Number) - height of the viewport project (Function) - get screen position [x, y] from geo coordinates [lng, lat] unproject (Function) - get geo coordinates [lng, lat] from screen position [x, y] style (Object) Additional css styles of the svg container. captureScroll (Boolean) default: false Stop propagation of mouse wheel event to the map component. Can be used to stop map from zooming when this component is scrolled. captureDrag (Boolean) default: false Stop propagation of dragstart event to the map component. Can be used to stop map from panning when this component is dragged. captureClick (Boolean) default: false Stop propagation of click event to the map component. Can be used to stop map from calling the onClick callback when this component is clicked. captureDoubleClick (Boolean) default: false Stop propagation of dblclick event to the map component. Can be used to stop map from zooming when this component is double clicked. capturePointerMove (Boolean) default: false Stop propagation of pointermove event to the map component. Can be used to stop map from calling the onMouseMove or onTouchMove callback when this component is hovered. Source svg-overlay.js","headings":[{"value":"SVGOverlay","depth":1},{"value":"Properties","depth":2},{"value":"redraw (Function)","depth":5},{"value":"style (Object)","depth":3},{"value":"captureScroll (Boolean)","depth":5},{"value":"captureDrag (Boolean)","depth":5},{"value":"captureClick (Boolean)","depth":5},{"value":"captureDoubleClick (Boolean)","depth":5},{"value":"capturePointerMove (Boolean)","depth":5},{"value":"Source","depth":2}],"slug":"docs/api-reference/svg-overlay","title":"SVGOverlay"},{"excerpt":"WebMercatorViewport The WebMercatorViewport class takes map camera states ( latitude , longitude , zoom , pitch , bearing etc.),\nand performs projections between world and screen coordinates. Constructor Parameter Type Default Description width number 1 Width of viewport height number 1 Height of viewport latitude number 0 Latitude of viewport center longitude number 0 Longitude of viewport center zoom number 11 Map zoom (scale is calculated as 2^zoom ) pitch number 0 The pitch (tilt) of the map from the screen, in degrees (0 is straight down) bearing number 0 The bearing (rotation) of the map from north, in degrees counter-clockwise (0 means north is up) fovy number see below Field of view of camera in degrees altitude number see below Altitude of camera in screen units position number[] null Offset of the camera, in meters Remarks: If either altitude or fovy is not provided, the missing value is computed from the other using altitudeToFovy() / fovyToAltitude() . Altitude has a default value that matches assumptions in mapbox-gl. It is only used if both altitude and fovy are not supplied. Field of view is independent from altitude, provide altitudeToFovy(1.5) (default value) to match assumptions in mapbox-gl width and height are forced to 1 if supplied as 0, to avoid\ndivision by zero. This is intended to reduce the burden of apps to\nto check values before instantiating a Viewport . When using Mercator projection, per cartographic tradition, longitudes and\nlatitudes are specified as degrees. Methods project(lngLatZ, options) Projects latitude and longitude to pixel coordinates on screen. Parameter Type Default Description lngLatZ Array (required) map coordinates, [lng, lat] or [lng, lat, Z] where Z is elevation in meters options Object {} named options options.topLeft Boolean true If true projected coords are top left, otherwise bottom left Returns: [x, y] or [x, y, z] in pixels coordinates. z is pixel depth. If input is [lng, lat] : returns [x, y] . If input is [lng, lat, Z] : returns [x, y, z] . Remarks: By default, returns top-left coordinates suitable for canvas/SVG type\nrendering. unproject(xyz, options) Unproject pixel coordinates on screen to longitude and latitude on map. Parameter Type Default Description xyz Array (required) pixel coordinates, [x, y] or [x, y, z] where z is pixel depth options Object {} named options options.topLeft Boolean true If true projected coords are top left, otherwise bottom left options.targetZ number 0 If pixel depth z is not specified in xyz , use options.targetZ as the desired elevation Returns: [lng, lat] or [longitude, lat, Z] in map coordinates. Z is elevation in meters. If input is [x, y] without specifying options.targetZ : returns [lng, lat] . If input is [x, y] with options.targetZ : returns [lng, lat, targetZ] . If input is [x, y, z] : returns [lng, lat, Z] . projectFlat(lngLat, scale) Project longitude and latitude onto Web Mercator coordinates. Parameter Type Default Description lngLat Array (required) map coordinates, [lng, lat] scale number this.scale Web Mercator scale Returns: [x, y] , representing Web Mercator coordinates. unprojectFlat(xy, scale) Unprojects a Web Mercator coordinate to longitude and latitude. Parameter Type Default Description xy Array (required) Web Mercator coordinates, [x, y] scale number this.scale Web Mercator scale Returns: [longitude, latitude] getBounds(options) Get the axis-aligned bounding box of the current visible area. options.z (number, optional) - To calculate a bounding volume for fetching 3D data, this option can be used to get the bounding box at a specific elevation. Default 0 . Returns: [[lon, lat], [lon, lat]] as the south west and north east corners of the smallest orthogonal bounds that encompasses the visible region. getBoundingRegion(options) Get the vertices of the current visible region. options.z (number, optional) - To calculate a bounding volume for fetching 3D data, this option can be used to get the bounding region at a specific elevation. Default 0 . Returns: An array of 4 corners in [longitude, latitude, altitude] that define the visible region. fitBounds(bounds, options: object) Get a new flat viewport that fits around the given bounding box. bounds ([ number,number , number,number ]) - an array of two opposite corners of\nthe bounding box. Each corner is specified in [lon, lat] . options.padding (number|{top:number, bottom: number, left: number, right: number}, optional) - The amount of\npadding in pixels to add to the given bounds from the edge of the viewport. If padding is set as object, all parameters are\nrequired. options.offset ( number,number , optional) - The center of the given bounds relative to the viewport's center, [x, y] measured in pixels. opts.minExtent (number, optional) - If supplied, the bounds used to calculate the new map settings will be expanded if the delta width or height of the supplied bounds is smaller than this value. opts.maxZoom = 24 (number, optional) - The returned zoom value will be capped to this value. Avoids returning infinite zoom when the supplied bounds have zero width or height deltas. Returns: A new WebMercatorViewport instance getMapCenterByLngLatPosition(options: object): [number, number] Get the map center that place a given lng, lat coordinate at screen point x, y . Parameters: options.lngLat (Array, required) - lng,lat coordinates of a location on the sphere. options.pos (Array, required) - x,y coordinates of a pixel on screen. Returns: [longitude, latitude] as the new map center","headings":[{"value":"WebMercatorViewport","depth":1},{"value":"Constructor","depth":2},{"value":"Methods","depth":2},{"value":"project(lngLatZ, options)","depth":5},{"value":"unproject(xyz, options)","depth":5},{"value":"projectFlat(lngLat, scale)","depth":5},{"value":"unprojectFlat(xy, scale)","depth":5},{"value":"getBounds(options)","depth":5},{"value":"getBoundingRegion(options)","depth":5},{"value":"fitBounds(bounds, options: object)","depth":5},{"value":"getMapCenterByLngLatPosition(options: object): [number, number]","depth":5}],"slug":"docs/api-reference/web-mercator-viewport","title":"WebMercatorViewport"},{"excerpt":"Contributing to react-map-gl Thanks for taking the time to contribute! PRs and bug reports are welcome, and we are actively looking for new maintainers. Setting Up Dev Environment The master branch is the active development branch. Building react-map-gl locally from the source requires node.js >=8 .\nWe use yarn to manage the dependencies. Test: Test in Node: Test in browser (can use Chrome dev tools for debugging): Pull Requests Any intended change to the code base must open a pull request and be approved. Generally speaking, all PRs are open against the master branch, unless the feature being affected no longer exists on master. PR Checklist Tests npm run test must be successful. New code should be covered by unit tests whenever possible. Documentation If public APIs are added/modified, update component documentation in docs/api-reference . Breaking changes and deprecations must be added to docs/upgrade-guide.md . Noteworthy new features should be added to docs/whats-new.md . Description on GitHub Link to relevant issue. Label with a milestone (latest release or vNext). If public APIs are added/modified, describe the intended behavior. If visual/interaction is affected, consider attaching a screenshot/GIF. Release react-map-gl follows the Semantic Versioning guidelines. Steps for publishing releases can be found here . Community Governance vis.gl is part of the Urban Computing Foundation . See the organization's Technical Charter . Technical Steering Committee react-map-gl development is governed by the vis.gl Technical Steering Committee (TSC). Maintainers Xiaoji Chen Xintong Xia Maintainers of react-map-gl have commit access to this GitHub repository, and take part in the decision making process. If you are interested in becoming a maintainer, read the governance guidelines . The vis.gl TSC meets monthly and publishes meeting notes via a mailing list .\nThis mailing list can also be utilized to reach out to the TSC. Code of Conduct Please be mindful of and adhere to the Linux Foundation's Code of Conduct when contributing to react-map-gl.","headings":[{"value":"Contributing to react-map-gl","depth":1},{"value":"Setting Up Dev Environment","depth":2},{"value":"Pull Requests","depth":2},{"value":"PR Checklist","depth":3},{"value":"Release","depth":2},{"value":"Community Governance","depth":2},{"value":"Technical Steering Committee","depth":3},{"value":"Maintainers","depth":3},{"value":"Code of Conduct","depth":2}],"slug":"docs/contributing","title":"Contributing to react-map-gl"},{"excerpt":"Upgrade Guide Upgrading to v5.3/v6.1 MapContext is now an official API. The experimental _MapContext export will be removed in a future release. react-virtualized-auto-sizer is no longer a dependency. Inertia has been enabled by default on the map controller. To revert to the behavior in previous versions, set the interaction options : Source and Layer components no longer expose imperative methods via ref as part of the migration to functional components. This is to comply with the pattern recommended by the latest React. If you used to call sourceRef.getSource() , it can be replaced with mapRef().getMap().getSource(sourceId) . If you used to call layerRef.getLayer() , it can be replaced with mapRef().getMap().getLayer(layerId) . Upgrading to v6 A valid Mapbox access token is always required. The default value of InteractiveMap 's maxPitch prop is changed to 85 from 60 . mapbox-gl v2 introduced a breaking change to the build system. Transpiling it may result in a crash in the production build with the message m is not defined . Find solutions in this thread . Upgrading to v4 onChangeViewport is removed, use onViewportChange instead Immutable.js is no longer a dependency Export experimental.MapControls is removed, use MapController instead InteractiveMap 's mapControls prop is renamed to controller Removed support for the deprecated interactive property on the layer styles. Use the interactiveLayerIds prop to specify which layers are clickable. Upgrading to v3.2 The latest mapbox-gl release requires stylesheet to be included at all times. See Get Started for information about styling. Immutable.js is no longer a hard dependency and will be removed in the next major release. If you are importing immutable in your application, it is recommended that you explicitly list it in the application's dependencies. Upgrading to v3 v3 is a major upgrade of react-map-gl. While we have tried to gently deprecated any changed or removed features, a few breaking changes could not be avoided. Version Requirements The Node Version Requirement for building react-map-gl is now >=v6.4.0 . Using prebuilt react-map-gl does NOT has this limitation. This is introduced by Mapbox GL JS v0.38.0 MapGL Component Two Map Components - v3 now splits the Map component into two React components: StaticMap and InteractiveMap . InteractiveMap is the default export, and designed to be as compatible as possible with the v2 default component. onChangeViewport callback now includes width and height . The viewport parameter passed to the onChangeViewport callback now includes width and height . Application code that composed the viewport with width and height may have to be updated. Please double check your render code if you relied on this behavior. Overlays Some Overlays Moved to Examples - Some less frequently used overlays ( DraggablePointsOverlay , ChoroplethOverlay , ScatterplotOverlay ), have been moved to examples. Most users are now using mapbox styles or deck.gl layers and removing these overlays reduces the size of the react-map-gl library for the majority of users that don't need them. If you still use them, simply copy the overlay source file(s) into your application. Overlays must be Children of the Map - Overlays must now be rendered as children of the main react-map-gl component to automatically sync with the map viewport. fitBounds utility function The fitBounds utility has been moved to the math.gl library. The function can now be called as follows: Deprecations We have started to deprecate a few React props. In all the cases below, the old props will still work (you'll get a warning in the console), but they will likely be removed in the next major version of react-map-gl so you should start using the new props as soon as possible. Old Prop New Prop onChangeViewport() onViewportChange() onHoverFeatures() onHover() onClickFeatures() onClick() perspectiveEnabled [default: false] dragRotate [default: true] Upgrading to v2 v2 is API compatible with v1, however if you are still using v1 of react-map-gl, make sure that you first upgrade: Your node version to v4 or higher Your react version to 15.4 or higher. Background: mapbox-gl 0.31.0 introduced a hard dependency on Node >= v4. Upgrading to v1 (Upgrading from 0.6.x) Importing Overlays - The map overlay components ( HTMLOverlay , CanvasOverlay , SVGOverlay etc) are now named exports. They previously had to be imported via their relative source paths: Map State - The map state reported by onViewportChanged will now contain additional state fields (tracking not only pitch and bearing needed for perspective mode, but also transient information about how the projection is being changed by the user). This information must be passed back to the react-map-gl component in the next render. To simplify and future proof applications, it is recommended to simply save the entire mapState in your app store whenever it changes and then pass it back to the component rather than trying to keep track of individual fields (like longitude , latitude and zoom ).","headings":[{"value":"Upgrade Guide","depth":1},{"value":"Upgrading to v5.3/v6.1","depth":2},{"value":"Upgrading to v6","depth":2},{"value":"Upgrading to v4","depth":2},{"value":"Upgrading to v3.2","depth":2},{"value":"Upgrading to v3","depth":2},{"value":"Version Requirements","depth":3},{"value":"MapGL Component","depth":3},{"value":"onChangeViewport callback now includes width and height.","depth":4},{"value":"Overlays","depth":3},{"value":"fitBounds utility function","depth":3},{"value":"Deprecations","depth":3},{"value":"Upgrading to v2","depth":2},{"value":"Upgrading to v1","depth":2}],"slug":"docs/upgrade-guide","title":"Upgrade Guide"},{"excerpt":"What's new react-map-gl v5.3/v6.1 Release date: Jan 27, 2020 Highlights TypeScript and Flow typings are now published with the library More controller customizations. Smooth easing on wheel scroll, three-finger gesture to change pitch, inertia after pan/pinch, and customizable keyboard navigation speed. See the updated interaction options for details. A new eventRecognizerOptions prop is added for fine-tuning the interaction experience. New component: AttributionControl Promoted to official API: MapContext Resolved React error over attempted state update during render GeolocateControl added supports for showAccuracyCircle All controls now support inline styling with a style prop All components and examples have been rewritten as functional components react-map-gl v6.0 Release date: Dec 16, 2020 What's Changed The 6.0 release upgrades its Mapbox GL JS dependency to v2.0. There are important changes to mapbox-gl's license and pricing model in this milestone. If you are NOT using a Mapbox account (e.g. self-hosting map tiles), do NOT upgrade to this version, and consider your options discussed in this document . See upgrade guide for a complete list of breaking changes. react-map-gl v5.2 Release date: Jan 6, 2020 Highlights New Components : ScaleControl NavigationControl : new label prop GeolocateControl : new label , onGeolocate , auto props New Export : WebMercatorViewport is re-exported from the viewport-mercator-project library for ease of use. It's recommended to import it from react-map-gl instead to avoid future dependency change. New Example : Clusters react-map-gl v5.1 Release date: Oct 30, 2019 Highlights New Components : Layer and Source have been added to provide better React parity with the Mapbox GL JS API. Viewport transition : transitionDuration can be set to 'auto' when using FlyToInterpolator . New Example : Add an example with drawing library react-map-gl-draw . react-map-gl v5.0 Release date: May 31, 2019 What's Changed The only change between the 5.0 release and the latest 4.1 release is Mapbox GL JS v1.0. By using this version, you opt into Mapbox's new pricing model, which bills per map load instead of map views. 5.0.x and 4.1.x will continue to update in parallel with otherwise identical features until November 2019 when Mapbox moves all users of 0.xx to a new pricing scheme. For more details, see mapbox's changelog and blog post . Alongside Mapbox GL JS's new milestone, we have relaxed the mapbox-gl dependency from locking minor release ( ~0.53.0 ) to major release ( ^1.0.0 ). This will allow developers to upgrade faster without waiting for a new release from react-map-gl. react-map-gl v4.1 Release date: Mar 14, 2019 Highlights New Components : FullscreenControl , GeolocateControl have been added to provide better React parity with the Mapbox GL JS API. New callback props InteractiveMap supports more callbacks: onNativeClick react-map-gl v4.0 Release date: Nov 5, 2018 Highlights Relative dimensions Both InteractiveMap and StaticMap now support CSS strings supplied to map width and height props. New onResize callback is fired when the map resizes. React 16 Upgrade to React 16.3 context and ref patterns Babel 7 Upgrade build system to Babel 7, better support for tree-shaking Style diffing Now use Mapbox's native style diffing. Immutable is no longer required. Draggable Markers Marker component now supports a new prop draggable , along with callbacks onDragStart , onDrag , and onDragEnd . 3d Popups Popup component now supports a new prop sortByDepth to enable proper occlusion when multiple popups are used in a tilted map. Interaction states onViewportChange is now called with richer descriptors of the user interaction, including isPanning , isZooming and isRotating . Interactive layers Dropped the requirement for the deprecated interactive property on the layer styles. Use the interactiveLayerIds prop to specify which layers are clickable. New callback props InteractiveMap supports more callbacks: onDblClick onMouseDown onMouseMove onMouseUp onTouchStart onTouchMove onTouchEnd onMouseEnter onMouseLeave onWheel onMouseOut See upgrade guide for breaking changes. react-map-gl v3.3 Release date: July, 2018 Highlights New viewState Property : Makes it possible to specify all map state properties ( longitude , latitude , zoom , bearing and pitch ) as a single property. New onViewStateChange callback : An alternative callback that matches the new viewState prop. react-map-gl v3.2 Realease date: January, 2018 Highlights Viewport transition : feature equivalent to Mapbox's flyTo and easeTo; smooth transition when using keyboard navigation or the NavigationControl. Better parity of Mapbox interaction : navigation using keyboard and the navigation control matches Mapbox behavior, including smooth transition when zooming and panning. Support for Map Reuse (experimental) : A new property reuseMaps is provided for applications that create and destroy maps, to help work around a mapbox-gl resource leak issue that can lead to a browser crash in certain situations. mapbox-gl 0.42.2 New props of the InteractiveMap component: Map creation: transformRequest , reuseMaps Interaction: touchZoom , touchRotate Transition: transitionDuration , transitionInterpolator , transitionEasing , transitionInterruption , onTransitionStart , onTransitionInterrupt , onTransitionEnd react-map-gl v3.1 Release date: October 19, 2017 Highlights Event handling Support right mouse drag to rotate Support keyboard navigation Allow controls and overlays to block map interactions React 16 - react-map-gl is now being tested with React 16, but the React peer dependency requirement is unchanged at >=15.4.x . mapbox-gl v0.40.1 No Token warning : react-map-gl now renders an HTML message if no mapbox token is supplied. react-map-gl v3.0 Release date: July 27th, 2017 Highlights Latest Mapbox GL JS : Bumps Mapbox GL JS to 0.38 . Multi-Touch Support : Full support for multi-touch gestures such as pinch-to-zoom and rotate. New Components : The MapGL component has been split into StaticMap and InteractiveMap (the default). Also, Popup , Marker , NavigationControl have been added to provide better React parity with the Mapbox GL JS API. Improved Overlay Components : Supplying viewport props ( width height zoom longitude and latitude ) are no longer required if you render SVGOverlay , CanvasOverlay or HTMLOverlay as a child of the map. Perspective mode is now supported in all overlays. New Props : maxPitch , minPitch , dragPan , doubleClickZoom , touchZoomRotate ,\n scrollZoom are now provided to allow granular control of map interactivity. Documentation : Significantly expanded and linked with our other geospatial frameworks. Examples : New stand-alone examples to get you started instantly with the new features. Event Handling : New event handling architecture that enables full customization of event handling (experimental). Components InteractiveMap (New, MapGL replacement) This is a wrapper on top of StaticMap . It takes all the props of StaticMap and additional ones such as onViewportChange , scrollZoom , dragRotate , etc. to control interactivity on the map. See Source Code for more information. StaticMap (New) This is the React wrapper around Mapbox GL JS and takes in viewport properties such as width , height , latitude , longitude . Style diffing and updating logic also live here. See Source Code for more information. Overlays Three overlays ( ScatterplotOverlay , DraggablePointsOverlay , ChoroplethOverlay ), have been moved out of the library and are now only provided as examples. Property Changes Property Names - some prop names have been modernized, the old ones will still work for now with a warning. Internal Properties such as isHovering , isDragging , startDragLngLat have been removed.\nThese were never meant to be useful publicly and have caused confusions in the past. Utilities fitBounds : fitBounds has been moved to another repository and has been rewritten to provide a more logical interface. For more information, see the Upgrade Guide . react-map-gl v2.0 Date: Jan 17, 2017 Highlights Latest mapbox-gl : Bump mapbox-gl to v0.31.0 new maxZoom prop - Add maxZoom prop and defaults to 20 New onLoad prop - Add onLoad event handler new onClick prop - Add onClick prop handler (#140) react-map-gl v1.0 Perspective Mode - Now supports bearing and pitch properties, per mapbox-gl api documentation. These props default to 0 which means that maps will still be rendered in flat/ortographic mode when they are not provided Support for ES6 imports - The map overlay components (HTMLOverlay, CanvasOverlay, SVGOverlay etc) previously had to be imported via their relative source paths can now be imported directly using `import {SVGOverlay} from 'react-map-gl'. react-map-gl v0.6 Initial public version","headings":[{"value":"What's new","depth":1},{"value":"react-map-gl v5.3/v6.1","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v6.0","depth":2},{"value":"What's Changed","depth":3},{"value":"react-map-gl v5.2","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v5.1","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v5.0","depth":2},{"value":"What's Changed","depth":3},{"value":"react-map-gl v4.1","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v4.0","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v3.3","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v3.2","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v3.1","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v3.0","depth":2},{"value":"Highlights","depth":3},{"value":"Components","depth":3},{"value":"InteractiveMap (New, MapGL replacement)","depth":4},{"value":"StaticMap (New)","depth":4},{"value":"Overlays","depth":4},{"value":"Property Changes","depth":3},{"value":"Utilities","depth":3},{"value":"react-map-gl v2.0","depth":2},{"value":"Highlights","depth":3},{"value":"react-map-gl v1.0","depth":2},{"value":"react-map-gl v0.6","depth":2}],"slug":"docs/whats-new","title":"What's new"},{"excerpt":"Adding Custom Data Native Mapbox Layers You can inject data and mapbox native layers using the Source and Layer components: For details about data sources and layer configuration, check out the Mapbox style specification . For dynamically updating data sources and layers, check out the GeoJSON and GeoJSON animation examples. Overlays react-map-gl provides a basic overlay API that enables applications to overlay data on top of maps.\nThey are great for creating light-weight custom drawings. Example Built-in Overlays SVGOverlay HTMLOverlay CanvasOverlay Example Overlays There are a couple of additional overlays in the examples folder that can be copied into applications ScatterplotOverlay , ChoroplethOverlay . Third-party overlays are also available. For example, the heatmap-overlay module uses webgl-heatmap to create geographic heatmaps. Other vis.gl Libraries For more feature rich and performant data visualization overlay use cases, you may consider using other visualization libraries. react-map-gl is part of the vis.gl ecosystem, a suite of high-performance data visualization tools for the Web. deck.gl - WebGL-powered framework for the visualization of large datasets. loaders.gl - loaders for file formats focused on visualization of big data, including point clouds, 3D geometries, images, geospatial formats as well as tabular data. nebula.gl - 3D-enabled GeoJSON editing based on deck.gl and React.","headings":[{"value":"Adding Custom Data","depth":1},{"value":"Native Mapbox Layers","depth":2},{"value":"Overlays","depth":2},{"value":"Example","depth":3},{"value":"Built-in Overlays","depth":3},{"value":"Example Overlays","depth":3},{"value":"Other vis.gl Libraries","depth":2}],"slug":"docs/get-started/adding-custom-data","title":"Adding Custom Data"},{"excerpt":"FAQ Enable Right-to-Left Language Support This is the same as import {setRTLTextPlugin} from 'mapbox-gl' in the browser, but will not crash in node. The export mainly offers a convenience when using server-side rendering. To use this API, consult Mapbox's setRTLTextPlugin documentation. Where is fitBounds? You can use the WebMercatorViewport utility to find the target viewport that fits around a longitude-latitude bounding box: Documentation of WebMercatorViewport I called flyTo/panTo and all controls went out of sync You cannot manipulate the map camera via getMap() and the native mapbox-gl API. To conform to the reactive programming paradigm, all camera changes should be driven by prop changes on the React component. Circumventing this will break the binding between React components and the underlying map instance. Instead, use the InteractiveMap 's transition props. See viewport transition for examples. mapbox-gl-draw does not work with react-map-gl Unfortunately, react-map-gl implements its own interative logic and disables the native event handling of mapbox-gl. Short explanation: mapbox-gl is not designed to support React. Long explanation: When using react-map-gl, we have two asynchronous rendering loops, React and Mapbox. Mapbox's move events are only fired after the camera changes and there is no way to control how and when the map rerenders. If we update React states upon the move events, all React controls/overlays may only get updated one animation frame after the map rerender. You can find discussions here and here . Because of this, any mapbox-gl control that listens to the native map events will not work. An equivelant to mapbox-gl-draw is react-map-gl-draw . You can find an example here .","headings":[{"value":"FAQ","depth":1},{"value":"Enable Right-to-Left Language Support","depth":2},{"value":"Where is fitBounds?","depth":2},{"value":"I called flyTo/panTo and all controls went out of sync","depth":2},{"value":"mapbox-gl-draw does not work with react-map-gl","depth":2}],"slug":"docs/get-started/faq","title":"FAQ"},{"excerpt":"Get Started Installation Using react-map-gl requires node >= v4 and react >= 16.3 . Example See full project setup in get-started examples Styling The current mapbox-gl release requires its stylesheet be included at all times. The marker, popup and navigation components in react-map-gl also need the stylesheet to work properly. You may add the stylesheet to the head of your page: Find out your mapbox version by running yarn list mapbox-gl or npm ls mapbox-gl . Or embed it in your app by using - browserify-css \nwith Browserify or - css-loader with Webpack: Using with Browserify, Webpack, and other JavaScript Bundlers browserify - react-map-gl is extensively tested with browserify and works without configuration. webpack - Most of the provided react-map-gl examples use webpack. Look at the get started examples folder for minimalist templates. create-react-app - react-map-gl is compatible with create-react-app . create-react-app-typescript - react-map-gl is compatible with create-react-app-typescript . You can see an example here . There's many other ready-to-run examples you can take a look at if you need more inspiration. Using with a mapbox-gl Fork Install your choice of fork along with react-map-gl, for example: In your bundler's configuration, set the forked library to replace any reference from mapbox-gl. This can be done in Webpack with something like: In rollup: In Next.js:","headings":[{"value":"Get Started","depth":1},{"value":"Installation","depth":2},{"value":"Example","depth":2},{"value":"Styling","depth":2},{"value":"Using with Browserify, Webpack, and other JavaScript Bundlers","depth":2},{"value":"Using with a mapbox-gl Fork","depth":2}],"slug":"docs/get-started/get-started","title":"Get Started"},{"excerpt":"About Mapbox Tokens react-map-gl itself is open source and free. It provides a React wrapper for mapbox-gl or derived projects.\nDepending on which Mapbox GL JS version (or fork) you use, you may need a Mapbox token. You will need a Mapbox token if you use: react-map-gl@>=6.0.0 , depending on mapbox-gl@>=2.0.0 and above - requires a mapbox access token in order to access the map renderer, and generates billable events regardlesss of whether you are displaying your own maps. react-map-gl@5.x , depending on mapbox-gl@1.x - requires an access token only if you load the map styles and tiles from Mapbox's data service. See \"Display Maps Without A Mapbox Token\" section below for using non-Mapbox tiles. To get a Mapbox token, you will need to register on their website . The token will be used to identify you and start serving up map tiles. The service is free until a certain level of traffic is exceeded. There are several ways to provide a token to your app, as showcased in some of the example folders: Provide a mapboxApiAccessToken prop to the map component Set the MapboxAccessToken environment variable (or set REACT_APP_MAPBOX_ACCESS_TOKEN if you are using Create React App) Provide it in the URL, e.g ?access_token=TOKEN Provide mapboxApiUrl prop to the map component to override the default mapbox API URL But we would recommend using something like dotenv and put your key in an untracked .env file, that will then expose it as a process.env variable, with much less leaking risks. Display Maps Without A Mapbox Token It is possible to use the map component without the Mapbox service, if you use another tile source (for example, if you host your own map tiles). Note that this is no longer allowed using mapbox-gl v2.0 and above. The options are: Stay on react-map-gl@5.x and mapbox-gl@1.x . react-map-gl plans to continue supporting this release in the foreseeable future, however, this version will not include any of the latest features of the map renderer, nor get any future updates from Mapbox. Use a community fork of mapbox-gl, for example maplibre-gl . See using with a mapbox-gl fork for how to configure your project. To use your own map service, you will need a custom Mapbox GL style that points to your own vector tile source , and pass it to ReactMapGL using the mapStyle prop. This custom style must match the schema of your tile source. Open source tile schemas include: TileZen schema OpenMapTiles schema Some useful resources for creating your own map service: Mapbox Vector Tile Spec Open source tools If you are using a third party service that requires header based authentication, you can do this by defining a function to pass to ReactMapGL using the transformRequest prop. An example function:","headings":[{"value":"About Mapbox Tokens","depth":1},{"value":"Display Maps Without A Mapbox Token","depth":2}],"slug":"docs/get-started/mapbox-tokens","title":"About Mapbox Tokens"},{"excerpt":"State Management InteractiveMap is designed to be a stateless component. Its appearance is entirely controlled by the properties that are passed in from its parent. In this architecture, transition works the same way as interaction: the component shall notify the application of \"user intent\" by calling the onViewportChange callback, but ultimately the application needs to decide what to do with it. The most simple handling of this intent is to save it and pass it back to the component: User interaction and transition will not work without a valid onViewportChange handler. The advantage of this practice is that it ensures a single source of truth regarding the viewport state (in the example above, saved in the state of the container component). When you use this viewport state to direct the rendering of other components, it is guaranteed that they will always be synced with the map. You may apply additional constraints to the viewport: Or manipulate the viewport outside of the ReactMap component: Using with Redux If you're using redux, it is very easy to hook this component up to store state in the redux state tree.\nThe simplest way is to take all properties passed to the onViewportChange function property and add them\ndirectly into the store. This state can then be passed back to the component without any transformation.","headings":[{"value":"State Management","depth":1},{"value":"Using with Redux","depth":2}],"slug":"docs/get-started/state-management","title":"State Management"}]}},"staticQueryHashes":["484347790"]} \ No newline at end of file diff --git a/search/index.html b/search/index.html index 22e994dc..2c62400e 100644 --- a/search/index.html +++ b/search/index.html @@ -64,4 +64,4 @@ body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;} *{box-sizing:bor } } }) -
    Search
    32 articles indexed.
    \ No newline at end of file +
    Search
    32 articles indexed.
    \ No newline at end of file diff --git a/webpack-runtime-3a81eb65abfc940bc22b.js b/webpack-runtime-8f269beabc6fe82c4dec.js similarity index 96% rename from webpack-runtime-3a81eb65abfc940bc22b.js rename to webpack-runtime-8f269beabc6fe82c4dec.js index d0122cb3..e91d2e78 100644 --- a/webpack-runtime-3a81eb65abfc940bc22b.js +++ b/webpack-runtime-8f269beabc6fe82c4dec.js @@ -1 +1 @@ -!function(e){function a(a){for(var t,c,p=a[0],s=a[1],f=a[2],l=0,u=[];l