vue3-google-map
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -22,3 +22,3 @@ /* | ||
()=>{b()}})};return Promise.race(e.timeout?[c(e.timeout),d()]:[d()])}}function getUrl(a,b,e=!0){let c=`${BASE_URL}?libraries=${a}&sensors=false`;b&&(c=`${c}&key=${b}`);e&&(c=`${c}&callback=${a}LoaderCallback`);return c}function checkIfScriptTagExists(a,b){return!!document.querySelector(`#google-maps-${a}-js`)} | ||
let map=vue.ref(null),api=vue.ref(null),useMap=()=>({map,api}),useSetupMapComponent=(a,b,e,c)=>{let d=null;const f=vue.ref(null),{map:h,api:g}=useMap();vue.watch([h,e],(p,q,n)=>{h.value&&g.value&&(f.value=d=new g.value[a](Object.assign(Object.assign({},e.value),{map:h.value})),b.forEach(a=>{null===d||void 0===d?void 0:d.addListener(a,()=>c(a))}));n(()=>{var a;d&&(null===(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(d),d.setMap(null))})});return{component:f}},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(" "), | ||
let map=vue.ref(null),api=vue.ref(null),useMap=()=>({map,api}),useSetupMapComponent=(a,b,e,c)=>{let d=null;const f=vue.ref(null),{map:h,api:g}=useMap();vue.watch([h,e],(p,q,n)=>{h.value&&g.value&&(f.value=d=new g.value[a](Object.assign(Object.assign({},e.value),{map:h.value})),b.forEach(a=>{null===d||void 0===d?void 0:d.addListener(a,b=>c(a,b))}));n(()=>{var a;d&&(null===(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(d),d.setMap(null))})});return{component:f}},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(" "),polylineEvents="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),polygonEvents=polylineEvents,rectangleEvents=polylineEvents.concat(["bounds_changed"]),circleEvents= | ||
@@ -32,3 +32,3 @@ polylineEvents.concat(["center_changed","radius_changed"]); | ||
{position:null===(e=f.value)||void 0===e?void 0:e.ControlPosition[a.streetViewControlPosition]}:{},styles:a.styles,tilt:a.tilt,zoom:a.zoom,zoomControl:a.zoomControl,zoomControlOptions:a.zoomControlPosition?{position:null===(h=f.value)||void 0===h?void 0:h.ControlPosition[a.zoomControlPosition]}:{}};Object.keys(k).forEach(a=>void 0===k[a]&&delete k[a]);return k};vue.onBeforeUnmount(()=>{var a;d.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(d.value))});"undefined"!==typeof window&& | ||
loadNow("places",a.apiKey).then(({maps:g})=>{({Map:g}=f.value=g);d.value=new g(e.value,h());mapEvents.forEach(a=>{var c;null===(c=d.value)||void 0===c?void 0:c.addListener(a,()=>b(a))});c.value=!0;g=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(b=>vue.toRef(a,b));vue.watch([()=>a.center,()=>a.zoom,...g],([a,b],[c,e])=>{var f,g,l,m=h();m=__rest(m,["center","zoom"]);null===(f=d.value)||void 0===f?void 0:f.setOptions(m);void 0!==b&&b!==e&&(null===(g=d.value)||void 0===g?void 0:g.setZoom(b)); | ||
loadNow("places",a.apiKey).then(({maps:g})=>{({Map:g}=f.value=g);d.value=new g(e.value,h());mapEvents.forEach(a=>{var c;null===(c=d.value)||void 0===c?void 0:c.addListener(a,c=>b(a,c))});c.value=!0;g=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(b=>vue.toRef(a,b));vue.watch([()=>a.center,()=>a.zoom,...g],([a,b],[c,e])=>{var f,g,l,m=h();m=__rest(m,["center","zoom"]);null===(f=d.value)||void 0===f?void 0:f.setOptions(m);void 0!==b&&b!==e&&(null===(g=d.value)||void 0===g?void 0:g.setZoom(b)); | ||
!a||c&&a.lng===c.lng&&a.lat===c.lat||(null===(l=d.value)||void 0===l?void 0:l.panTo(a))})});return{mapRef:e,ready:c,map:d,api:f}}});let _hoisted_1={ref:"mapRef"};function render(a,b,e,c,d,f){return vue.openBlock(),vue.createBlock("div",_hoisted_1,[vue.renderSlot(a.$slots,"default")],512)}script.render=render;script.__file="src/components/GoogleMap.vue"; | ||
@@ -35,0 +35,0 @@ var Marker=vue.defineComponent({props:{options:{type:Object,required:!0}},emits:markerEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{marker:useSetupMapComponent("Marker",markerEvents,a,b)}},render:()=>null}),Polyline=vue.defineComponent({props:{options:{type:Object,required:!0}},emits:polylineEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{polyline:useSetupMapComponent("Polyline",polylineEvents,a,b)}},render:()=>null}),Polygon=vue.defineComponent({props:{options:{type:Object,required:!0}}, |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,o,t=require("vue");(o=e||(e={}))[o.Continue=100]="Continue",o[o.Success=200]="Success",o[o.Created=201]="Created",o[o.Accepted=202]="Accepted",o[o.NoContent=204]="NoContent",o[o.MovedPermenantly=301]="MovedPermenantly",o[o.TemporaryRedirect=307]="TemporaryRedirect",o[o.NotModified=304]="NotModified",o[o.BadRequest=400]="BadRequest",o[o.Unauthorized=401]="Unauthorized",o[o.PaymentRequired=402]="PaymentRequired",o[o.Forbidden=403]="Forbidden",o[o.NotFound=404]="NotFound",o[o.MethodNotAllowed=405]="MethodNotAllowed",o[o.RequestTimeout=408]="RequestTimeout",o[o.Conflict=409]="Conflict",o[o.Gone=410]="Gone",o[o.IAmATeapot=418]="IAmATeapot",o[o.UnprocessableEntity=422]="UnprocessableEntity",o[o.TooManyRequests=429]="TooManyRequests",o[o.InternalServerError=500]="InternalServerError",o[o.NotImplemented=501]="NotImplemented",o[o.BadGateway=502]="BadGateway",o[o.ServiceUnavailable=503]="ServiceUnavailable",o[o.GatewayTimeout=504]="GatewayTimeout",o[o.AuthenticationRequired=511]="AuthenticationRequired",Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});let n="https://maps.googleapis.com/maps/api/js";async function r(e,o){return l(e)||await async function(e,o,t={}){if(!l(e)){var r=async(o=2e3)=>{throw await async function(e){return new Promise((o=>setTimeout(o,e)))}(o),Error(`Timed out waiting for Google API to load [ ${e} / ${o} ]`)},i=()=>{var t=document.createElement("script");return t.id=`google-maps-${e}-js`,t.src=function(e,o,t=!0){let r=`${n}?libraries=${e}&sensors=false`;return o&&(r=`${r}&key=${o}`),t&&(r=`${r}&callback=${e}LoaderCallback`),r}(e,o),document.querySelector("head").appendChild(t),new Promise((o=>{window[e+"LoaderCallback"]=()=>{o()}}))};return Promise.race(t.timeout?[r(t.timeout),i()]:[i()])}console.info(`Attempt to add script tag for the "${e}" library in Google Maps ignored as this tag already exists in the DOM${o?" [ "+o+"]":""}`)}(e,o),window.google}function l(e,o){return!!document.querySelector(`#google-maps-${e}-js`)}let i=t.ref(null),a=t.ref(null),s=()=>({map:i,api:a}),d=(e,o,n,r)=>{let l=null;const i=t.ref(null),{map:a,api:d}=s();return t.watch([a,n],((t,s,u)=>{a.value&&d.value&&(i.value=l=new d.value[e](Object.assign(Object.assign({},n.value),{map:a.value})),o.forEach((e=>{null==l||l.addListener(e,(()=>r(e)))}))),u((()=>{var e;l&&(null===(e=d.value)||void 0===e||e.event.clearInstanceListeners(l),l.setMap(null))}))})),{component:i}},u="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(" "),c="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(" "),p="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),m=p,g=p.concat(["bounds_changed"]),v=p.concat(["center_changed","radius_changed"]);var C=t.defineComponent({props:{apiKey: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:u,setup(e,{emit:o}){let n=t.ref(null),l=t.ref(!1),{map:i,api:a}=s(),d=()=>{var o,t,n,r,l;const i={backgroundColor:e.backgroundColor,center:e.center,clickableIcons:e.clickableIcons,controlSize:e.controlSize,disableDefaultUI:e.disableDefaultUi,disableDoubleClickZoom:e.disableDoubleClickZoom,draggable:e.draggable,draggableCursor:e.draggableCursor,draggingCursor:e.draggingCursor,fullscreenControl:e.fullscreenControl,fullscreenControlOptions:e.fullscreenControlPosition?{position:null===(o=a.value)||void 0===o?void 0:o.ControlPosition[e.fullscreenControlPosition]}:{},gestureHandling:e.gestureHandling,heading:e.heading,keyboardShortcuts:e.keyboardShortcuts,mapTypeControl:e.mapTypeControl,mapTypeControlOptions:e.mapTypeControlOptions,mapTypeId:e.mapTypeId,maxZoom:e.maxZoom,minZoom:e.minZoom,noClear:e.noClear,panControl:e.panControl,panControlOptions:e.panControlPosition?{position:null===(t=a.value)||void 0===t?void 0:t.ControlPosition[e.panControlPosition]}:{},restriction:e.restriction,rotateControl:e.rotateControl,rotateControlOptions:e.rotateControlPosition?{position:null===(n=a.value)||void 0===n?void 0:n.ControlPosition[e.rotateControlPosition]}:{},scaleControl:e.scaleControl,scaleControlOptions:e.scaleControlStyle?{style:e.scaleControlStyle}:{},scrollwheel:e.scrollwheel,streetView:e.streetView,streetViewControl:e.streetViewControl,streetViewControlOptions:e.streetViewControlPosition?{position:null===(r=a.value)||void 0===r?void 0:r.ControlPosition[e.streetViewControlPosition]}:{},styles:e.styles,tilt:e.tilt,zoom:e.zoom,zoomControl:e.zoomControl,zoomControlOptions:e.zoomControlPosition?{position:null===(l=a.value)||void 0===l?void 0:l.ControlPosition[e.zoomControlPosition]}:{}};return Object.keys(i).forEach((e=>void 0===i[e]&&delete i[e])),i};return t.onBeforeUnmount((()=>{var e;i.value&&(null===(e=a.value)||void 0===e||e.event.clearInstanceListeners(i.value))})),"undefined"!=typeof window&&r("places",e.apiKey).then((({maps:r})=>{({Map:r}=a.value=r),i.value=new r(n.value,d()),u.forEach((e=>{var t;null===(t=i.value)||void 0===t||t.addListener(e,(()=>o(e)))})),l.value=!0,r=Object.keys(e).filter((e=>!["center","zoom"].includes(e))).map((o=>t.toRef(e,o))),t.watch([()=>e.center,()=>e.zoom,...r],(([e,o],[t,n])=>{var r,l,a,s=d();s=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 r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)0>o.indexOf(t[r])&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(s,["center","zoom"]),null===(r=i.value)||void 0===r||r.setOptions(s),void 0!==o&&o!==n&&(null===(l=i.value)||void 0===l||l.setZoom(o)),!e||t&&e.lng===t.lng&&e.lat===t.lat||null===(a=i.value)||void 0===a||a.panTo(e)}))})),{mapRef:n,ready:l,map:i,api:a}}});let y={ref:"mapRef"};C.render=function(e,o,n,r,l,i){return t.openBlock(),t.createBlock("div",y,[t.renderSlot(e.$slots,"default")],512)},C.__file="src/components/GoogleMap.vue";var f=t.defineComponent({props:{options:{type:Object,required:!0}},emits:c,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{marker:d("Marker",c,e,o)}),render:()=>null}),b=t.defineComponent({props:{options:{type:Object,required:!0}},emits:p,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{polyline:d("Polyline",p,e,o)}),render:()=>null}),h=t.defineComponent({props:{options:{type:Object,required:!0}},emits:m,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{polygon:d("Polygon",m,e,o)}),render:()=>null}),w=t.defineComponent({props:{options:{type:Object,required:!0}},emits:g,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{rectangle:d("Rectangle",g,e,o)}),render:()=>null}),P=t.defineComponent({props:{options:{type:Object,required:!0}},emits:v,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{circle:d("Circle",v,e,o)}),render:()=>null}),k=t.defineComponent({props:{position:{type:String,required:!0},index:Number},setup(e){let o=t.ref(null),{map:n,api:r}=s();return t.watch([n,()=>e.position,()=>e.index],((t,l,i)=>{n.value&&r.value&&(e.index&&(o.value.index=e.index),o.value&&n.value.controls[r.value.ControlPosition[e.position]].push(o.value)),i((()=>{if(n.value&&r.value&&o.value){let e=void 0;n.value.controls[r.value.ControlPosition[l[1]]].forEach(((t,n)=>{t===o.value&&(e=n)})),e&&n.value.controls[r.value.ControlPosition[l[1]]].removeAt(e)}}))})),{controlRef:o}}});let O={ref:"controlRef"};k.render=function(e,o,n,r,l,i){return t.openBlock(),t.createBlock("div",O,[t.renderSlot(e.$slots,"default")],512)},k.__file="src/components/CustomControl.vue",exports.Circle=P,exports.CustomControl=k,exports.GoogleMap=C,exports.Marker=f,exports.Polygon=h,exports.Polyline=b,exports.Rectangle=w; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,o,t=require("vue");(o=e||(e={}))[o.Continue=100]="Continue",o[o.Success=200]="Success",o[o.Created=201]="Created",o[o.Accepted=202]="Accepted",o[o.NoContent=204]="NoContent",o[o.MovedPermenantly=301]="MovedPermenantly",o[o.TemporaryRedirect=307]="TemporaryRedirect",o[o.NotModified=304]="NotModified",o[o.BadRequest=400]="BadRequest",o[o.Unauthorized=401]="Unauthorized",o[o.PaymentRequired=402]="PaymentRequired",o[o.Forbidden=403]="Forbidden",o[o.NotFound=404]="NotFound",o[o.MethodNotAllowed=405]="MethodNotAllowed",o[o.RequestTimeout=408]="RequestTimeout",o[o.Conflict=409]="Conflict",o[o.Gone=410]="Gone",o[o.IAmATeapot=418]="IAmATeapot",o[o.UnprocessableEntity=422]="UnprocessableEntity",o[o.TooManyRequests=429]="TooManyRequests",o[o.InternalServerError=500]="InternalServerError",o[o.NotImplemented=501]="NotImplemented",o[o.BadGateway=502]="BadGateway",o[o.ServiceUnavailable=503]="ServiceUnavailable",o[o.GatewayTimeout=504]="GatewayTimeout",o[o.AuthenticationRequired=511]="AuthenticationRequired",Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});let n="https://maps.googleapis.com/maps/api/js";async function r(e,o){return l(e)||await async function(e,o,t={}){if(!l(e)){var r=async(o=2e3)=>{throw await async function(e){return new Promise((o=>setTimeout(o,e)))}(o),Error(`Timed out waiting for Google API to load [ ${e} / ${o} ]`)},i=()=>{var t=document.createElement("script");return t.id=`google-maps-${e}-js`,t.src=function(e,o,t=!0){let r=`${n}?libraries=${e}&sensors=false`;return o&&(r=`${r}&key=${o}`),t&&(r=`${r}&callback=${e}LoaderCallback`),r}(e,o),document.querySelector("head").appendChild(t),new Promise((o=>{window[e+"LoaderCallback"]=()=>{o()}}))};return Promise.race(t.timeout?[r(t.timeout),i()]:[i()])}console.info(`Attempt to add script tag for the "${e}" library in Google Maps ignored as this tag already exists in the DOM${o?" [ "+o+"]":""}`)}(e,o),window.google}function l(e,o){return!!document.querySelector(`#google-maps-${e}-js`)}let i=t.ref(null),a=t.ref(null),s=()=>({map:i,api:a}),d=(e,o,n,r)=>{let l=null;const i=t.ref(null),{map:a,api:d}=s();return t.watch([a,n],((t,s,u)=>{a.value&&d.value&&(i.value=l=new d.value[e](Object.assign(Object.assign({},n.value),{map:a.value})),o.forEach((e=>{null==l||l.addListener(e,(o=>r(e,o)))}))),u((()=>{var e;l&&(null===(e=d.value)||void 0===e||e.event.clearInstanceListeners(l),l.setMap(null))}))})),{component:i}},u="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(" "),c="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(" "),p="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),m=p,g=p.concat(["bounds_changed"]),v=p.concat(["center_changed","radius_changed"]);var C=t.defineComponent({props:{apiKey: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:u,setup(e,{emit:o}){let n=t.ref(null),l=t.ref(!1),{map:i,api:a}=s(),d=()=>{var o,t,n,r,l;const i={backgroundColor:e.backgroundColor,center:e.center,clickableIcons:e.clickableIcons,controlSize:e.controlSize,disableDefaultUI:e.disableDefaultUi,disableDoubleClickZoom:e.disableDoubleClickZoom,draggable:e.draggable,draggableCursor:e.draggableCursor,draggingCursor:e.draggingCursor,fullscreenControl:e.fullscreenControl,fullscreenControlOptions:e.fullscreenControlPosition?{position:null===(o=a.value)||void 0===o?void 0:o.ControlPosition[e.fullscreenControlPosition]}:{},gestureHandling:e.gestureHandling,heading:e.heading,keyboardShortcuts:e.keyboardShortcuts,mapTypeControl:e.mapTypeControl,mapTypeControlOptions:e.mapTypeControlOptions,mapTypeId:e.mapTypeId,maxZoom:e.maxZoom,minZoom:e.minZoom,noClear:e.noClear,panControl:e.panControl,panControlOptions:e.panControlPosition?{position:null===(t=a.value)||void 0===t?void 0:t.ControlPosition[e.panControlPosition]}:{},restriction:e.restriction,rotateControl:e.rotateControl,rotateControlOptions:e.rotateControlPosition?{position:null===(n=a.value)||void 0===n?void 0:n.ControlPosition[e.rotateControlPosition]}:{},scaleControl:e.scaleControl,scaleControlOptions:e.scaleControlStyle?{style:e.scaleControlStyle}:{},scrollwheel:e.scrollwheel,streetView:e.streetView,streetViewControl:e.streetViewControl,streetViewControlOptions:e.streetViewControlPosition?{position:null===(r=a.value)||void 0===r?void 0:r.ControlPosition[e.streetViewControlPosition]}:{},styles:e.styles,tilt:e.tilt,zoom:e.zoom,zoomControl:e.zoomControl,zoomControlOptions:e.zoomControlPosition?{position:null===(l=a.value)||void 0===l?void 0:l.ControlPosition[e.zoomControlPosition]}:{}};return Object.keys(i).forEach((e=>void 0===i[e]&&delete i[e])),i};return t.onBeforeUnmount((()=>{var e;i.value&&(null===(e=a.value)||void 0===e||e.event.clearInstanceListeners(i.value))})),"undefined"!=typeof window&&r("places",e.apiKey).then((({maps:r})=>{({Map:r}=a.value=r),i.value=new r(n.value,d()),u.forEach((e=>{var t;null===(t=i.value)||void 0===t||t.addListener(e,(t=>o(e,t)))})),l.value=!0,r=Object.keys(e).filter((e=>!["center","zoom"].includes(e))).map((o=>t.toRef(e,o))),t.watch([()=>e.center,()=>e.zoom,...r],(([e,o],[t,n])=>{var r,l,a,s=d();s=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 r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)0>o.indexOf(t[r])&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(s,["center","zoom"]),null===(r=i.value)||void 0===r||r.setOptions(s),void 0!==o&&o!==n&&(null===(l=i.value)||void 0===l||l.setZoom(o)),!e||t&&e.lng===t.lng&&e.lat===t.lat||null===(a=i.value)||void 0===a||a.panTo(e)}))})),{mapRef:n,ready:l,map:i,api:a}}});let y={ref:"mapRef"};C.render=function(e,o,n,r,l,i){return t.openBlock(),t.createBlock("div",y,[t.renderSlot(e.$slots,"default")],512)},C.__file="src/components/GoogleMap.vue";var f=t.defineComponent({props:{options:{type:Object,required:!0}},emits:c,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{marker:d("Marker",c,e,o)}),render:()=>null}),b=t.defineComponent({props:{options:{type:Object,required:!0}},emits:p,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{polyline:d("Polyline",p,e,o)}),render:()=>null}),h=t.defineComponent({props:{options:{type:Object,required:!0}},emits:m,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{polygon:d("Polygon",m,e,o)}),render:()=>null}),w=t.defineComponent({props:{options:{type:Object,required:!0}},emits:g,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{rectangle:d("Rectangle",g,e,o)}),render:()=>null}),P=t.defineComponent({props:{options:{type:Object,required:!0}},emits:v,setup:(e,{emit:o})=>(e=t.toRef(e,"options"),{circle:d("Circle",v,e,o)}),render:()=>null}),k=t.defineComponent({props:{position:{type:String,required:!0},index:Number},setup(e){let o=t.ref(null),{map:n,api:r}=s();return t.watch([n,()=>e.position,()=>e.index],((t,l,i)=>{n.value&&r.value&&(e.index&&(o.value.index=e.index),o.value&&n.value.controls[r.value.ControlPosition[e.position]].push(o.value)),i((()=>{if(n.value&&r.value&&o.value){let e=void 0;n.value.controls[r.value.ControlPosition[l[1]]].forEach(((t,n)=>{t===o.value&&(e=n)})),e&&n.value.controls[r.value.ControlPosition[l[1]]].removeAt(e)}}))})),{controlRef:o}}});let O={ref:"controlRef"};k.render=function(e,o,n,r,l,i){return t.openBlock(),t.createBlock("div",O,[t.renderSlot(e.$slots,"default")],512)},k.__file="src/components/CustomControl.vue",exports.Circle=P,exports.CustomControl=k,exports.GoogleMap=C,exports.Marker=f,exports.Polygon=h,exports.Polyline=b,exports.Rectangle=w; |
@@ -21,3 +21,3 @@ import{ref,watch,defineComponent,onBeforeUnmount,toRef,openBlock,createBlock,renderSlot}from'vue';/* | ||
()=>{c()}})};return Promise.race(f.timeout?[d(f.timeout),e()]:[e()])}}function y(a,c,f=!0){let d=`${"https://maps.googleapis.com/maps/api/js"}?libraries=${a}&sensors=false`;c&&(d=`${d}&key=${c}`);f&&(d=`${d}&callback=${a}LoaderCallback`);return d} | ||
let z=ref(null),A=ref(null),B=(a,c,f,d)=>{let e=null;const g=ref(null),{map:k,api:h}={map:z,api:A};watch([k,f],(v,R,J)=>{k.value&&h.value&&(g.value=e=new h.value[a](Object.assign(Object.assign({},f.value),{map:k.value})),c.forEach(a=>{null===e||void 0===e?void 0:e.addListener(a,()=>d(a))}));J(()=>{var a;e&&(null===(a=h.value)||void 0===a?void 0:a.event.clearInstanceListeners(e),e.setMap(null))})});return{component:g}},C="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(" "), | ||
let z=ref(null),A=ref(null),B=(a,c,f,d)=>{let e=null;const g=ref(null),{map:k,api:h}={map:z,api:A};watch([k,f],(v,R,J)=>{k.value&&h.value&&(g.value=e=new h.value[a](Object.assign(Object.assign({},f.value),{map:k.value})),c.forEach(a=>{null===e||void 0===e?void 0:e.addListener(a,c=>d(a,c))}));J(()=>{var a;e&&(null===(a=h.value)||void 0===a?void 0:a.event.clearInstanceListeners(e),e.setMap(null))})});return{component:g}},C="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(" "), | ||
D="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(" "),E="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "),F=E.concat(["bounds_changed"]),G=E.concat(["center_changed","radius_changed"]); | ||
@@ -30,3 +30,3 @@ var H=defineComponent({props:{apiKey: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, | ||
void 0===f?void 0:f.ControlPosition[a.streetViewControlPosition]}:{},styles:a.styles,tilt:a.tilt,zoom:a.zoom,zoomControl:a.zoomControl,zoomControlOptions:a.zoomControlPosition?{position:null===(k=g.value)||void 0===k?void 0:k.ControlPosition[a.zoomControlPosition]}:{}};Object.keys(r).forEach(a=>void 0===r[a]&&delete r[a]);return r};onBeforeUnmount(()=>{var a;e.value&&(null===(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value))});"undefined"!==typeof window&&t("places",a.apiKey).then(({maps:h})=> | ||
{({Map:h}=g.value=h);e.value=new h(f.value,k());C.forEach(a=>{var d;null===(d=e.value)||void 0===d?void 0:d.addListener(a,()=>c(a))});d.value=!0;h=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(c=>toRef(a,c));watch([()=>a.center,()=>a.zoom,...h],([a,c],[d,f])=>{var g,h,w,m=k(),v=["center","zoom"],x={},l;for(l in m)Object.prototype.hasOwnProperty.call(m,l)&&0>v.indexOf(l)&&(x[l]=m[l]);if(null!=m&&"function"===typeof Object.getOwnPropertySymbols){var p=0;for(l=Object.getOwnPropertySymbols(m);p< | ||
{({Map:h}=g.value=h);e.value=new h(f.value,k());C.forEach(a=>{var d;null===(d=e.value)||void 0===d?void 0:d.addListener(a,e=>c(a,e))});d.value=!0;h=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(c=>toRef(a,c));watch([()=>a.center,()=>a.zoom,...h],([a,c],[d,f])=>{var g,h,w,m=k(),v=["center","zoom"],x={},l;for(l in m)Object.prototype.hasOwnProperty.call(m,l)&&0>v.indexOf(l)&&(x[l]=m[l]);if(null!=m&&"function"===typeof Object.getOwnPropertySymbols){var p=0;for(l=Object.getOwnPropertySymbols(m);p< | ||
l.length;p++)0>v.indexOf(l[p])&&Object.prototype.propertyIsEnumerable.call(m,l[p])&&(x[l[p]]=m[l[p]])}null===(g=e.value)||void 0===g?void 0:g.setOptions(x);void 0!==c&&c!==f&&(null===(h=e.value)||void 0===h?void 0:h.setZoom(c));!a||d&&a.lng===d.lng&&a.lat===d.lat||(null===(w=e.value)||void 0===w?void 0:w.panTo(a))})});return{mapRef:f,ready:d,map:e,api:g}}});let I={ref:"mapRef"};H.render=function(a){return openBlock(),createBlock("div",I,[renderSlot(a.$slots,"default")],512)};H.__file="src/components/GoogleMap.vue"; | ||
@@ -33,0 +33,0 @@ var K=defineComponent({props:{options:{type:Object,required:!0}},emits:D,setup(a,{emit:c}){a=toRef(a,"options");return{marker:B("Marker",D,a,c)}},render:()=>null}),L=defineComponent({props:{options:{type:Object,required:!0}},emits:E,setup(a,{emit:c}){a=toRef(a,"options");return{polyline:B("Polyline",E,a,c)}},render:()=>null}),M=defineComponent({props:{options:{type:Object,required:!0}},emits:E,setup(a,{emit:c}){a=toRef(a,"options");return{polygon:B("Polygon",E,a,c)}},render:()=>null}),N=defineComponent({props:{options:{type:Object, |
@@ -11,3 +11,3 @@ import { watch, ref } from 'vue'; | ||
events.forEach(event => { | ||
_component === null || _component === void 0 ? void 0 : _component.addListener(event, () => emit(event)); | ||
_component === null || _component === void 0 ? void 0 : _component.addListener(event, (e) => emit(event, e)); | ||
}); | ||
@@ -14,0 +14,0 @@ } |
{ | ||
"name": "vue3-google-map", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104114