diff --git a/dist/vue-googlemaps.esm.js b/dist/vue-googlemaps.esm.js index 9ed59a4..c59bae2 100644 --- a/dist/vue-googlemaps.esm.js +++ b/dist/vue-googlemaps.esm.js @@ -930,7 +930,8 @@ var loader = { var apiKey = _ref.apiKey, version = _ref.version, libraries = _ref.libraries, - loadCn = _ref.loadCn; + loadCn = _ref.loadCn, + useBetaRenderer = _ref.useBetaRenderer; if (typeof window === 'undefined') { // Do nothing if run from server-side @@ -975,8 +976,10 @@ var loader = { return encodeURIComponent(key) + '=' + encodeURIComponent(options[key]); }).join('&'); - if (version) { - url = url + '&v=' + version; + var usingBetaRenderer = version && version === '3.exp' || typeof useBetaRenderer === 'boolean' && useBetaRenderer === true; + + if (usingBetaRenderer || version) { + url = url + '&v=' + (usingBetaRenderer ? '3.exp&slippy=true' : version); } googleMapScript.setAttribute('src', url); @@ -1876,6 +1879,7 @@ var Map = { render: function render() { type: Number }, zoom: { + required: true, type: Number } }, @@ -2242,7 +2246,7 @@ function registerComponents(Vue, prefix) { var plugin = { // eslint-disable-next-line no-undef - version: "0.1.0", + version: "0.1.1", install: function install(Vue, options) { var finalOptions = Object.assign({}, { installComponents: true, diff --git a/dist/vue-googlemaps.min.js b/dist/vue-googlemaps.min.js index 451a443..0de8216 100644 --- a/dist/vue-googlemaps.min.js +++ b/dist/vue-googlemaps.min.js @@ -1 +1 @@ -var VueGoogleMaps=function(e){"use strict";function t(e){var t=e.config.optionMergeStrategies;t.googleMapsReady=t.created,t.googleMapsPrepare=t.created}function n(e){v=e.config}function r(e,t,n){if(v.errorHandler)v.errorHandler(e,t,n);else{if("undefined"==typeof console)throw e;console.error(e)}}function i(e){return"function"==typeof e?e():e}function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}function a(e){var t=e.vm,n=e.name,r=e.targetPropName,i=e.target,a=e.watcher,s=e.identity,c=e.applier,u=e.retriever,l=(e.readOnly,e.event),h=e.changeEvent;r||(r=n),h||(h=r.toLowerCase()+"_changed");var f=void 0,p=o(n),d=function(){return i&&i["get"+p]()},v=function(e){f=e,i&&i["set"+p](e)};a||(a=function(e){return e}),s||(s=function(e,t){return e===t}),c||(c=function(e,t,n){s(e,t)||n(e)}),u||(u=function(e){return e}),l||(l="update:"+n),t.$watch(function(){return a(t[n])},function(e,t){s(e,f)||c(e,t,v),f=e});var y=i.addListener(h,function(){var e=u(d());s(e,f)||(t.$emit(l,e),f=e)});return function(){y.remove()}}function s(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}function c(){c.init||(c.init=!0,O=-1!==s())}function u(e){if(null!==e&&"function"!=typeof e)throw new Error("observe-visibility directive expects a function as the value")}function l(e,t){e.component(t+"circle",$),e.component(t+"geocoder",P),e.component(t+"map",I),e.component(t+"marker",D),e.component(t+"nearby-places",N),e.component(t+"place-details",W),e.component(t+"user-position",q)}!function(e,t){t={exports:{}},e(t,t.exports),t.exports}(function(e){!function(t){function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,a=Object.create(o.prototype),s=new p(r||[]);return a._invoke=u(e,n,s),a}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function a(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function c(e){function t(n,i,o,a){var s=r(e[n],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&m.call(u,"__await")?Promise.resolve(u.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(u).then(function(e){c.value=e,o(c)},a)}a(s.arg)}var n;this._invoke=function(e,r){function i(){return new Promise(function(n,i){t(e,r,n,i)})}return n=n?n.then(i,i):i()}}function u(e,t,n){var i=P;return function(o,a){if(i===k)throw new Error("Generator is already running");if(i===S){if("throw"===o)throw a;return v()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=l(s,n);if(c){if(c===E)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===P)throw i=S,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=k;var u=r(e,t,n);if("normal"===u.type){if(i=n.done?S:O,u.arg===E)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=S,n.method="throw",n.arg=u.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===y){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=y,l(e,t),"throw"===t.method))return E;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,E;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=y),t.delegate=null,E):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,E)}function h(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function p(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(h,this),this.reset(!0)}function d(e){if(e){var t=e[w];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=m.call(i,"catchLoc"),s=m.call(i,"finallyLoc");if(a&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),f(n),E}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;f(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=y),E}}}}(function(){return this}()||Function("return this")())});var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=(function(){function e(e){this.value=e}function t(t){function n(i,o){try{var a=t[i](o),s=a.value;s instanceof e?Promise.resolve(s.value).then(function(e){n("next",e)},function(e){n("throw",e)}):r(a.done?"return":"normal",a.value)}catch(e){r("throw",e)}}function r(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?n(i.key,i.arg):o=null}var i,o;this._invoke=function(e,t){return new Promise(function(r,a){var s={key:e,arg:t,resolve:r,reject:a,next:null};o?o=o.next=s:(i=o=s,n(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(i,o){try{var a=t[i](o),s=a.value}catch(e){return void n(e)}if(!a.done)return Promise.resolve(s).then(function(e){r("next",e)},function(e){r("throw",e)});e(s)}return r("next")})}}),p=Object.assign||function(e){for(var t=1;t0?(c=r.join(","),a.libraries=c):Array.prototype.isPrototypeOf(a.libraries)&&(a.libraries=a.libraries.join(",")),a.callback="VueGoogleMapsLoaded";var u="https://maps.googleapis.com/";"boolean"==typeof i&&!0===i&&(u="http://maps.google.cn/");var l=u+"maps/api/js?"+Object.keys(a).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(a[e])}).join("&");n&&(l=l+"&v="+n),o.setAttribute("src",l),o.setAttribute("async",""),o.setAttribute("defer",""),document.body.appendChild(o),window.VueGoogleMapsLoaded=this._setLoaded.bind(this)}},ensureReady:function(){var e=this;return this.loaded?Promise.resolve():new Promise(function(t){e.readyPromises.push(t)})},_setLoaded:function(){this.loaded=!0;var e=!0,t=!1,n=void 0;try{for(var r,i=this.readyPromises[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)(0,r.value)()}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}this.readyPromises=[]}},v=void 0,y={beforeDestroy:function(){this.unbindProps()},methods:{bindProps:function(e,t){this.unbindProps(),this.$_boundsProps=[];var n=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var c=o.value,u={vm:this,target:e};"string"==typeof c?u.name=c:Object.assign(u,c),this.$_boundsProps.push(a(u))}}catch(e){r=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw i}}},unbindProps:function(){this.$_boundsProps&&this.$_boundsProps.forEach(function(e){return e()})}}},g={beforeCreate:function(){this.$_googleListeners=[]},beforeDestroy:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.$_googleListeners[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.remove()}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}},methods:{listen:function(e,t,n){this.$_googleListeners.push(e.addListener(t,n))},redirectEvents:function(e,t){var n=this,r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)!function(t){n.listen(e,t,function(){for(var e=arguments.length,r=Array(e),i=0;i component.");this.$_mapAncestor=e},googleMapsPrepare:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.$_mapAncestor,t.next=3,n.$_getMap();case 3:e.$_map=t.sent;case 4:case"end":return t.stop()}},t,e)}))()}},w=["center","draggable","editable","radius","visible"],_=["click","rightclick","dblclick","drag","dragstart","dragend","mouseup","mousedown","mouseover","mouseout"],$={name:"GoogleMapsCircle",mixins:[b],props:{center:{type:Object,required:!0},clickable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},radius:{type:Number,required:!0},visible:{default:!0},zIndex:{type:Number}},watch:{clickable:"updateOptions",zIndex:"updateOptions"},methods:{updateOptions:function(e){this.$_circle&&this.$_circle.setOptions(e||this.$props)}},render:function(e){return""},googleMapsReady:function(){var e=this.$props;e.map=this.$map,this.$_circle=new window.google.maps.Circle(e),this.bindProps(this.$_circle,w),this.redirectEvents(this.$_circle,_)},beforeDestroy:function(){this.$_circle&&this.$_circle.setMap(null)}},x={mixins:[m],props:{filter:{type:Function,default:null},request:{type:Object,default:null},tag:{type:String,default:"div"}},data:function(){return{loading:!1,results:null,status:null}},computed:{filteredResults:function(){return this.results&&this.filter?this.results.filter(this.filter):this.results},finalResults:function(){var e=this.filteredResults;return!e||Array.isArray(e)&&!e.length?null:e}},watch:{request:{handler:function(e){e&&this.update()},deep:!0},finalResults:function(e){this.$emit("results",e)}},methods:{createServices:function(){},getScope:function(){return{loading:this.loading,results:this.finalResults,status:this.status}},setResults:function(e,t){this.results=e,this.status=t},update:function(){}},googleMapsReady:function(){this.createServices(),this.request&&this.update()},render:function(e){return e(this.tag,[this.$scopedSlots.default&&this.$scopedSlots.default(this.getScope()),e("span",{ref:"attributions"})])}},P={name:"GoogleMapsGeocoder",mixins:[x],props:{disablePlaceDetails:{type:Boolean,default:!1}},methods:{createServices:function(){this.$_geocoder=new window.google.maps.Geocoder,this.$_placeService=new window.google.maps.places.PlacesService(this.$refs.attributions)},getPlaceDetails:function(e){e.placeDetails={},e.place_id&&(e.placeDetails.loading=!0,this.$_placeService.getDetails({placeId:e.place_id},function(t,n){e.placeDetails=t}))},update:function(){var e=this;this.googleMapsReady&&(this.loading=!0,this.$_geocoder.geocode(this.request,function(t,n){t&&!e.disablePlaceDetails&&t.forEach(e.getPlaceDetails),e.setResults(t,n),e.loading=!1}))}}},O=void 0,k={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{notify:function(){this.$emit("notify")},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.notify),this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||this.notify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!O&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.notify),delete this._resizeObject.onload)}},mounted:function(){var e=this;c(),this.$nextTick(function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight});var t=document.createElement("object");this._resizeObject=t,t.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",O&&this.$el.appendChild(t),t.data="about:blank",O||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}},S={version:"0.4.4",install:function(e){e.component("resize-observer",k)}},E=null;"undefined"!=typeof window?E=window.Vue:"undefined"!=typeof global&&(E=global.Vue),E&&E.use(S);var L={bind:function(e,t,n){var r=t.value;if("undefined"==typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/WICG/IntersectionObserver/tree/gh-pages/polyfill");else{u(r),e._vue_visibilityCallback=r;var i=e._vue_intersectionObserver=new IntersectionObserver(function(t){var n=t[0];e._vue_visibilityCallback&&e._vue_visibilityCallback.call(null,n.intersectionRatio>0,n)});n.context.$nextTick(function(){i.observe(e)})}},update:function(e,t){var n=t.value;u(n),e._vue_visibilityCallback=n},unbind:function(e){e._vue_intersectionObserver&&(e._vue_intersectionObserver.disconnect(),delete e._vue_intersectionObserver,delete e._vue_visibilityCallback)}},j={version:"0.3.1",install:function(e){e.directive("observe-visibility",L)}},M=null;"undefined"!=typeof window?M=window.Vue:"undefined"!=typeof global&&(M=global.Vue),M&&M.use(j);var C=[{name:"center",watcher:function(e){return{lat:i(e.lat),lng:i(e.lng)}},identity:function(e,t){if(e&&t)return"function"!=typeof e.equals&&(e=new window.google.maps.LatLng(e)),"function"!=typeof t.equals&&(t=new window.google.maps.LatLng(t)),e.equals(t)},retriever:function(e){return{lat:e.lat(),lng:e.lng()}}},"heading","mapTypeId","tilt","zoom"],R=["panBy","panTo","panToBounds","fitBounds","getBounds"],z=["click","dblclick","drag","dragend","dragstart","mousemove","mouseout","mouseover","resize","rightclick","tilesloaded"],I={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],staticClass:"vue-google-map"},[n("div",{ref:"map",staticClass:"map-view"}),e._v(" "),n("div",{staticClass:"hidden-content"},[e._t("default")],2),e._v(" "),e._t("visible"),e._v(" "),n("resize-observer",{on:{notify:e.resize}})],2)},staticRenderFns:[],_scopeId:"data-v-3074bd5c",name:"GoogleMapsMap",mixins:[m,y,g],components:{ResizeObserver:k},directives:{ObserveVisibility:L},props:{center:{required:!0,type:Object},heading:{type:Number},mapTypeId:{type:String},options:{type:Object,default:function(){return{}}},tilt:{type:Number},zoom:{type:Number}},beforeCreate:function(){this.$_mapPromises=[]},googleMapsReady:function(){var e=this,t=this.$refs.map,n=p({center:this.center,heading:this.heading,mapTypeId:this.mapTypeId,tilt:this.tilt,zoom:this.zoom},this.options);this.$_map=new window.google.maps.Map(t,n),this.bindProps(this.$_map,C),this.listen(this.$_map,"bounds_changed",function(){e.$emit("update:bounds",e.$_map.getBounds())}),this.listen(this.$_map,"idle",function(){e.$emit("idle",e),e.lastCenter=e.$_map.getCenter()}),this.lastCenter=this.$_map.getCenter(),this.redirectEvents(this.$_map,z),this.$_mapPromises.forEach(function(t){return t(e.$_map)})},methods:p({},function(e){var t=e.target;return e.names.reduce(function(e,n){return e[n]=function(){var e=t.call(this);if(e){for(var r=arguments.length,i=Array(r),o=0;o0&&void 0!==arguments[0])||arguments[0];this.$_map&&(window.google.maps.event.trigger(this.$_map,"resize"),e&&this.$_map.setCenter(this.lastCenter))},visibilityChanged:function(e){e&&this.$nextTick(this.resize)},$_getMap:function(){var e=this;return this.$_map?Promise.resolve(this.$_map):new Promise(function(t){e.$_mapPromises.push(t)})}})},A=["animation","clickable","cursor","draggable","icon","label","opacity","place","position","shape","title","visible","zIndex"],G=["click","rightclick","dblclick","drag","dragstart","dragend","mouseup","mousedown","mouseover","mouseout"],D={name:"GoogleMapsMarker",mixins:[b],props:{animation:{type:Number},clickable:{type:Boolean,default:!0},cursor:{type:String},draggable:{type:Boolean,default:!1},icon:{},label:{},opacity:{type:Number,default:1},place:{type:Object},position:{type:Object},shape:{type:Object},title:{type:String},visible:{default:!0},zIndex:{type:Number}},render:function(e){return this.$slots.default&&0!==this.$slots.default.length?1===this.$slots.default.length?this.$slots.default[0]:e("div",this.$slots.default):""},googleMapsReady:function(){var e=Object.assign({},this.$props);e.map=this.$_map,this.$_marker=new window.google.maps.Marker(e),this.bindProps(this.$_marker,A),this.redirectEvents(this.$_marker,G)},beforeDestroy:function(){this.$_marker&&this.$_marker.setMap(null)}},N={name:"GoogleMapsNearbyPlaces",mixins:[x],methods:{createServices:function(){this.$_placeService=new window.google.maps.places.PlacesService(this.$refs.attributions)},update:function(){var e=this;this.loading=!0,this.$_placeService.nearbySearch(this.request,function(t,n){e.setResults(t,n),e.loading=!1})}}},W={name:"GoogleMapsPlaceDetails",mixins:[x],methods:{createServices:function(){this.$_placeService=new window.google.maps.places.PlacesService(this.$refs.attributions)},update:function(){var e=this;this.loading=!0,this.$_placeService.getDetails(this.request,function(t,n){e.setResults(t,n),e.loading=!1})}}},T=void 0,B={strokeColor:"#4285F4",strokeOpacity:.25,fillColor:"#4285F4",fillOpacity:.2,strokeWeight:1},q={name:"GoogleMapsUserPosition",mixins:[m],props:{accuracy:{default:0},accuracyStyle:{type:Object,default:null},disableWatch:{type:Boolean,default:!1},hideAccuracy:{type:Boolean,default:!1},minimumAccuracy:{default:1e3},position:{type:Object},positionStyle:{type:Object,default:null},positionOptions:{type:Object,default:function(){return{enableHighAccuracy:!0,maximumAge:1e3}}}},data:function(){return{currentPosition:null,currentAccuracy:null}},watch:{position:function(e){this.currentPosition=e},accuracy:function(e){this.currentAccuracy=e},disableWatch:function(e,t){e!==t&&(e?this.stopWatch():this.startWatch())},positionOptions:function(e){this.disableWatch||(this.stopWatch(),this.startWatch())}},methods:{startWatch:function(){navigator.geolocation?this.$_watchId=navigator.geolocation.watchPosition(this.updatePosition,this.onWatchError,this.positionOptions):(console.warn("GoogleMapsUserPosition: navigator.geolocation not supported"),this.$emit("error",new Error("unsupported")))},stopWatch:function(){navigator.geolocation&&navigator.geolocation.clearWatch(this.$_watchId)},updatePosition:function(e){this.currentPosition={lat:e.coords.latitude,lng:e.coords.longitude},this.$emit("update:position",this.currentPosition),this.currentAccuracy=e.coords.accuracy,this.$emit("update:accuracy",this.currentAccuracy)},onWatchError:function(e){this.$emit("error",e)}},render:function(e){var t=[];return this.googleMapsReady&&this.currentPosition&&(null===this.minimumAccuracy||this.currentAccuracy<=this.minimumAccuracy)&&(t.push(e(D,{props:{clickable:!1,icon:this.positionStyle||T,optimized:!1,position:this.currentPosition,zIndex:3}})),this.hideAccuracy||t.push(e($,{props:{clickable:!1,radius:this.currentAccuracy,options:this.accuracyStyle||B,center:this.currentPosition,zIndex:1}}))),e("div",t)},googleMapsReady:function(){T={path:window.google.maps.SymbolPath.CIRCLE,fillColor:"#4285F4",fillOpacity:1,scale:6,strokeColor:"white",strokeWeight:2},this.disableWatch||this.startWatch()},beforeDestroy:function(){this.stopWatch()}},F={version:"0.1.0",install:function(e,r){var i=Object.assign({},{installComponents:!0,componentsPrefix:"googlemaps-"},r);t(e),n(e),i.installComponents&&l(e,i.componentsPrefix),i.load&&d.load(i.load)}},V=null;return"undefined"!=typeof window?V=window.Vue:"undefined"!=typeof global&&(V=global.Vue),V&&V.use(F),e.Circle=$,e.Geocoder=P,e.Map=I,e.Marker=D,e.NearbyPlaces=N,e.PlaceDetails=W,e.UserPosition=q,e.MapElement=b,e.default=F,e}({}); +var VueGoogleMaps=function(e){"use strict";function t(e){var t=e.config.optionMergeStrategies;t.googleMapsReady=t.created,t.googleMapsPrepare=t.created}function n(e){y=e.config}function r(e,t,n){if(y.errorHandler)y.errorHandler(e,t,n);else{if("undefined"==typeof console)throw e;console.error(e)}}function i(e){return"function"==typeof e?e():e}function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}function a(e){var t=e.vm,n=e.name,r=e.targetPropName,i=e.target,a=e.watcher,s=e.identity,c=e.applier,u=e.retriever,l=(e.readOnly,e.event),h=e.changeEvent;r||(r=n),h||(h=r.toLowerCase()+"_changed");var p=void 0,f=o(n),d=function(){return i&&i["get"+f]()},y=function(e){p=e,i&&i["set"+f](e)};a||(a=function(e){return e}),s||(s=function(e,t){return e===t}),c||(c=function(e,t,n){s(e,t)||n(e)}),u||(u=function(e){return e}),l||(l="update:"+n),t.$watch(function(){return a(t[n])},function(e,t){s(e,p)||c(e,t,y),p=e});var v=i.addListener(h,function(){var e=u(d());s(e,p)||(t.$emit(l,e),p=e)});return function(){v.remove()}}function s(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}function c(){c.init||(c.init=!0,O=-1!==s())}function u(e){if(null!==e&&"function"!=typeof e)throw new Error("observe-visibility directive expects a function as the value")}function l(e,t){e.component(t+"circle",$),e.component(t+"geocoder",P),e.component(t+"map",I),e.component(t+"marker",D),e.component(t+"nearby-places",N),e.component(t+"place-details",W),e.component(t+"user-position",q)}!function(e,t){t={exports:{}},e(t,t.exports),t.exports}(function(e){!function(t){function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,a=Object.create(o.prototype),s=new f(r||[]);return a._invoke=u(e,n,s),a}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function a(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function c(e){function t(n,i,o,a){var s=r(e[n],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&m.call(u,"__await")?Promise.resolve(u.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(u).then(function(e){c.value=e,o(c)},a)}a(s.arg)}var n;this._invoke=function(e,r){function i(){return new Promise(function(n,i){t(e,r,n,i)})}return n=n?n.then(i,i):i()}}function u(e,t,n){var i=P;return function(o,a){if(i===k)throw new Error("Generator is already running");if(i===S){if("throw"===o)throw a;return y()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=l(s,n);if(c){if(c===E)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===P)throw i=S,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=k;var u=r(e,t,n);if("normal"===u.type){if(i=n.done?S:O,u.arg===E)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=S,n.method="throw",n.arg=u.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,l(e,t),"throw"===t.method))return E;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return E}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,E;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,E):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,E)}function h(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function p(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function f(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(h,this),this.reset(!0)}function d(e){if(e){var t=e[w];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=m.call(i,"catchLoc"),s=m.call(i,"finallyLoc");if(a&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),p(n),E}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;p(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),E}}}}(function(){return this}()||Function("return this")())});var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=(function(){function e(e){this.value=e}function t(t){function n(i,o){try{var a=t[i](o),s=a.value;s instanceof e?Promise.resolve(s.value).then(function(e){n("next",e)},function(e){n("throw",e)}):r(a.done?"return":"normal",a.value)}catch(e){r("throw",e)}}function r(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?n(i.key,i.arg):o=null}var i,o;this._invoke=function(e,t){return new Promise(function(r,a){var s={key:e,arg:t,resolve:r,reject:a,next:null};o?o=o.next=s:(i=o=s,n(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(i,o){try{var a=t[i](o),s=a.value}catch(e){return void n(e)}if(!a.done)return Promise.resolve(s).then(function(e){r("next",e)},function(e){r("throw",e)});e(s)}return r("next")})}}),f=Object.assign||function(e){for(var t=1;t0?(u=r.join(","),s.libraries=u):Array.prototype.isPrototypeOf(s.libraries)&&(s.libraries=s.libraries.join(",")),s.callback="VueGoogleMapsLoaded";var l="https://maps.googleapis.com/";"boolean"==typeof i&&!0===i&&(l="http://maps.google.cn/");var p=l+"maps/api/js?"+Object.keys(s).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(s[e])}).join("&"),f=n&&"3.exp"===n||"boolean"==typeof o&&!0===o;(f||n)&&(p=p+"&v="+(f?"3.exp&slippy=true":n)),a.setAttribute("src",p),a.setAttribute("async",""),a.setAttribute("defer",""),document.body.appendChild(a),window.VueGoogleMapsLoaded=this._setLoaded.bind(this)}},ensureReady:function(){var e=this;return this.loaded?Promise.resolve():new Promise(function(t){e.readyPromises.push(t)})},_setLoaded:function(){this.loaded=!0;var e=!0,t=!1,n=void 0;try{for(var r,i=this.readyPromises[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)(0,r.value)()}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}this.readyPromises=[]}},y=void 0,v={beforeDestroy:function(){this.unbindProps()},methods:{bindProps:function(e,t){this.unbindProps(),this.$_boundsProps=[];var n=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var c=o.value,u={vm:this,target:e};"string"==typeof c?u.name=c:Object.assign(u,c),this.$_boundsProps.push(a(u))}}catch(e){r=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw i}}},unbindProps:function(){this.$_boundsProps&&this.$_boundsProps.forEach(function(e){return e()})}}},g={beforeCreate:function(){this.$_googleListeners=[]},beforeDestroy:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.$_googleListeners[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.remove()}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}},methods:{listen:function(e,t,n){this.$_googleListeners.push(e.addListener(t,n))},redirectEvents:function(e,t){var n=this,r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)!function(t){n.listen(e,t,function(){for(var e=arguments.length,r=Array(e),i=0;i component.");this.$_mapAncestor=e},googleMapsPrepare:function(){var e=this;return p(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.$_mapAncestor,t.next=3,n.$_getMap();case 3:e.$_map=t.sent;case 4:case"end":return t.stop()}},t,e)}))()}},w=["center","draggable","editable","radius","visible"],_=["click","rightclick","dblclick","drag","dragstart","dragend","mouseup","mousedown","mouseover","mouseout"],$={name:"GoogleMapsCircle",mixins:[b],props:{center:{type:Object,required:!0},clickable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},radius:{type:Number,required:!0},visible:{default:!0},zIndex:{type:Number}},watch:{clickable:"updateOptions",zIndex:"updateOptions"},methods:{updateOptions:function(e){this.$_circle&&this.$_circle.setOptions(e||this.$props)}},render:function(e){return""},googleMapsReady:function(){var e=this.$props;e.map=this.$map,this.$_circle=new window.google.maps.Circle(e),this.bindProps(this.$_circle,w),this.redirectEvents(this.$_circle,_)},beforeDestroy:function(){this.$_circle&&this.$_circle.setMap(null)}},x={mixins:[m],props:{filter:{type:Function,default:null},request:{type:Object,default:null},tag:{type:String,default:"div"}},data:function(){return{loading:!1,results:null,status:null}},computed:{filteredResults:function(){return this.results&&this.filter?this.results.filter(this.filter):this.results},finalResults:function(){var e=this.filteredResults;return!e||Array.isArray(e)&&!e.length?null:e}},watch:{request:{handler:function(e){e&&this.update()},deep:!0},finalResults:function(e){this.$emit("results",e)}},methods:{createServices:function(){},getScope:function(){return{loading:this.loading,results:this.finalResults,status:this.status}},setResults:function(e,t){this.results=e,this.status=t},update:function(){}},googleMapsReady:function(){this.createServices(),this.request&&this.update()},render:function(e){return e(this.tag,[this.$scopedSlots.default&&this.$scopedSlots.default(this.getScope()),e("span",{ref:"attributions"})])}},P={name:"GoogleMapsGeocoder",mixins:[x],props:{disablePlaceDetails:{type:Boolean,default:!1}},methods:{createServices:function(){this.$_geocoder=new window.google.maps.Geocoder,this.$_placeService=new window.google.maps.places.PlacesService(this.$refs.attributions)},getPlaceDetails:function(e){e.placeDetails={},e.place_id&&(e.placeDetails.loading=!0,this.$_placeService.getDetails({placeId:e.place_id},function(t,n){e.placeDetails=t}))},update:function(){var e=this;this.googleMapsReady&&(this.loading=!0,this.$_geocoder.geocode(this.request,function(t,n){t&&!e.disablePlaceDetails&&t.forEach(e.getPlaceDetails),e.setResults(t,n),e.loading=!1}))}}},O=void 0,k={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{notify:function(){this.$emit("notify")},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.notify),this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||this.notify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!O&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.notify),delete this._resizeObject.onload)}},mounted:function(){var e=this;c(),this.$nextTick(function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight});var t=document.createElement("object");this._resizeObject=t,t.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",O&&this.$el.appendChild(t),t.data="about:blank",O||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}},S={version:"0.4.4",install:function(e){e.component("resize-observer",k)}},E=null;"undefined"!=typeof window?E=window.Vue:"undefined"!=typeof global&&(E=global.Vue),E&&E.use(S);var L={bind:function(e,t,n){var r=t.value;if("undefined"==typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/WICG/IntersectionObserver/tree/gh-pages/polyfill");else{u(r),e._vue_visibilityCallback=r;var i=e._vue_intersectionObserver=new IntersectionObserver(function(t){var n=t[0];e._vue_visibilityCallback&&e._vue_visibilityCallback.call(null,n.intersectionRatio>0,n)});n.context.$nextTick(function(){i.observe(e)})}},update:function(e,t){var n=t.value;u(n),e._vue_visibilityCallback=n},unbind:function(e){e._vue_intersectionObserver&&(e._vue_intersectionObserver.disconnect(),delete e._vue_intersectionObserver,delete e._vue_visibilityCallback)}},j={version:"0.3.1",install:function(e){e.directive("observe-visibility",L)}},M=null;"undefined"!=typeof window?M=window.Vue:"undefined"!=typeof global&&(M=global.Vue),M&&M.use(j);var R=[{name:"center",watcher:function(e){return{lat:i(e.lat),lng:i(e.lng)}},identity:function(e,t){if(e&&t)return"function"!=typeof e.equals&&(e=new window.google.maps.LatLng(e)),"function"!=typeof t.equals&&(t=new window.google.maps.LatLng(t)),e.equals(t)},retriever:function(e){return{lat:e.lat(),lng:e.lng()}}},"heading","mapTypeId","tilt","zoom"],C=["panBy","panTo","panToBounds","fitBounds","getBounds"],z=["click","dblclick","drag","dragend","dragstart","mousemove","mouseout","mouseover","resize","rightclick","tilesloaded"],I={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],staticClass:"vue-google-map"},[n("div",{ref:"map",staticClass:"map-view"}),e._v(" "),n("div",{staticClass:"hidden-content"},[e._t("default")],2),e._v(" "),e._t("visible"),e._v(" "),n("resize-observer",{on:{notify:e.resize}})],2)},staticRenderFns:[],_scopeId:"data-v-3074bd5c",name:"GoogleMapsMap",mixins:[m,v,g],components:{ResizeObserver:k},directives:{ObserveVisibility:L},props:{center:{required:!0,type:Object},heading:{type:Number},mapTypeId:{type:String},options:{type:Object,default:function(){return{}}},tilt:{type:Number},zoom:{required:!0,type:Number}},beforeCreate:function(){this.$_mapPromises=[]},googleMapsReady:function(){var e=this,t=this.$refs.map,n=f({center:this.center,heading:this.heading,mapTypeId:this.mapTypeId,tilt:this.tilt,zoom:this.zoom},this.options);this.$_map=new window.google.maps.Map(t,n),this.bindProps(this.$_map,R),this.listen(this.$_map,"bounds_changed",function(){e.$emit("update:bounds",e.$_map.getBounds())}),this.listen(this.$_map,"idle",function(){e.$emit("idle",e),e.lastCenter=e.$_map.getCenter()}),this.lastCenter=this.$_map.getCenter(),this.redirectEvents(this.$_map,z),this.$_mapPromises.forEach(function(t){return t(e.$_map)})},methods:f({},function(e){var t=e.target;return e.names.reduce(function(e,n){return e[n]=function(){var e=t.call(this);if(e){for(var r=arguments.length,i=Array(r),o=0;o0&&void 0!==arguments[0])||arguments[0];this.$_map&&(window.google.maps.event.trigger(this.$_map,"resize"),e&&this.$_map.setCenter(this.lastCenter))},visibilityChanged:function(e){e&&this.$nextTick(this.resize)},$_getMap:function(){var e=this;return this.$_map?Promise.resolve(this.$_map):new Promise(function(t){e.$_mapPromises.push(t)})}})},A=["animation","clickable","cursor","draggable","icon","label","opacity","place","position","shape","title","visible","zIndex"],G=["click","rightclick","dblclick","drag","dragstart","dragend","mouseup","mousedown","mouseover","mouseout"],D={name:"GoogleMapsMarker",mixins:[b],props:{animation:{type:Number},clickable:{type:Boolean,default:!0},cursor:{type:String},draggable:{type:Boolean,default:!1},icon:{},label:{},opacity:{type:Number,default:1},place:{type:Object},position:{type:Object},shape:{type:Object},title:{type:String},visible:{default:!0},zIndex:{type:Number}},render:function(e){return this.$slots.default&&0!==this.$slots.default.length?1===this.$slots.default.length?this.$slots.default[0]:e("div",this.$slots.default):""},googleMapsReady:function(){var e=Object.assign({},this.$props);e.map=this.$_map,this.$_marker=new window.google.maps.Marker(e),this.bindProps(this.$_marker,A),this.redirectEvents(this.$_marker,G)},beforeDestroy:function(){this.$_marker&&this.$_marker.setMap(null)}},N={name:"GoogleMapsNearbyPlaces",mixins:[x],methods:{createServices:function(){this.$_placeService=new window.google.maps.places.PlacesService(this.$refs.attributions)},update:function(){var e=this;this.loading=!0,this.$_placeService.nearbySearch(this.request,function(t,n){e.setResults(t,n),e.loading=!1})}}},W={name:"GoogleMapsPlaceDetails",mixins:[x],methods:{createServices:function(){this.$_placeService=new window.google.maps.places.PlacesService(this.$refs.attributions)},update:function(){var e=this;this.loading=!0,this.$_placeService.getDetails(this.request,function(t,n){e.setResults(t,n),e.loading=!1})}}},T=void 0,B={strokeColor:"#4285F4",strokeOpacity:.25,fillColor:"#4285F4",fillOpacity:.2,strokeWeight:1},q={name:"GoogleMapsUserPosition",mixins:[m],props:{accuracy:{default:0},accuracyStyle:{type:Object,default:null},disableWatch:{type:Boolean,default:!1},hideAccuracy:{type:Boolean,default:!1},minimumAccuracy:{default:1e3},position:{type:Object},positionStyle:{type:Object,default:null},positionOptions:{type:Object,default:function(){return{enableHighAccuracy:!0,maximumAge:1e3}}}},data:function(){return{currentPosition:null,currentAccuracy:null}},watch:{position:function(e){this.currentPosition=e},accuracy:function(e){this.currentAccuracy=e},disableWatch:function(e,t){e!==t&&(e?this.stopWatch():this.startWatch())},positionOptions:function(e){this.disableWatch||(this.stopWatch(),this.startWatch())}},methods:{startWatch:function(){navigator.geolocation?this.$_watchId=navigator.geolocation.watchPosition(this.updatePosition,this.onWatchError,this.positionOptions):(console.warn("GoogleMapsUserPosition: navigator.geolocation not supported"),this.$emit("error",new Error("unsupported")))},stopWatch:function(){navigator.geolocation&&navigator.geolocation.clearWatch(this.$_watchId)},updatePosition:function(e){this.currentPosition={lat:e.coords.latitude,lng:e.coords.longitude},this.$emit("update:position",this.currentPosition),this.currentAccuracy=e.coords.accuracy,this.$emit("update:accuracy",this.currentAccuracy)},onWatchError:function(e){this.$emit("error",e)}},render:function(e){var t=[];return this.googleMapsReady&&this.currentPosition&&(null===this.minimumAccuracy||this.currentAccuracy<=this.minimumAccuracy)&&(t.push(e(D,{props:{clickable:!1,icon:this.positionStyle||T,optimized:!1,position:this.currentPosition,zIndex:3}})),this.hideAccuracy||t.push(e($,{props:{clickable:!1,radius:this.currentAccuracy,options:this.accuracyStyle||B,center:this.currentPosition,zIndex:1}}))),e("div",t)},googleMapsReady:function(){T={path:window.google.maps.SymbolPath.CIRCLE,fillColor:"#4285F4",fillOpacity:1,scale:6,strokeColor:"white",strokeWeight:2},this.disableWatch||this.startWatch()},beforeDestroy:function(){this.stopWatch()}},F={version:"0.1.1",install:function(e,r){var i=Object.assign({},{installComponents:!0,componentsPrefix:"googlemaps-"},r);t(e),n(e),i.installComponents&&l(e,i.componentsPrefix),i.load&&d.load(i.load)}},V=null;return"undefined"!=typeof window?V=window.Vue:"undefined"!=typeof global&&(V=global.Vue),V&&V.use(F),e.Circle=$,e.Geocoder=P,e.Map=I,e.Marker=D,e.NearbyPlaces=N,e.PlaceDetails=W,e.UserPosition=q,e.MapElement=b,e.default=F,e}({}); diff --git a/dist/vue-googlemaps.umd.js b/dist/vue-googlemaps.umd.js index accca50..a4b57b6 100644 --- a/dist/vue-googlemaps.umd.js +++ b/dist/vue-googlemaps.umd.js @@ -936,7 +936,8 @@ var loader = { var apiKey = _ref.apiKey, version = _ref.version, libraries = _ref.libraries, - loadCn = _ref.loadCn; + loadCn = _ref.loadCn, + useBetaRenderer = _ref.useBetaRenderer; if (typeof window === 'undefined') { // Do nothing if run from server-side @@ -981,8 +982,10 @@ var loader = { return encodeURIComponent(key) + '=' + encodeURIComponent(options[key]); }).join('&'); - if (version) { - url = url + '&v=' + version; + var usingBetaRenderer = version && version === '3.exp' || typeof useBetaRenderer === 'boolean' && useBetaRenderer === true; + + if (usingBetaRenderer || version) { + url = url + '&v=' + (usingBetaRenderer ? '3.exp&slippy=true' : version); } googleMapScript.setAttribute('src', url); @@ -1882,6 +1885,7 @@ var Map = { render: function render() { type: Number }, zoom: { + required: true, type: Number } }, @@ -2248,7 +2252,7 @@ function registerComponents(Vue, prefix) { var plugin = { // eslint-disable-next-line no-undef - version: "0.1.0", + version: "0.1.1", install: function install(Vue, options) { var finalOptions = Object.assign({}, { installComponents: true, diff --git a/package.json b/package.json index 35474d7..c55b33a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-googlemaps", - "version": "0.1.0", + "version": "0.1.1", "description": "Embed Google Maps in Vue apps", "main": "dist/vue-googlemaps.umd.js", "module": "dist/vue-googlemaps.esm.js",