vue3-google-map
Advanced tools
Comparing version 0.8.4 to 0.8.5
@@ -21,3 +21,3 @@ 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var vue=require("vue");let mapSymbol=Symbol("map"),apiSymbol=Symbol("api"),mapTilesLoadedSymbol=Symbol("mapTilesLoaded"),loaderInstance=vue.ref(null),polylineEvents="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "); | ||
let useSetupMapComponent=(a,b,e,c)=>{let d=null;const f=vue.ref(null),g=vue.inject(mapSymbol,vue.ref(null)),l=vue.inject(apiSymbol,vue.ref(null));vue.watch([g,e],(k,[h,m])=>{k=JSON.stringify(e.value)!==JSON.stringify(m)||g.value!==h;g.value&&l.value&&k&&(d?(d.setOptions(e.value),d.setMap(g.value)):(f.value=d=new l.value[a]({...e.value,map:g.value}),b.forEach(a=>{null===d||void 0===d?void 0:d.addListener(a,b=>c(a,b))})))},{immediate:!0});vue.onBeforeUnmount(()=>{var a;d&&(null===(a=l.value)||void 0=== | ||
a?void 0:a.event.clearInstanceListeners(d),d.setMap(null))});return{component:f}},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(" "); | ||
a?void 0:a.event.clearInstanceListeners(d),d.setMap(null))});return f},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(" "); | ||
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}}, | ||
@@ -24,0 +24,0 @@ emits:polylineEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{polygon:useSetupMapComponent("Polygon",polylineEvents,a,b)}},render:()=>null});let rectangleEvents=polylineEvents.concat(["bounds_changed"]);var Rectangle=vue.defineComponent({props:{options:{type:Object,required:!0}},emits:rectangleEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{rectangle:useSetupMapComponent("Rectangle",rectangleEvents,a,b)}},render:()=>null}); |
@@ -21,3 +21,3 @@ import{ref,defineComponent,provide,watch,onMounted,toRef,onBeforeUnmount,pushScopeId,popScopeId,openBlock,createBlock,createVNode,renderSlot,withScopeId,inject,Fragment,createCommentVNode,withDirectives,vShow,computed,Comment}from'vue';let n=Symbol("map"),p=Symbol("api"),q=Symbol("mapTilesLoaded"),r=ref(null),t="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "); | ||
let I=(a,b,e,d)=>{let c=null;const f=ref(null),g=inject(n,ref(null)),m=inject(p,ref(null));watch([g,e],(l,[k,h])=>{l=JSON.stringify(e.value)!==JSON.stringify(h)||g.value!==k;g.value&&m.value&&l&&(c?(c.setOptions(e.value),c.setMap(g.value)):(f.value=c=new m.value[a]({...e.value,map:g.value}),b.forEach(a=>{null===c||void 0===c?void 0:c.addListener(a,b=>d(a,b))})))},{immediate:!0});onBeforeUnmount(()=>{var a;c&&(null===(a=m.value)||void 0===a?void 0:a.event.clearInstanceListeners(c),c.setMap(null))}); | ||
return{component:f}},J="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(" "); | ||
return f},J="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(" "); | ||
var K=defineComponent({props:{options:{type:Object,required:!0}},emits:J,setup(a,{emit:b}){a=toRef(a,"options");return{marker:I("Marker",J,a,b)}},render:()=>null}),L=defineComponent({props:{options:{type:Object,required:!0}},emits:t,setup(a,{emit:b}){a=toRef(a,"options");return{polyline:I("Polyline",t,a,b)}},render:()=>null}),M=defineComponent({props:{options:{type:Object,required:!0}},emits:t,setup(a,{emit:b}){a=toRef(a,"options");return{polygon:I("Polygon",t,a,b)}},render:()=>null});let P=t.concat(["bounds_changed"]); | ||
@@ -24,0 +24,0 @@ var Q=defineComponent({props:{options:{type:Object,required:!0}},emits:P,setup(a,{emit:b}){a=toRef(a,"options");return{rectangle:I("Rectangle",P,a,b)}},render:()=>null});let R=t.concat(["center_changed","radius_changed"]); |
@@ -9,5 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
circle: { | ||
component: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}; | ||
circle: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -14,0 +12,0 @@ options: google.maps.CircleOptions; |
@@ -9,5 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
marker: { | ||
component: Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}; | ||
marker: Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -14,0 +12,0 @@ options: google.maps.MarkerOptions; |
@@ -9,5 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
polygon: { | ||
component: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}; | ||
polygon: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -14,0 +12,0 @@ options: google.maps.PolygonOptions; |
@@ -9,5 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
polyline: { | ||
component: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}; | ||
polyline: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -14,0 +12,0 @@ options: google.maps.PolylineOptions; |
@@ -9,5 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
rectangle: { | ||
component: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}; | ||
rectangle: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -14,0 +12,0 @@ options: google.maps.RectangleOptions; |
@@ -5,4 +5,2 @@ /// <reference types="google.maps" /> | ||
export declare type IComponentOptions = google.maps.MarkerOptions | google.maps.PolylineOptions | google.maps.PolygonOptions | google.maps.RectangleOptions | google.maps.CircleOptions; | ||
export declare const useSetupMapComponent: (componentName: "Marker" | "Polyline" | "Polygon" | "Rectangle" | "Circle", events: string[], options: Ref<IComponentOptions>, emit: (event: string, ...args: unknown[]) => void) => { | ||
component: Ref<IComponent | null>; | ||
}; | ||
export declare const useSetupMapComponent: (componentName: "Marker" | "Polyline" | "Polygon" | "Rectangle" | "Circle", events: string[], options: Ref<IComponentOptions>, emit: (event: string, ...args: unknown[]) => void) => Ref<IComponent | null>; |
{ | ||
"name": "vue3-google-map", | ||
"version": "0.8.4", | ||
"version": "0.8.5", | ||
"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
99743
1115