Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue3-google-map

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-google-map - npm Package Compare versions

Comparing version 0.5.2 to 0.6.0

2

dist/cjs/index.js

@@ -25,3 +25,3 @@ /*

window.google.maps&&window.google.maps.version&&(console.warn("Aborted attempt to load Google Maps JS with @googlemaps/js-api-loader.This may result in undesirable behavior as script parameters may not match."),this.callback());this.resetIfRetryingFailed();this.done?this.callback():this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}
let ApiSymbol=Symbol("api"),MapSymbol=Symbol("map"),mapEvents="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),markerEvents="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseup draggable_changed clickable_changed cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),
let ApiSymbol=Symbol("api"),MapSymbol=Symbol("map"),mapEvents="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),markerEvents="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseout mouseup draggable_changed clickable_changed contextmenu cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),
polylineEvents="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),polygonEvents=polylineEvents,rectangleEvents=polylineEvents.concat(["bounds_changed"]),circleEvents=polylineEvents.concat(["center_changed","radius_changed"]);

@@ -28,0 +28,0 @@ var script=vue.defineComponent({props:{apiKey:{type:String,default:""},region:String,language:String,backgroundColor:String,center:Object,clickableIcons:{type:Boolean,default:void 0},controlSize:Number,disableDefaultUi:{type:Boolean,default:void 0},disableDoubleClickZoom:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},draggableCursor:String,draggingCursor:String,fullscreenControl:{type:Boolean,default:void 0},fullscreenControlPosition:String,gestureHandling:String,heading:Number,

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue");var o=function e(o,t){if(o===t)return!0;if(o&&t&&"object"==typeof o&&"object"==typeof t){if(o.constructor!==t.constructor)return!1;var n;if(Array.isArray(o)){var i=o.length;if(i!=t.length)return!1;for(n=i;0!=n--;)if(!e(o[n],t[n]))return!1;return!0}if(o.constructor===RegExp)return o.source===t.source&&o.flags===t.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===t.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===t.toString();var r=Object.keys(o);if((i=r.length)!==Object.keys(t).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,r[n]))return!1;for(n=i;0!=n--;)if(!e(o[i=r[n]],t[i]))return!1;return!0}return o!=o&&t!=t};class t{constructor({apiKey:e,channel:n,client:i,id:r="__googleMapsScriptId",libraries:l=[],language:a,region:s,version:c,mapIds:d,nonce:u,retries:p=3,url:g="https://maps.googleapis.com/maps/api/js"}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.loading=this.done=!1,this.errors=[],this.version=c,this.apiKey=e,this.channel=n,this.client=i,this.id=r||"__googleMapsScriptId",this.libraries=l,this.language=a,this.region=s,this.mapIds=d,this.nonce=u,this.retries=p,this.url=g,t.instance){if(!o(this.options,t.instance.options))throw Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(t.instance.options)}`);return t.instance}t.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}createUrl(){let e=this.url;return e+="?callback="+this.CALLBACK,this.apiKey&&(e+="&key="+this.apiKey),this.channel&&(e+="&channel="+this.channel),this.client&&(e+="&client="+this.client),0<this.libraries.length&&(e+="&libraries="+this.libraries.join(",")),this.language&&(e+="&language="+this.language),this.region&&(e+="&region="+this.region),this.version&&(e+="&v="+this.version),this.mapIds&&(e+="&map_ids="+this.mapIds.join(",")),e}load(){return this.loadPromise()}loadPromise(){return new Promise(((e,o)=>{this.loadCallback((t=>{t?o(t):e()}))}))}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))this.callback();else{var e=this.createUrl(),o=document.createElement("script");o.id=this.id,o.type="text/javascript",o.src=e,o.onerror=this.loadErrorCallback.bind(this),o.defer=!0,o.async=!0,this.nonce&&(o.nonce=this.nonce),document.head.appendChild(o)}}deleteScript(){let e=document.getElementById(this.id);e&&e.remove()}resetIfRetryingFailed(){let e=this.retries+1;this.done&&!this.loading&&this.errors.length>=e&&(this.deleteScript(),this.loading=this.done=!1,this.errors=[])}loadErrorCallback(e){this.errors.push(e),this.errors.length<=this.retries?(e=this.errors.length*Math.pow(2,this.errors.length),console.log(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout((()=>{this.deleteScript(),this.setScript()}),e)):(this.onerrorEvent=e,this.callback())}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach((e=>{e(this.onerrorEvent)})),this.callbacks=[]}execute(){window.google&&window.google.maps&&window.google.maps.version&&(console.warn("Aborted attempt to load Google Maps JS with @googlemaps/js-api-loader.This may result in undesirable behavior as script parameters may not match."),this.callback()),this.resetIfRetryingFailed(),this.done?this.callback():this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}let n=Symbol("api"),i=Symbol("map"),r="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),l="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseup draggable_changed clickable_changed cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),a="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),s=a,c=a.concat(["bounds_changed"]),d=a.concat(["center_changed","radius_changed"]);var u=e.defineComponent({props:{apiKey:{type:String,default:""},region:String,language:String,backgroundColor:String,center:Object,clickableIcons:{type:Boolean,default:void 0},controlSize:Number,disableDefaultUi:{type:Boolean,default:void 0},disableDoubleClickZoom:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},draggableCursor:String,draggingCursor:String,fullscreenControl:{type:Boolean,default:void 0},fullscreenControlPosition:String,gestureHandling:String,heading:Number,keyboardShortcuts:{type:Boolean,default:void 0},mapTypeControl:{type:Boolean,default:void 0},mapTypeControlOptions:Object,mapTypeId:{type:[Number,String]},maxZoom:Number,minZoom:Number,noClear:{type:Boolean,default:void 0},panControl:{type:Boolean,default:void 0},panControlPosition:String,restriction:Object,rotateControl:{type:Boolean,default:void 0},rotateControlPosition:String,scaleControl:{type:Boolean,default:void 0},scaleControlStyle:Number,scrollwheel:{type:Boolean,default:void 0},streetView:Object,streetViewControl:{type:Boolean,default:void 0},streetViewControlPosition:String,styles:Array,tilt:Number,zoom:Number,zoomControl:{type:Boolean,default:void 0},zoomControlPosition:String},emits:r,setup(o,{emit:l}){let a=e.ref(null),s=e.ref(!1),c=e.ref(null),d=e.ref(null);e.provide(i,c),e.provide(n,d);let u=()=>{var e,t,n,i,r;const l={backgroundColor:o.backgroundColor,center:o.center,clickableIcons:o.clickableIcons,controlSize:o.controlSize,disableDefaultUI:o.disableDefaultUi,disableDoubleClickZoom:o.disableDoubleClickZoom,draggable:o.draggable,draggableCursor:o.draggableCursor,draggingCursor:o.draggingCursor,fullscreenControl:o.fullscreenControl,fullscreenControlOptions:o.fullscreenControlPosition?{position:null===(e=d.value)||void 0===e?void 0:e.ControlPosition[o.fullscreenControlPosition]}:{},gestureHandling:o.gestureHandling,heading:o.heading,keyboardShortcuts:o.keyboardShortcuts,mapTypeControl:o.mapTypeControl,mapTypeControlOptions:o.mapTypeControlOptions,mapTypeId:o.mapTypeId,maxZoom:o.maxZoom,minZoom:o.minZoom,noClear:o.noClear,panControl:o.panControl,panControlOptions:o.panControlPosition?{position:null===(t=d.value)||void 0===t?void 0:t.ControlPosition[o.panControlPosition]}:{},restriction:o.restriction,rotateControl:o.rotateControl,rotateControlOptions:o.rotateControlPosition?{position:null===(n=d.value)||void 0===n?void 0:n.ControlPosition[o.rotateControlPosition]}:{},scaleControl:o.scaleControl,scaleControlOptions:o.scaleControlStyle?{style:o.scaleControlStyle}:{},scrollwheel:o.scrollwheel,streetView:o.streetView,streetViewControl:o.streetViewControl,streetViewControlOptions:o.streetViewControlPosition?{position:null===(i=d.value)||void 0===i?void 0:i.ControlPosition[o.streetViewControlPosition]}:{},styles:o.styles,tilt:o.tilt,zoom:o.zoom,zoomControl:o.zoomControl,zoomControlOptions:o.zoomControlPosition?{position:null===(r=d.value)||void 0===r?void 0:r.ControlPosition[o.zoomControlPosition]}:{}};return Object.keys(l).forEach((e=>void 0===l[e]&&delete l[e])),l};return e.onBeforeUnmount((()=>{var e;c.value&&(null===(e=d.value)||void 0===e||e.event.clearInstanceListeners(c.value))})),"undefined"!=typeof window&&new t({apiKey:o.apiKey,version:"weekly",libraries:["places"],language:o.language,region:o.region}).load().then((()=>{var{Map:t}=d.value=google.maps;c.value=new t(a.value,u()),r.forEach((e=>{var o;null===(o=c.value)||void 0===o||o.addListener(e,(o=>l(e,o)))})),s.value=!0,t=Object.keys(o).filter((e=>!["center","zoom"].includes(e))).map((t=>e.toRef(o,t))),e.watch([()=>o.center,()=>o.zoom,...t],(([e,o],[t,n])=>{var i,r,l,a=u();a=function(e,o){var t,n={};for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>o.indexOf(t)&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)0>o.indexOf(t[i])&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}(a,["center","zoom"]),null===(i=c.value)||void 0===i||i.setOptions(a),void 0!==o&&o!==n&&(null===(r=c.value)||void 0===r||r.setZoom(o)),!e||t&&e.lng===t.lng&&e.lat===t.lat||null===(l=c.value)||void 0===l||l.panTo(e)}))})),{mapRef:a,ready:s,map:c,api:d}}});u.render=function(o,t,n,i,r,l){return e.openBlock(),e.createBlock("div",null,[e.createVNode("div",e.mergeProps(o.$attrs,{ref:"mapRef"}),null,16),e.renderSlot(o.$slots,"default")])},u.__file="src/components/GoogleMap.vue";let p=(o,t,r,l)=>{let a=null;const s=e.ref(null),c=e.inject(i,e.ref(null)),d=e.inject(n,e.ref(null));return e.watch([c,r],((e,n,i)=>{c.value&&d.value&&(s.value=a=new d.value[o](Object.assign(Object.assign({},r.value),{map:c.value})),t.forEach((e=>{null==a||a.addListener(e,(o=>l(e,o)))}))),i((()=>{var e;a&&(null===(e=d.value)||void 0===e||e.event.clearInstanceListeners(a),a.setMap(null))}))}),{immediate:!0}),{component:s}};var g=e.defineComponent({props:{options:{type:Object,required:!0}},emits:l,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{marker:p("Marker",l,o,t)}),render:()=>null}),h=e.defineComponent({props:{options:{type:Object,required:!0}},emits:a,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{polyline:p("Polyline",a,o,t)}),render:()=>null}),m=e.defineComponent({props:{options:{type:Object,required:!0}},emits:s,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{polygon:p("Polygon",s,o,t)}),render:()=>null}),v=e.defineComponent({props:{options:{type:Object,required:!0}},emits:c,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{rectangle:p("Rectangle",c,o,t)}),render:()=>null}),f=e.defineComponent({props:{options:{type:Object,required:!0}},emits:d,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{circle:p("Circle",d,o,t)}),render:()=>null}),b=e.defineComponent({props:{position:{type:String,required:!0},index:Number},setup(o){let t=e.ref(null),r=e.inject(i,e.ref(null)),l=e.inject(n,e.ref(null));return e.watch([r,()=>o.position,()=>o.index],((e,[,n],i)=>{r.value&&l.value&&(o.index&&(t.value.index=o.index),t.value&&r.value.controls[l.value.ControlPosition[o.position]].push(t.value)),i((()=>{if(r.value&&l.value&&n){let e=void 0;r.value.controls[l.value.ControlPosition[n]].forEach(((o,n)=>{o===t.value&&(e=n)})),e&&r.value.controls[l.value.ControlPosition[n]].removeAt(e)}}))}),{immediate:!0}),{controlRef:t}}});let y={ref:"controlRef"};b.render=function(o,t,n,i,r,l){return e.openBlock(),e.createBlock("div",y,[e.renderSlot(o.$slots,"default")],512)},b.__file="src/components/CustomControl.vue",exports.Circle=f,exports.CustomControl=b,exports.GoogleMap=u,exports.Marker=g,exports.Polygon=m,exports.Polyline=h,exports.Rectangle=v;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue");var o=function e(o,t){if(o===t)return!0;if(o&&t&&"object"==typeof o&&"object"==typeof t){if(o.constructor!==t.constructor)return!1;var n;if(Array.isArray(o)){var i=o.length;if(i!=t.length)return!1;for(n=i;0!=n--;)if(!e(o[n],t[n]))return!1;return!0}if(o.constructor===RegExp)return o.source===t.source&&o.flags===t.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===t.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===t.toString();var r=Object.keys(o);if((i=r.length)!==Object.keys(t).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(t,r[n]))return!1;for(n=i;0!=n--;)if(!e(o[i=r[n]],t[i]))return!1;return!0}return o!=o&&t!=t};class t{constructor({apiKey:e,channel:n,client:i,id:r="__googleMapsScriptId",libraries:l=[],language:a,region:s,version:c,mapIds:d,nonce:u,retries:p=3,url:g="https://maps.googleapis.com/maps/api/js"}){if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.loading=this.done=!1,this.errors=[],this.version=c,this.apiKey=e,this.channel=n,this.client=i,this.id=r||"__googleMapsScriptId",this.libraries=l,this.language=a,this.region=s,this.mapIds=d,this.nonce=u,this.retries=p,this.url=g,t.instance){if(!o(this.options,t.instance.options))throw Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(t.instance.options)}`);return t.instance}t.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}createUrl(){let e=this.url;return e+="?callback="+this.CALLBACK,this.apiKey&&(e+="&key="+this.apiKey),this.channel&&(e+="&channel="+this.channel),this.client&&(e+="&client="+this.client),0<this.libraries.length&&(e+="&libraries="+this.libraries.join(",")),this.language&&(e+="&language="+this.language),this.region&&(e+="&region="+this.region),this.version&&(e+="&v="+this.version),this.mapIds&&(e+="&map_ids="+this.mapIds.join(",")),e}load(){return this.loadPromise()}loadPromise(){return new Promise(((e,o)=>{this.loadCallback((t=>{t?o(t):e()}))}))}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))this.callback();else{var e=this.createUrl(),o=document.createElement("script");o.id=this.id,o.type="text/javascript",o.src=e,o.onerror=this.loadErrorCallback.bind(this),o.defer=!0,o.async=!0,this.nonce&&(o.nonce=this.nonce),document.head.appendChild(o)}}deleteScript(){let e=document.getElementById(this.id);e&&e.remove()}resetIfRetryingFailed(){let e=this.retries+1;this.done&&!this.loading&&this.errors.length>=e&&(this.deleteScript(),this.loading=this.done=!1,this.errors=[])}loadErrorCallback(e){this.errors.push(e),this.errors.length<=this.retries?(e=this.errors.length*Math.pow(2,this.errors.length),console.log(`Failed to load Google Maps script, retrying in ${e} ms.`),setTimeout((()=>{this.deleteScript(),this.setScript()}),e)):(this.onerrorEvent=e,this.callback())}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach((e=>{e(this.onerrorEvent)})),this.callbacks=[]}execute(){window.google&&window.google.maps&&window.google.maps.version&&(console.warn("Aborted attempt to load Google Maps JS with @googlemaps/js-api-loader.This may result in undesirable behavior as script parameters may not match."),this.callback()),this.resetIfRetryingFailed(),this.done?this.callback():this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}let n=Symbol("api"),i=Symbol("map"),r="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),l="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseout mouseup draggable_changed clickable_changed contextmenu cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),a="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),s=a,c=a.concat(["bounds_changed"]),d=a.concat(["center_changed","radius_changed"]);var u=e.defineComponent({props:{apiKey:{type:String,default:""},region:String,language:String,backgroundColor:String,center:Object,clickableIcons:{type:Boolean,default:void 0},controlSize:Number,disableDefaultUi:{type:Boolean,default:void 0},disableDoubleClickZoom:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},draggableCursor:String,draggingCursor:String,fullscreenControl:{type:Boolean,default:void 0},fullscreenControlPosition:String,gestureHandling:String,heading:Number,keyboardShortcuts:{type:Boolean,default:void 0},mapTypeControl:{type:Boolean,default:void 0},mapTypeControlOptions:Object,mapTypeId:{type:[Number,String]},maxZoom:Number,minZoom:Number,noClear:{type:Boolean,default:void 0},panControl:{type:Boolean,default:void 0},panControlPosition:String,restriction:Object,rotateControl:{type:Boolean,default:void 0},rotateControlPosition:String,scaleControl:{type:Boolean,default:void 0},scaleControlStyle:Number,scrollwheel:{type:Boolean,default:void 0},streetView:Object,streetViewControl:{type:Boolean,default:void 0},streetViewControlPosition:String,styles:Array,tilt:Number,zoom:Number,zoomControl:{type:Boolean,default:void 0},zoomControlPosition:String},emits:r,setup(o,{emit:l}){let a=e.ref(null),s=e.ref(!1),c=e.ref(null),d=e.ref(null);e.provide(i,c),e.provide(n,d);let u=()=>{var e,t,n,i,r;const l={backgroundColor:o.backgroundColor,center:o.center,clickableIcons:o.clickableIcons,controlSize:o.controlSize,disableDefaultUI:o.disableDefaultUi,disableDoubleClickZoom:o.disableDoubleClickZoom,draggable:o.draggable,draggableCursor:o.draggableCursor,draggingCursor:o.draggingCursor,fullscreenControl:o.fullscreenControl,fullscreenControlOptions:o.fullscreenControlPosition?{position:null===(e=d.value)||void 0===e?void 0:e.ControlPosition[o.fullscreenControlPosition]}:{},gestureHandling:o.gestureHandling,heading:o.heading,keyboardShortcuts:o.keyboardShortcuts,mapTypeControl:o.mapTypeControl,mapTypeControlOptions:o.mapTypeControlOptions,mapTypeId:o.mapTypeId,maxZoom:o.maxZoom,minZoom:o.minZoom,noClear:o.noClear,panControl:o.panControl,panControlOptions:o.panControlPosition?{position:null===(t=d.value)||void 0===t?void 0:t.ControlPosition[o.panControlPosition]}:{},restriction:o.restriction,rotateControl:o.rotateControl,rotateControlOptions:o.rotateControlPosition?{position:null===(n=d.value)||void 0===n?void 0:n.ControlPosition[o.rotateControlPosition]}:{},scaleControl:o.scaleControl,scaleControlOptions:o.scaleControlStyle?{style:o.scaleControlStyle}:{},scrollwheel:o.scrollwheel,streetView:o.streetView,streetViewControl:o.streetViewControl,streetViewControlOptions:o.streetViewControlPosition?{position:null===(i=d.value)||void 0===i?void 0:i.ControlPosition[o.streetViewControlPosition]}:{},styles:o.styles,tilt:o.tilt,zoom:o.zoom,zoomControl:o.zoomControl,zoomControlOptions:o.zoomControlPosition?{position:null===(r=d.value)||void 0===r?void 0:r.ControlPosition[o.zoomControlPosition]}:{}};return Object.keys(l).forEach((e=>void 0===l[e]&&delete l[e])),l};return e.onBeforeUnmount((()=>{var e;c.value&&(null===(e=d.value)||void 0===e||e.event.clearInstanceListeners(c.value))})),"undefined"!=typeof window&&new t({apiKey:o.apiKey,version:"weekly",libraries:["places"],language:o.language,region:o.region}).load().then((()=>{var{Map:t}=d.value=google.maps;c.value=new t(a.value,u()),r.forEach((e=>{var o;null===(o=c.value)||void 0===o||o.addListener(e,(o=>l(e,o)))})),s.value=!0,t=Object.keys(o).filter((e=>!["center","zoom"].includes(e))).map((t=>e.toRef(o,t))),e.watch([()=>o.center,()=>o.zoom,...t],(([e,o],[t,n])=>{var i,r,l,a=u();a=function(e,o){var t,n={};for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>o.indexOf(t)&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)0>o.indexOf(t[i])&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}(a,["center","zoom"]),null===(i=c.value)||void 0===i||i.setOptions(a),void 0!==o&&o!==n&&(null===(r=c.value)||void 0===r||r.setZoom(o)),!e||t&&e.lng===t.lng&&e.lat===t.lat||null===(l=c.value)||void 0===l||l.panTo(e)}))})),{mapRef:a,ready:s,map:c,api:d}}});u.render=function(o,t,n,i,r,l){return e.openBlock(),e.createBlock("div",null,[e.createVNode("div",e.mergeProps(o.$attrs,{ref:"mapRef"}),null,16),e.renderSlot(o.$slots,"default")])},u.__file="src/components/GoogleMap.vue";let p=(o,t,r,l)=>{let a=null;const s=e.ref(null),c=e.inject(i,e.ref(null)),d=e.inject(n,e.ref(null));return e.watch([c,r],((e,n,i)=>{c.value&&d.value&&(s.value=a=new d.value[o](Object.assign(Object.assign({},r.value),{map:c.value})),t.forEach((e=>{null==a||a.addListener(e,(o=>l(e,o)))}))),i((()=>{var e;a&&(null===(e=d.value)||void 0===e||e.event.clearInstanceListeners(a),a.setMap(null))}))}),{immediate:!0}),{component:s}};var g=e.defineComponent({props:{options:{type:Object,required:!0}},emits:l,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{marker:p("Marker",l,o,t)}),render:()=>null}),h=e.defineComponent({props:{options:{type:Object,required:!0}},emits:a,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{polyline:p("Polyline",a,o,t)}),render:()=>null}),m=e.defineComponent({props:{options:{type:Object,required:!0}},emits:s,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{polygon:p("Polygon",s,o,t)}),render:()=>null}),v=e.defineComponent({props:{options:{type:Object,required:!0}},emits:c,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{rectangle:p("Rectangle",c,o,t)}),render:()=>null}),f=e.defineComponent({props:{options:{type:Object,required:!0}},emits:d,setup:(o,{emit:t})=>(o=e.toRef(o,"options"),{circle:p("Circle",d,o,t)}),render:()=>null}),b=e.defineComponent({props:{position:{type:String,required:!0},index:Number},setup(o){let t=e.ref(null),r=e.inject(i,e.ref(null)),l=e.inject(n,e.ref(null));return e.watch([r,()=>o.position,()=>o.index],((e,[,n],i)=>{r.value&&l.value&&(o.index&&(t.value.index=o.index),t.value&&r.value.controls[l.value.ControlPosition[o.position]].push(t.value)),i((()=>{if(r.value&&l.value&&n){let e=void 0;r.value.controls[l.value.ControlPosition[n]].forEach(((o,n)=>{o===t.value&&(e=n)})),e&&r.value.controls[l.value.ControlPosition[n]].removeAt(e)}}))}),{immediate:!0}),{controlRef:t}}});let y={ref:"controlRef"};b.render=function(o,t,n,i,r,l){return e.openBlock(),e.createBlock("div",y,[e.renderSlot(o.$slots,"default")],512)},b.__file="src/components/CustomControl.vue",exports.Circle=f,exports.CustomControl=b,exports.GoogleMap=u,exports.Marker=g,exports.Polygon=m,exports.Polyline=h,exports.Rectangle=v;

@@ -24,3 +24,3 @@ import{defineComponent,ref,provide,onBeforeUnmount,toRef,watch,openBlock,createBlock,createVNode,mergeProps,renderSlot,inject}from'vue';/*

window.google.maps&&window.google.maps.version&&(console.warn("Aborted attempt to load Google Maps JS with @googlemaps/js-api-loader.This may result in undesirable behavior as script parameters may not match."),this.callback());this.resetIfRetryingFailed();this.done?this.callback():this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}
let w=Symbol("api"),x=Symbol("map"),y="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),z="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseup draggable_changed clickable_changed cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),
let w=Symbol("api"),x=Symbol("map"),y="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed".split(" "),z="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseout mouseup draggable_changed clickable_changed contextmenu cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" "),
A="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),B=A.concat(["bounds_changed"]),C=A.concat(["center_changed","radius_changed"]);

@@ -27,0 +27,0 @@ var D=defineComponent({props:{apiKey:{type:String,default:""},region:String,language:String,backgroundColor:String,center:Object,clickableIcons:{type:Boolean,default:void 0},controlSize:Number,disableDefaultUi:{type:Boolean,default:void 0},disableDoubleClickZoom:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},draggableCursor:String,draggingCursor:String,fullscreenControl:{type:Boolean,default:void 0},fullscreenControlPosition:String,gestureHandling:String,heading:Number,keyboardShortcuts:{type:Boolean,

@@ -34,5 +34,7 @@ export const ApiSymbol = Symbol('api');

'mousedown',
'mouseout',
'mouseup',
'draggable_changed',
'clickable_changed',
'contextmenu',
'cursor_changed',

@@ -39,0 +41,0 @@ 'flat_changed',

{
"name": "vue3-google-map",
"version": "0.5.2",
"version": "0.6.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc