diff --git a/dist/vue-mapbox.min.js b/dist/vue-mapbox.min.js index 60dd5a28..4ba34932 100644 --- a/dist/vue-mapbox.min.js +++ b/dist/vue-mapbox.min.js @@ -1 +1 @@ -window.VueMapbox=function(t){function e(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var o={};return e.m=t,e.c=o,e.i=function(t){return t},e.d=function(t,o,i){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=20)}([function(t,e){t.exports=function(t,e,o,i,n){var r,a=t=t||{},s=typeof t.default;"object"!==s&&"function"!==s||(r=t,a=t.default);var u="function"==typeof a?a.options:a;e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns),i&&(u._scopeId=i);var c;if(n?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},u._ssrRegister=c):o&&(c=o),c){var d=u.functional,l=d?u.render:u.beforeCreate;d?u.render=function(t,e){return c.call(e),l(t,e)}:u.beforeCreate=l?[].concat(l,c):[c]}return{esModule:r,exports:a,options:u}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};this.$emit(t,i({map:this.map,component:this},e))},$_bindSelfEvents:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==t.length&&(o=o||this.map,t.forEach(function(t){o.on(t,function(o){e.$_emitMapEvent(""+t,{mapEvent:o})})}))},$_unbindSelfEvents:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==t.length&&(o=o||this.map,t.forEach(function(t){o.off(t,e.layerId)}))}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={beforeDestroy:function(){void 0!==this.map&&this.map.removeControl(this.control)}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o={mapbox:e.mapboxgl};e.plugins&&e.plugins.length&&e.plugins.forEach(function(t){var e=Object.keys(t)[0],i=Object.values(t)[0];o[e]=i}),t.mixin({data:function(){return o}})}});e.default=j},function(t,e,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];return this.map.supported({failIfMajorPerformanceCaveat:t})},resize:function(){this.map.resize()},project:function(t){return this.map.project(t)},unproject:function(t){return this.map.unproject(t)},queryRenderedFeatures:function(t,e){return this.map.queryRenderedFeatures(t,e)},getFeatureState:function(t){return this.map.getFeatureState(t)},setFeatureState:function(t,e){return this.map.setFeatureState(t,e)},querySourceFeatures:function(t,e){return this.map.querySourceFeatures(t,e)},cameraForBounds:function(t,e){return this.map.cameraForBounds(t,e)},addImage:function(t,e,o){return this.map.addImage(t,e,o)},hasImage:function(t){return this.map.hasImage(t)},removeImage:function(t){return this.map.removeImage(t)},loadImage:function(t,e){return this.map.loadImage(t,e)},$_catchMoveFabric:function(t,e,o){var i=this;return function o(n){if(n.eventId===t.eventId){var r=i.map.getCenter();return i.$emit("update:center",r),i.map.off("moveend",o),e({eventData:t,center:r})}}},$_catchZoomFabric:function(t,e,o){var i=this;return function o(n){if(n.eventId===t.eventId){var r=i.map.getZoom();return i.$emit("update:zoom",r),i.map.off("zoomend",o),e({eventData:t,zoom:r})}}},$_catchRotateFabric:function(t,e,o){var i=this;return function o(n){if(n.eventId===t.eventId){var r=i.map.getBearing();i.$emit("update:bearing",r),i.map.off("rotate",o),e({eventData:t,bearing:r})}}},$_catchPitchFabric:function(t,e,o){var i=this;return function o(n){if(n.eventId===t.eventId){var r=i.map.getPitch();i.$emit("update:pitch",r),i.map.off("pitch",o),e({eventData:t,pitch:r})}}},panBy:function(t,e){var o=this,i={eventId:"panBy-"+(""+Math.random()).split(".")[1]};return 0===t[0]&&0===t[1]?new Promise(function(t,e){return t({center:o.map.getCenter()})}):new Promise(function(n,r){o.map.on("moveend",o.$_catchMoveFabric(i,n,r)),o.map.panBy(t,e,i)})},panTo:function(t,e){var o=this;t instanceof Array||(t=t.toArray());var i={eventId:"panTo-"+(""+Math.random()).split(".")[1]};return 0===t[0]&&0===t[1]?new Promise(function(t,e){return t({eventData:i,center:o.map.getCenter()})}):new Promise(function(n,r){o.map.on("moveend",o.$_catchMoveFabric(i,n,r)),o.map.panTo(t,e,i)})},zoomTo:function(t,e){var o=this,i={eventId:"zoomTo-"+(""+Math.random()).split(".")[1]};return t===this.map.getZoom()?new Promise(function(t,e){return t({eventData:i,zoom:o.map.getZoom()})}):new Promise(function(n,r){o.map.on("zoomend",o.$_catchZoomFabric(i,n,r)),o.map.zoomTo(t,e,i)})},zoomIn:function(t){var e=this;return new Promise(function(o,i){var n={eventId:"zoomIn-"+(""+Math.random()).split(".")[1]};e.map.on("zoomend",e.$_catchZoomFabric(n,o,i)),e.map.zoomIn(t,n)})},zoomOut:function(t){var e=this;return new Promise(function(o,i){var n={eventId:"zoomOut-"+(""+Math.random()).split(".")[1]};e.map.on("zoomend",e.$_catchZoomFabric(n,o,i)),e.map.zoomOut(t,n)})},rotateTo:function(t,e){var o=this;return t===this.map.getBearing()?new Promise(function(t,e){return t({bearing:o.map.getBearing()})}):new Promise(function(i,n){var r={eventId:"rotateTo-"+(""+Math.random()).split(".")[1]};o.map.on("rotate",o.$_catchRotateFabric(r,i,n)),o.map.rotateTo(t,e,r)})},resetNorth:function(t){var e=this;return new Promise(function(o,i){var n={eventId:"resetNorth-"+(""+Math.random()).split(".")[1]};e.map.on("rotate",e.$_catchRotateFabric(n,o,i)),e.map.resetNorth(t,n)})},snapToNorth:function(t){var e=this;return new Promise(function(o,i){var n={eventId:"snapToNorth-"+(""+Math.random()).split(".")[1]};e.map.on("rotate",e.$_catchRotateFabric(n,o,i)),e.map.snapToNorth(t,n)})},fitBounds:function(t,e){var o=this,i={eventId:"fitBounds-"+(""+Math.random()).split(".")[1]};if(t===this.map.getBounds())return new Promise(function(t,e){return t({eventData:i,bounds:o.map.getBounds()})});var n=new Promise(function(t,e){o.map.on("zoomend",o.$_catchZoomFabric(i,t,e))}),r=new Promise(function(t,e){o.map.on("moveend",o.$_catchMoveFabric(i,t,e))});return this.map.fitBounds(t,e,i),Promise.all([n,r]).then(function(t){return{eventData:i,bounds:o.map.getBounds()}})},jumpTo:function(t){var e=this,o={eventId:"jumpTo-"+(""+Math.random()).split(".")[1]},i=[];if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,i){e.map.on("rotate",e.$_catchRotateFabric(o,t,i))});i.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,i){e.map.on("zoomend",e.$_catchZoomFabric(o,t,i))});i.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,i){e.map.on("moveend",e.$_catchMoveFabric(o,t,i))});i.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,i){e.map.on("pitch",e.$_catchPitchFabric(o,t,i))});i.push(u)}return 0===i.length?new Promise(function(t,i){t({eventData:o,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.jumpTo(t,o),Promise.all(i).then(function(t){var e={},i=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!i&&u.return&&u.return()}finally{if(r)throw a}}return n({},e,{eventData:o})}))},easeTo:function(t){var e=this,o=[],i={eventId:"easeTo-"+(""+Math.random()).split(".")[1]};if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,o){e.map.on("rotate",e.$_catchRotateFabric(i,t,o))});o.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,o){e.map.on("zoomend",e.$_catchZoomFabric(i,t,o))});o.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,o){e.map.on("moveend",e.$_catchMoveFabric(i,t,o))});o.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,o){e.map.on("pitch",e.$_catchPitchFabric(i,t,o))});o.push(u)}return 0===o.length?new Promise(function(t,o){t({eventData:i,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.easeTo(t,i),Promise.all(o).then(function(t){var e={},o=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!o&&u.return&&u.return()}finally{if(r)throw a}}return n({},e,{eventData:i})}))},flyTo:function(t){var e=this,o={eventId:"flyTo-"+(""+Math.random()).split(".")[1]},i=[];if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,i){e.map.on("rotate",e.$_catchRotateFabric(o,t,i))});i.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,i){e.map.on("zoomend",e.$_catchZoomFabric(o,t,i))});i.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,i){e.map.on("moveend",e.$_catchMoveFabric(o,t,i))});i.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,i){e.map.on("pitch",e.$_catchPitchFabric(o,t,i))});i.push(u)}return 0===i.length?new Promise(function(t,i){t({eventData:o,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.flyTo(t,o),Promise.all(i).then(function(t){var e={},i=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!i&&u.return&&u.return()}finally{if(r)throw a}}return n({},e,{eventData:o})}))},stop:function(){this.map.stop();var t=[this.map.getPitch(),this.map.getZoom(),this.map.getBearing(),this.map.getCenter()],e=t[0],o=t[1],i=t[2],n=t[3];return this.$emit("update:pitch",e),this.$emit("update:zoom",o),this.$emit("update:bearing",i),this.$emit("update:center",n),Promise.resolve({pitch:e,zoom:o,bearing:i,center:n})}}}},function(t,e,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=i(n),a=o(2),s=i(a);e.default={name:"AttributionControl",mixins:[r.default,s.default],props:{compact:{type:Boolean,default:!0}},data:function(){return{control:void 0}},created:function(){this.control=new this.mapbox.AttributionControl({compact:this.compact})},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=i(n),a=o(2),s=i(a);e.default={name:"FullscreenControl",mixins:[r.default,s.default],props:{position:{type:String,default:"top-right"}},data:function(){return{control:void 0}},created:function(){this.control=new this.mapbox.FullscreenControl},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control,this.position),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=i(n),a=o(2),s=i(a);e.default={name:"GeolocateControl",mixins:[r.default,s.default],props:{position:{type:String,default:"top-right"},positionOptions:{type:Object,default:function(){return{enableHighAccuracy:!1,timeout:6e3}}},watchPosition:{type:Boolean,default:!1}},data:function(){return{control:void 0}},created:function(){var t=this;this.control=new this.mapbox.GeolocateControl(this._props),this.control.on("error",function(e){t.$emit("geolocate-error",e)}),this.control.on("geolocate",function(e){t.$emit("geolocate-error",e)})},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};this.$emit(t,n({map:this.map,component:this},e))},$_bindSelfEvents:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==t.length&&(o=o||this.map,t.forEach(function(t){o.on(t,function(o){e.$_emitMapEvent(""+t,{mapEvent:o})})}))},$_unbindSelfEvents:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==t.length&&(o=o||this.map,t.forEach(function(t){o.off(t,e.layerId)}))}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={beforeDestroy:function(){void 0!==this.map&&this.map.removeControl(this.control)}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o={mapbox:e.mapboxgl};e.plugins&&e.plugins.length&&e.plugins.forEach(function(t){var e=Object.keys(t)[0],n=Object.values(t)[0];o[e]=n}),t.mixin({data:function(){return o}})}});e.default=j},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];return this.map.supported({failIfMajorPerformanceCaveat:t})},resize:function(){this.map.resize()},project:function(t){return this.map.project(t)},unproject:function(t){return this.map.unproject(t)},queryRenderedFeatures:function(t,e){return this.map.queryRenderedFeatures(t,e)},getFeatureState:function(t){return this.map.getFeatureState(t)},setFeatureState:function(t,e){return this.map.setFeatureState(t,e)},querySourceFeatures:function(t,e){return this.map.querySourceFeatures(t,e)},cameraForBounds:function(t,e){return this.map.cameraForBounds(t,e)},addImage:function(t,e,o){return this.map.addImage(t,e,o)},hasImage:function(t){return this.map.hasImage(t)},removeImage:function(t){return this.map.removeImage(t)},loadImage:function(t,e){return this.map.loadImage(t,e)},$_catchMoveFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getCenter();return n.$emit("update:center",r),n.map.off("moveend",o),e({eventData:t,center:r})}}},$_catchZoomFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getZoom();return n.$emit("update:zoom",r),n.map.off("zoomend",o),e({eventData:t,zoom:r})}}},$_catchRotateFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getBearing();n.$emit("update:bearing",r),n.map.off("rotate",o),e({eventData:t,bearing:r})}}},$_catchPitchFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getPitch();n.$emit("update:pitch",r),n.map.off("pitch",o),e({eventData:t,pitch:r})}}},panBy:function(t,e){var o=this,n={eventId:"panBy-"+(""+Math.random()).split(".")[1]};return 0===t[0]&&0===t[1]?new Promise(function(t,e){return t({center:o.map.getCenter()})}):new Promise(function(i,r){o.map.on("moveend",o.$_catchMoveFabric(n,i,r)),o.map.panBy(t,e,n)})},panTo:function(t,e){var o=this;t instanceof Array||(t=t.toArray());var n={eventId:"panTo-"+(""+Math.random()).split(".")[1]};return 0===t[0]&&0===t[1]?new Promise(function(t,e){return t({eventData:n,center:o.map.getCenter()})}):new Promise(function(i,r){o.map.on("moveend",o.$_catchMoveFabric(n,i,r)),o.map.panTo(t,e,n)})},zoomTo:function(t,e){var o=this,n={eventId:"zoomTo-"+(""+Math.random()).split(".")[1]};return t===this.map.getZoom()?new Promise(function(t,e){return t({eventData:n,zoom:o.map.getZoom()})}):new Promise(function(i,r){o.map.on("zoomend",o.$_catchZoomFabric(n,i,r)),o.map.zoomTo(t,e,n)})},zoomIn:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"zoomIn-"+(""+Math.random()).split(".")[1]};e.map.on("zoomend",e.$_catchZoomFabric(i,o,n)),e.map.zoomIn(t,i)})},zoomOut:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"zoomOut-"+(""+Math.random()).split(".")[1]};e.map.on("zoomend",e.$_catchZoomFabric(i,o,n)),e.map.zoomOut(t,i)})},rotateTo:function(t,e){var o=this;return t===this.map.getBearing()?new Promise(function(t,e){return t({bearing:o.map.getBearing()})}):new Promise(function(n,i){var r={eventId:"rotateTo-"+(""+Math.random()).split(".")[1]};o.map.on("rotate",o.$_catchRotateFabric(r,n,i)),o.map.rotateTo(t,e,r)})},resetNorth:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"resetNorth-"+(""+Math.random()).split(".")[1]};e.map.on("rotate",e.$_catchRotateFabric(i,o,n)),e.map.resetNorth(t,i)})},snapToNorth:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"snapToNorth-"+(""+Math.random()).split(".")[1]};e.map.on("rotate",e.$_catchRotateFabric(i,o,n)),e.map.snapToNorth(t,i)})},fitBounds:function(t,e){var o=this,n={eventId:"fitBounds-"+(""+Math.random()).split(".")[1]};if(t===this.map.getBounds())return new Promise(function(t,e){return t({eventData:n,bounds:o.map.getBounds()})});var i=new Promise(function(t,e){o.map.on("zoomend",o.$_catchZoomFabric(n,t,e))}),r=new Promise(function(t,e){o.map.on("moveend",o.$_catchMoveFabric(n,t,e))});return this.map.fitBounds(t,e,n),Promise.all([i,r]).then(function(t){return{eventData:n,bounds:o.map.getBounds()}})},jumpTo:function(t){var e=this,o={eventId:"jumpTo-"+(""+Math.random()).split(".")[1]},n=[];if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,n){e.map.on("rotate",e.$_catchRotateFabric(o,t,n))});n.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,n){e.map.on("zoomend",e.$_catchZoomFabric(o,t,n))});n.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,n){e.map.on("moveend",e.$_catchMoveFabric(o,t,n))});n.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,n){e.map.on("pitch",e.$_catchPitchFabric(o,t,n))});n.push(u)}return 0===n.length?new Promise(function(t,n){t({eventData:o,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.jumpTo(t,o),Promise.all(n).then(function(t){var e={},n=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:o})}))},easeTo:function(t){var e=this,o=[],n={eventId:"easeTo-"+(""+Math.random()).split(".")[1]};if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,o){e.map.on("rotate",e.$_catchRotateFabric(n,t,o))});o.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,o){e.map.on("zoomend",e.$_catchZoomFabric(n,t,o))});o.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,o){e.map.on("moveend",e.$_catchMoveFabric(n,t,o))});o.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,o){e.map.on("pitch",e.$_catchPitchFabric(n,t,o))});o.push(u)}return 0===o.length?new Promise(function(t,o){t({eventData:n,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.easeTo(t,n),Promise.all(o).then(function(t){var e={},o=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!o&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:n})}))},flyTo:function(t){var e=this,o={eventId:"flyTo-"+(""+Math.random()).split(".")[1]},n=[];if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,n){e.map.on("rotate",e.$_catchRotateFabric(o,t,n))});n.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,n){e.map.on("zoomend",e.$_catchZoomFabric(o,t,n))});n.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,n){e.map.on("moveend",e.$_catchMoveFabric(o,t,n))});n.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,n){e.map.on("pitch",e.$_catchPitchFabric(o,t,n))});n.push(u)}return 0===n.length?new Promise(function(t,n){t({eventData:o,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.flyTo(t,o),Promise.all(n).then(function(t){var e={},n=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:o})}))},stop:function(){this.map.stop();var t=[this.map.getPitch(),this.map.getZoom(),this.map.getBearing(),this.map.getCenter()],e=t[0],o=t[1],n=t[2],i=t[3];return this.$emit("update:pitch",e),this.$emit("update:zoom",o),this.$emit("update:bearing",n),this.$emit("update:center",i),Promise.resolve({pitch:e,zoom:o,bearing:n,center:i})}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"AttributionControl",mixins:[r.default,s.default],props:{compact:{type:Boolean,default:!0}},data:function(){return{control:void 0}},created:function(){this.control=new this.mapbox.AttributionControl({compact:this.compact})},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"FullscreenControl",mixins:[r.default,s.default],props:{position:{type:String,default:"top-right"}},data:function(){return{control:void 0}},created:function(){this.control=new this.mapbox.FullscreenControl},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control,this.position),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"GeolocateControl",mixins:[r.default,s.default],props:{position:{type:String,default:"top-right"},positionOptions:{type:Object,default:function(){return{enableHighAccuracy:!1,timeout:6e3}}},trackUserLocation:{type:Boolean,default:!1},showUserLocation:{type:Boolean,default:!0},fitBoundsOptions:{type:Object,default:function(){return{maxZoom:15}}}},data:function(){return{control:void 0}},created:function(){var t=this;this.control=new this.mapbox.GeolocateControl(this._props),this.control.on("error",function(e){t.$emit("geolocate-error",e)}),this.control.on("geolocate",function(e){t.$emit("geolocate-error",e)})},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};this.$emit(t,n({map:this.map,component:this},e))},$_bindSelfEvents:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==t.length&&(o=o||this.map,t.forEach(function(t){o.on(t,function(o){e.$_emitMapEvent(""+t,{mapEvent:o})})}))},$_unbindSelfEvents:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==t.length&&(o=o||this.map,t.forEach(function(t){o.off(t,e.layerId)}))}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={beforeDestroy:function(){void 0!==this.map&&this.map.removeControl(this.control)}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o={mapbox:e.mapboxgl};e.plugins&&e.plugins.length&&e.plugins.forEach(function(t){var e=Object.keys(t)[0],n=Object.values(t)[0];o[e]=n}),t.mixin({data:function(){return o}})}});e.default=B},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];return this.map.supported({failIfMajorPerformanceCaveat:t})},resize:function(){this.map.resize()},project:function(t){return this.map.project(t)},unproject:function(t){return this.map.unproject(t)},queryRenderedFeatures:function(t,e){return this.map.queryRenderedFeatures(t,e)},getFeatureState:function(t){return this.map.getFeatureState(t)},setFeatureState:function(t,e){return this.map.setFeatureState(t,e)},querySourceFeatures:function(t,e){return this.map.querySourceFeatures(t,e)},cameraForBounds:function(t,e){return this.map.cameraForBounds(t,e)},addImage:function(t,e,o){return this.map.addImage(t,e,o)},hasImage:function(t){return this.map.hasImage(t)},removeImage:function(t){return this.map.removeImage(t)},loadImage:function(t,e){return this.map.loadImage(t,e)},$_catchMoveFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getCenter();return n.$emit("update:center",r),n.map.off("moveend",o),e({eventData:t,center:r})}}},$_catchZoomFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getZoom();return n.$emit("update:zoom",r),n.map.off("zoomend",o),e({eventData:t,zoom:r})}}},$_catchRotateFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getBearing();n.$emit("update:bearing",r),n.map.off("rotate",o),e({eventData:t,bearing:r})}}},$_catchPitchFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getPitch();n.$emit("update:pitch",r),n.map.off("pitch",o),e({eventData:t,pitch:r})}}},panBy:function(t,e){var o=this,n={eventId:"panBy-"+(""+Math.random()).split(".")[1]};return 0===t[0]&&0===t[1]?new Promise(function(t,e){return t({center:o.map.getCenter()})}):new Promise(function(i,r){o.map.on("moveend",o.$_catchMoveFabric(n,i,r)),o.map.panBy(t,e,n)})},panTo:function(t,e){var o=this;t instanceof Array||(t=t.toArray());var n={eventId:"panTo-"+(""+Math.random()).split(".")[1]};return 0===t[0]&&0===t[1]?new Promise(function(t,e){return t({eventData:n,center:o.map.getCenter()})}):new Promise(function(i,r){o.map.on("moveend",o.$_catchMoveFabric(n,i,r)),o.map.panTo(t,e,n)})},zoomTo:function(t,e){var o=this,n={eventId:"zoomTo-"+(""+Math.random()).split(".")[1]};return t===this.map.getZoom()?new Promise(function(t,e){return t({eventData:n,zoom:o.map.getZoom()})}):new Promise(function(i,r){o.map.on("zoomend",o.$_catchZoomFabric(n,i,r)),o.map.zoomTo(t,e,n)})},zoomIn:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"zoomIn-"+(""+Math.random()).split(".")[1]};e.map.on("zoomend",e.$_catchZoomFabric(i,o,n)),e.map.zoomIn(t,i)})},zoomOut:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"zoomOut-"+(""+Math.random()).split(".")[1]};e.map.on("zoomend",e.$_catchZoomFabric(i,o,n)),e.map.zoomOut(t,i)})},rotateTo:function(t,e){var o=this;return t===this.map.getBearing()?new Promise(function(t,e){return t({bearing:o.map.getBearing()})}):new Promise(function(n,i){var r={eventId:"rotateTo-"+(""+Math.random()).split(".")[1]};o.map.on("rotate",o.$_catchRotateFabric(r,n,i)),o.map.rotateTo(t,e,r)})},resetNorth:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"resetNorth-"+(""+Math.random()).split(".")[1]};e.map.on("rotate",e.$_catchRotateFabric(i,o,n)),e.map.resetNorth(t,i)})},snapToNorth:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"snapToNorth-"+(""+Math.random()).split(".")[1]};e.map.on("rotate",e.$_catchRotateFabric(i,o,n)),e.map.snapToNorth(t,i)})},fitBounds:function(t,e){var o=this,n={eventId:"fitBounds-"+(""+Math.random()).split(".")[1]};if(t===this.map.getBounds())return new Promise(function(t,e){return t({eventData:n,bounds:o.map.getBounds()})});var i=new Promise(function(t,e){o.map.on("zoomend",o.$_catchZoomFabric(n,t,e))}),r=new Promise(function(t,e){o.map.on("moveend",o.$_catchMoveFabric(n,t,e))});return this.map.fitBounds(t,e,n),Promise.all([i,r]).then(function(t){return{eventData:n,bounds:o.map.getBounds()}})},jumpTo:function(t){var e=this,o={eventId:"jumpTo-"+(""+Math.random()).split(".")[1]},n=[];if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,n){e.map.on("rotate",e.$_catchRotateFabric(o,t,n))});n.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,n){e.map.on("zoomend",e.$_catchZoomFabric(o,t,n))});n.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,n){e.map.on("moveend",e.$_catchMoveFabric(o,t,n))});n.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,n){e.map.on("pitch",e.$_catchPitchFabric(o,t,n))});n.push(u)}return 0===n.length?new Promise(function(t,n){t({eventData:o,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.jumpTo(t,o),Promise.all(n).then(function(t){var e={},n=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:o})}))},easeTo:function(t){var e=this,o=[],n={eventId:"easeTo-"+(""+Math.random()).split(".")[1]};if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,o){e.map.on("rotate",e.$_catchRotateFabric(n,t,o))});o.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,o){e.map.on("zoomend",e.$_catchZoomFabric(n,t,o))});o.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,o){e.map.on("moveend",e.$_catchMoveFabric(n,t,o))});o.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,o){e.map.on("pitch",e.$_catchPitchFabric(n,t,o))});o.push(u)}return 0===o.length?new Promise(function(t,o){t({eventData:n,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.easeTo(t,n),Promise.all(o).then(function(t){var e={},o=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!o&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:n})}))},flyTo:function(t){var e=this,o={eventId:"flyTo-"+(""+Math.random()).split(".")[1]},n=[];if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,n){e.map.on("rotate",e.$_catchRotateFabric(o,t,n))});n.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,n){e.map.on("zoomend",e.$_catchZoomFabric(o,t,n))});n.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,n){e.map.on("moveend",e.$_catchMoveFabric(o,t,n))});n.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,n){e.map.on("pitch",e.$_catchPitchFabric(o,t,n))});n.push(u)}return 0===n.length?new Promise(function(t,n){t({eventData:o,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.flyTo(t,o),Promise.all(n).then(function(t){var e={},n=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:o})}))},stop:function(){this.map.stop();var t=[this.map.getPitch(),this.map.getZoom(),this.map.getBearing(),this.map.getCenter()],e=t[0],o=t[1],n=t[2],i=t[3];return this.$emit("update:pitch",e),this.$emit("update:zoom",o),this.$emit("update:bearing",n),this.$emit("update:center",i),Promise.resolve({pitch:e,zoom:o,bearing:n,center:i})}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"AttributionControl",mixins:[r.default,s.default],props:{compact:{type:Boolean,default:!0}},data:function(){return{control:void 0}},created:function(){this.control=new this.mapbox.AttributionControl({compact:this.compact})},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"FullscreenControl",mixins:[r.default,s.default],props:{position:{type:String,default:"top-right"}},data:function(){return{control:void 0}},created:function(){this.control=new this.mapbox.FullscreenControl},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control,this.position),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"GeolocateControl",mixins:[r.default,s.default],props:{position:{type:String,default:"top-right"},positionOptions:{type:Object,default:function(){return{enableHighAccuracy:!1,timeout:6e3}}},watchPosition:{type:Boolean,default:!1}},data:function(){return{control:void 0}},created:function(){var t=this;this.control=new this.mapbox.GeolocateControl(this._props),this.control.on("error",function(e){t.$emit("geolocate-error",e)}),this.control.on("geolocate",function(e){t.$emit("geolocate-error",e)})},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};this.$emit(t,n({map:this.map,component:this},e))},$_bindSelfEvents:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==t.length&&(o=o||this.map,t.forEach(function(t){o.on(t,function(o){e.$_emitMapEvent(""+t,{mapEvent:o})})}))},$_unbindSelfEvents:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;0!==t.length&&(o=o||this.map,t.forEach(function(t){o.off(t,e.layerId)}))}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={beforeDestroy:function(){void 0!==this.map&&this.map.removeControl(this.control)}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o={mapbox:e.mapboxgl};e.plugins&&e.plugins.length&&e.plugins.forEach(function(t){var e=Object.keys(t)[0],n=Object.values(t)[0];o[e]=n}),t.mixin({data:function(){return o}})}});e.default=C},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];return this.map.supported({failIfMajorPerformanceCaveat:t})},resize:function(){this.map.resize()},project:function(t){return this.map.project(t)},unproject:function(t){return this.map.unproject(t)},queryRenderedFeatures:function(t,e){return this.map.queryRenderedFeatures(t,e)},getFeatureState:function(t){return this.map.getFeatureState(t)},setFeatureState:function(t,e){return this.map.setFeatureState(t,e)},querySourceFeatures:function(t,e){return this.map.querySourceFeatures(t,e)},cameraForBounds:function(t,e){return this.map.cameraForBounds(t,e)},addImage:function(t,e,o){return this.map.addImage(t,e,o)},hasImage:function(t){return this.map.hasImage(t)},removeImage:function(t){return this.map.removeImage(t)},loadImage:function(t,e){return this.map.loadImage(t,e)},$_catchMoveFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getCenter();return n.$emit("update:center",r),n.map.off("moveend",o),e({eventData:t,center:r})}}},$_catchZoomFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getZoom();return n.$emit("update:zoom",r),n.map.off("zoomend",o),e({eventData:t,zoom:r})}}},$_catchRotateFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getBearing();n.$emit("update:bearing",r),n.map.off("rotate",o),e({eventData:t,bearing:r})}}},$_catchPitchFabric:function(t,e,o){var n=this;return function o(i){if(i.eventId===t.eventId){var r=n.map.getPitch();n.$emit("update:pitch",r),n.map.off("pitch",o),e({eventData:t,pitch:r})}}},panBy:function(t,e){var o=this,n={eventId:"panBy-"+(""+Math.random()).split(".")[1]};return 0===t[0]&&0===t[1]?new Promise(function(t,e){return t({center:o.map.getCenter()})}):new Promise(function(i,r){o.map.on("moveend",o.$_catchMoveFabric(n,i,r)),o.map.panBy(t,e,n)})},panTo:function(t,e){var o=this;t instanceof Array||(t=t.toArray());var n={eventId:"panTo-"+(""+Math.random()).split(".")[1]};return 0===t[0]&&0===t[1]?new Promise(function(t,e){return t({eventData:n,center:o.map.getCenter()})}):new Promise(function(i,r){o.map.on("moveend",o.$_catchMoveFabric(n,i,r)),o.map.panTo(t,e,n)})},zoomTo:function(t,e){var o=this,n={eventId:"zoomTo-"+(""+Math.random()).split(".")[1]};return t===this.map.getZoom()?new Promise(function(t,e){return t({eventData:n,zoom:o.map.getZoom()})}):new Promise(function(i,r){o.map.on("zoomend",o.$_catchZoomFabric(n,i,r)),o.map.zoomTo(t,e,n)})},zoomIn:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"zoomIn-"+(""+Math.random()).split(".")[1]};e.map.on("zoomend",e.$_catchZoomFabric(i,o,n)),e.map.zoomIn(t,i)})},zoomOut:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"zoomOut-"+(""+Math.random()).split(".")[1]};e.map.on("zoomend",e.$_catchZoomFabric(i,o,n)),e.map.zoomOut(t,i)})},rotateTo:function(t,e){var o=this;return t===this.map.getBearing()?new Promise(function(t,e){return t({bearing:o.map.getBearing()})}):new Promise(function(n,i){var r={eventId:"rotateTo-"+(""+Math.random()).split(".")[1]};o.map.on("rotate",o.$_catchRotateFabric(r,n,i)),o.map.rotateTo(t,e,r)})},resetNorth:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"resetNorth-"+(""+Math.random()).split(".")[1]};e.map.on("rotate",e.$_catchRotateFabric(i,o,n)),e.map.resetNorth(t,i)})},snapToNorth:function(t){var e=this;return new Promise(function(o,n){var i={eventId:"snapToNorth-"+(""+Math.random()).split(".")[1]};e.map.on("rotate",e.$_catchRotateFabric(i,o,n)),e.map.snapToNorth(t,i)})},fitBounds:function(t,e){var o=this,n={eventId:"fitBounds-"+(""+Math.random()).split(".")[1]};if(t===this.map.getBounds())return new Promise(function(t,e){return t({eventData:n,bounds:o.map.getBounds()})});var i=new Promise(function(t,e){o.map.on("zoomend",o.$_catchZoomFabric(n,t,e))}),r=new Promise(function(t,e){o.map.on("moveend",o.$_catchMoveFabric(n,t,e))});return this.map.fitBounds(t,e,n),Promise.all([i,r]).then(function(t){return{eventData:n,bounds:o.map.getBounds()}})},jumpTo:function(t){var e=this,o={eventId:"jumpTo-"+(""+Math.random()).split(".")[1]},n=[];if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,n){e.map.on("rotate",e.$_catchRotateFabric(o,t,n))});n.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,n){e.map.on("zoomend",e.$_catchZoomFabric(o,t,n))});n.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,n){e.map.on("moveend",e.$_catchMoveFabric(o,t,n))});n.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,n){e.map.on("pitch",e.$_catchPitchFabric(o,t,n))});n.push(u)}return 0===n.length?new Promise(function(t,n){t({eventData:o,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.jumpTo(t,o),Promise.all(n).then(function(t){var e={},n=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:o})}))},easeTo:function(t){var e=this,o=[],n={eventId:"easeTo-"+(""+Math.random()).split(".")[1]};if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,o){e.map.on("rotate",e.$_catchRotateFabric(n,t,o))});o.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,o){e.map.on("zoomend",e.$_catchZoomFabric(n,t,o))});o.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,o){e.map.on("moveend",e.$_catchMoveFabric(n,t,o))});o.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,o){e.map.on("pitch",e.$_catchPitchFabric(n,t,o))});o.push(u)}return 0===o.length?new Promise(function(t,o){t({eventData:n,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.easeTo(t,n),Promise.all(o).then(function(t){var e={},o=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!o&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:n})}))},flyTo:function(t){var e=this,o={eventId:"flyTo-"+(""+Math.random()).split(".")[1]},n=[];if(void 0!==t.bearing&&t.bearing!==this.map.getBearing()){var r=new Promise(function(t,n){e.map.on("rotate",e.$_catchRotateFabric(o,t,n))});n.push(r)}if(void 0!==t.zoom&&t.zoom!==this.map.getZoom()){var a=new Promise(function(t,n){e.map.on("zoomend",e.$_catchZoomFabric(o,t,n))});n.push(a)}if(void 0!==t.center&&t.center!==this.map.getCenter()){var s=new Promise(function(t,n){e.map.on("moveend",e.$_catchMoveFabric(o,t,n))});n.push(s)}if(void 0!==t.pitch&&t.pitch!==this.map.getPitch()){var u=new Promise(function(t,n){e.map.on("pitch",e.$_catchPitchFabric(o,t,n))});n.push(u)}return 0===n.length?new Promise(function(t,n){t({eventData:o,pitch:e.map.getPitch(),zoom:e.map.getZoom(),center:e.map.getCenter(),bearing:e.map.getBearing()})}):(this.map.flyTo(t,o),Promise.all(n).then(function(t){var e={},n=!0,r=!1,a=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var c=s.value;Object.assign(e,c)}}catch(t){r=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(r)throw a}}return i({},e,{eventData:o})}))},stop:function(){this.map.stop();var t=[this.map.getPitch(),this.map.getZoom(),this.map.getBearing(),this.map.getCenter()],e=t[0],o=t[1],n=t[2],i=t[3];return this.$emit("update:pitch",e),this.$emit("update:zoom",o),this.$emit("update:bearing",n),this.$emit("update:center",i),Promise.resolve({pitch:e,zoom:o,bearing:n,center:i})}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"AttributionControl",mixins:[r.default,s.default],props:{compact:{type:Boolean,default:!0}},data:function(){return{control:void 0}},created:function(){this.control=new this.mapbox.AttributionControl({compact:this.compact})},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"FullscreenControl",mixins:[r.default,s.default],props:{position:{type:String,default:"top-right"}},data:function(){return{control:void 0}},created:function(){this.control=new this.mapbox.FullscreenControl},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control,this.position),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=o(1),r=n(i),a=o(2),s=n(a);e.default={name:"GeolocateControl",mixins:[r.default,s.default],props:{position:{type:String,default:"top-right"},positionOptions:{type:Object,default:function(){return{enableHighAccuracy:!1,timeout:6e3}}},trackUserLocation:{type:Boolean,default:!1},showUserLocation:{type:Boolean,default:!0},fitBoundsOptions:{type:Object,default:function(){return{maxZoom:15}}}},data:function(){return{control:void 0}},created:function(){var t=this;this.control=new this.mapbox.GeolocateControl(this._props),this.control.on("error",function(e){t.$emit("geolocate-error",e)}),this.control.on("geolocate",function(e){t.$emit("geolocate-error",e)})},methods:{$_deferredMount:function(t){this.map=t.map,this.map.addControl(this.control),this.$emit("added",this.control),t.component.$off("load",this.$_deferredMount)}}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e0.0.32 +# Vue-mapbox 0.0.33 > Combine powers of [Vue.js](https://vuejs.org/) and [Mapbox Gl JS](https://mapbox.com/mapbox-gl-js) diff --git a/package-lock.json b/package-lock.json index ee5a106f..cb279e15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-mapbox", - "version": "0.0.32", + "version": "0.0.33", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -18,6 +18,29 @@ "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", "dev": true }, + "acorn": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, "ajv": { "version": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", @@ -6500,11 +6523,70 @@ "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", "dev": true }, + "eslint-plugin-vue": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-4.5.0.tgz", + "integrity": "sha512-2CDidjAZ875tbJgtjKihIQRkqxgk3gVUDOAW2e9dP+Kf39jhCwKy6aMXIsHRKCPjRqQhDWF0jtVRNcywBFWTZA==", + "dev": true, + "requires": { + "vue-eslint-parser": "2.0.3" + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "5.7.1", + "acorn-jsx": "3.0.1" + } + }, "esprima": { "version": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", "dev": true }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, "esutils": { "version": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", @@ -11316,6 +11398,43 @@ "integrity": "sha512-3D+lY7HTkKbtswDM4BBHgqyq+qo8IAEE8lz8va1dz3LLmttjgo0FxairO4r1iN2OBqk8o1FyL4hvzzTFEdQSEw==", "dev": true }, + "vue-eslint-parser": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz", + "integrity": "sha512-ZezcU71Owm84xVF6gfurBQUGg8WQ+WZGxgDEQu1IHFBZNx7BFZg3L1yHxrCBNNwbwFtE1GuvfJKMtb6Xuwc/Bw==", + "dev": true, + "requires": { + "debug": "3.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", + "lodash": "4.17.10" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "vue-loader": { "version": "12.2.2", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-12.2.2.tgz", diff --git a/package.json b/package.json index 4a811205..4f52510b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-mapbox", - "version": "0.0.32", + "version": "0.0.33", "description": "Vuejs 2 components for interacting with mapbox-gj-js ", "main": "dist/vue-mapbox.umd.min.js", "repository": { @@ -73,6 +73,7 @@ "eslint-plugin-node": "^5.2.1", "eslint-plugin-promise": "^3.6.0", "eslint-plugin-standard": "^3.0.1", + "eslint-plugin-vue": "^4.5.0", "eventsource-polyfill": "^0.9.6", "friendly-errors-webpack-plugin": "^1.1.3", "html-webpack-plugin": "^2.28.0", diff --git a/src/components/GlMap.vue b/src/components/GlMap.vue index d568bf25..5c0e1cd1 100755 --- a/src/components/GlMap.vue +++ b/src/components/GlMap.vue @@ -114,7 +114,7 @@ export default { this.$_bindEvents(eventsToListen) this.$_bindPropsUpdateEvents() - this.initial = true + this.initial = false this.mapLoaded = true }) }, diff --git a/src/components/UI/GeolocateControl.vue b/src/components/UI/GeolocateControl.vue index 711f4597..854dae35 100755 --- a/src/components/UI/GeolocateControl.vue +++ b/src/components/UI/GeolocateControl.vue @@ -22,9 +22,17 @@ } } }, - watchPosition: { + trackUserLocation: { type: Boolean, default: false + }, + showUserLocation: { + type: Boolean, + default: true + }, + fitBoundsOptions: { + type: Object, + default: () => ({ maxZoom: 15 }) } },