vue3-google-map
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -16,3 +16,3 @@ /* | ||
*****************************************************************************/ | ||
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var vue=require("vue");let mapSymbol=Symbol("map"),apiSymbol=Symbol("api"),markerSymbol=Symbol("marker"),markerClusterSymbol=Symbol("markerCluster"),mapTilesLoadedSymbol=Symbol("mapTilesLoaded"),loaderInstance=vue.ref(null),polylineEvents="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "); | ||
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var vue=require("vue");let mapSymbol=Symbol("map"),apiSymbol=Symbol("api"),markerSymbol=Symbol("marker"),markerClusterSymbol=Symbol("markerCluster"),customMarkerClassSymbol=Symbol("CustomMarker"),mapTilesLoadedSymbol=Symbol("mapTilesLoaded"),loaderInstance=vue.ref(null),polylineEvents="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "); | ||
var fastDeepEqual$1=function equal(a,b){if(a===b)return!0;if(a&&b&&"object"==typeof a&&"object"==typeof b){if(a.constructor!==b.constructor)return!1;var d;if(Array.isArray(a)){var e=a.length;if(e!=b.length)return!1;for(d=e;0!==d--;)if(!equal(a[d],b[d]))return!1;return!0}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();var g=Object.keys(a); | ||
@@ -25,30 +25,34 @@ e=g.length;if(e!==Object.keys(b).length)return!1;for(d=e;0!==d--;)if(!Object.prototype.hasOwnProperty.call(b,g[d]))return!1;for(d=e;0!==d--;)if(e=g[d],!equal(a[e],b[e]))return!1;return!0}return a!==a&&b!==b};let DEFAULT_ID="__googleMapsScriptId"; | ||
this.loading=this.done=!1;this.errors=[];this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(a){this.errors.push(a);this.errors.length<=this.retries?(a=this.errors.length*Math.pow(2,this.errors.length),console.log(`Failed to load Google Maps script, retrying in ${a} ms.`),setTimeout(()=>{this.deleteScript();this.setScript()},a)):(this.onerrorEvent=a,this.callback())}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0;this.loading= | ||
!1;this.callbacks.forEach(a=>{a(this.onerrorEvent)});this.callbacks=[]}execute(){this.resetIfRetryingFailed();this.done?this.callback():window.google&&window.google.maps&&window.google.maps.version?(console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback()):this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}let 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(" "); | ||
var _sfc_main$2=vue.defineComponent({props:{apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean, | ||
!1;this.callbacks.forEach(a=>{a(this.onerrorEvent)});this.callbacks=[]}execute(){this.resetIfRetryingFailed();this.done?this.callback():window.google&&window.google.maps&&window.google.maps.version?(console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback()):this.loading||(this.loading=!0,this.setCallback(),this.setScript())}} | ||
function createCustomMarkerClass(a){return class extends a.OverlayView{constructor(a){super();let {element:b,...d}=a;this.element=b;this.opts=d;this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof a.LatLng?this.opts.position:new a.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;let a=this.element;return"none"!==a.style.display&&"hidden"!==a.style.visibility&&(""===a.style.opacity||.01<Number(a.style.opacity))}onAdd(){if(this.element){var a= | ||
this.getPanes();a&&a.overlayMouseTarget.appendChild(this.element)}}draw(){if(this.element){var a=this.getProjection().fromLatLngToDivPixel(this.getPosition());if(a){this.element.style.position="absolute";let b=this.element.offsetHeight;var c=this.element.offsetWidth;switch(this.opts.anchorPoint){case "TOP_CENTER":c=a.x-c/2;a=a.y;break;case "BOTTOM_CENTER":c=a.x-c/2;a=a.y-b;break;case "LEFT_CENTER":c=a.x;a=a.y-b/2;break;case "RIGHT_CENTER":c=a.x-c;a=a.y-b/2;break;case "TOP_LEFT":c=a.x;a=a.y;break; | ||
case "TOP_RIGHT":c=a.x-c;a=a.y;break;case "BOTTOM_LEFT":c=a.x;a=a.y-b;break;case "BOTTOM_RIGHT":c=a.x-c;a=a.y-b;break;default:c=a.x-c/2,a=a.y-b/2}this.element.style.left=c+"px";this.element.style.top=a+"px";this.element.style.transform=`translateX(${this.opts.offsetX||0}px) translateY(${this.opts.offsetY||0}px)`;this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}}onRemove(){this.element&&this.element.remove()}setOptions(a){this.opts=a;this.draw()}}}let 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(" "); | ||
var _sfc_main$3=vue.defineComponent({props:{apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean, | ||
required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object, | ||
required:!1},mapTypeId:{type:[Number,String],required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number, | ||
required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1}},emits:mapEvents,setup(a,{emit:b}){let c=vue.ref(null),d=vue.ref(!1),e=vue.ref(null),g=vue.ref(null), | ||
f=vue.ref(!1);vue.provide(mapSymbol,e);vue.provide(apiSymbol,g);vue.provide(mapTilesLoadedSymbol,f);let k=()=>{const b={...a};Object.keys(b).forEach(a=>{void 0===b[a]&&delete b[a]});var c=a=>{var b;return a?{position:null===(b=g.value)||void 0===b?void 0:b.ControlPosition[a]}:{}};c={scaleControlOptions:a.scaleControlStyle?{style:a.scaleControlStyle}:{},panControlOptions:c(a.panControlPosition),zoomControlOptions:c(a.zoomControlPosition),rotateControlOptions:c(a.rotateControlPosition),streetViewControlOptions:c(a.streetViewControlPosition), | ||
fullscreenControlOptions:c(a.fullscreenControlPosition),disableDefaultUI:a.disableDefaultUi};return{...b,...c}},l=vue.watch([g,e],([a,b])=>{a&&b&&(a.event.addListenerOnce(b,"tilesloaded",()=>{f.value=!0}),setTimeout(l,0))},{immediate:!0}),h=()=>{try{const {apiKey:b,region:c,version:d,language:e,libraries:f}=a;loaderInstance.value=new Loader({apiKey:b,region:c,version:d,language:e,libraries:f})}catch(m){console.error(m)}};vue.onMounted(()=>{h();loaderInstance.value.load().then(()=>{g.value=google.maps; | ||
e.value=new google.maps.Map(c.value,k());mapEvents.forEach(a=>{var c;null===(c=e.value)||void 0===c?void 0:c.addListener(a,c=>b(a,c))});d.value=!0;let f=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(b=>vue.toRef(a,b));vue.watch([()=>a.center,()=>a.zoom,...f],([a,b],[c,d])=>{var f,h,g;let {center:m,zoom:l,...n}=k();null===(f=e.value)||void 0===f?void 0:f.setOptions(n);void 0!==b&&b!==d&&(null===(h=e.value)||void 0===h?void 0:h.setZoom(b));b=!c||a.lng!==c.lng||a.lat!==c.lat;a&&b&&(null=== | ||
(g=e.value)||void 0===g?void 0:g.panTo(a))})})});vue.onBeforeUnmount(()=>{var a;f.value=!1;e.value&&(null===(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value))});return{mapRef:c,ready:d,map:e,api:g,mapTilesLoaded:f}}}); | ||
function styleInject(a,b){void 0===b&&(b={});b=b.insertAt;if(a&&"undefined"!==typeof document){var c=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css";"top"===b?c.firstChild?c.insertBefore(d,c.firstChild):c.appendChild(d):c.appendChild(d);d.styleSheet?d.styleSheet.cssText=a:d.appendChild(document.createTextNode(a))}}var css_248z$1="\n.mapdiv[data-v-177d06e3] {\n width: 100%;\n height: 100%;\n}\n";styleInject(css_248z$1);let _withId$1=vue.withScopeId("data-v-177d06e3"); | ||
vue.pushScopeId("data-v-177d06e3");let _hoisted_1$2={ref:"mapRef",class:"mapdiv"};vue.popScopeId();let _sfc_render$2=_withId$1((a,b,c,d,e,g)=>(vue.openBlock(),vue.createBlock("div",null,[vue.createVNode("div",_hoisted_1$2,null,512),vue.renderSlot(a.$slots,"default",{ready:a.ready,map:a.map,api:a.api,mapTilesLoaded:a.mapTilesLoaded},void 0,!0)])));_sfc_main$2.render=_sfc_render$2;_sfc_main$2.__scopeId="data-v-177d06e3"; | ||
let useSetupMapComponent=(a,b,c,d)=>{let e=null;const g=vue.ref(null),f=vue.inject(mapSymbol,vue.ref()),k=vue.inject(apiSymbol,vue.ref()),l=vue.inject(markerClusterSymbol,vue.ref()),h=vue.computed(()=>!!(l.value&&k.value&&e instanceof k.value.Marker));vue.watch([f,c],(m,[n,r])=>{var q,p,t;m=JSON.stringify(c.value)!==JSON.stringify(r)||f.value!==n;f.value&&k.value&&m&&(e?(e.setOptions(c.value),h.value&&(null===(q=l.value)||void 0===q?void 0:q.removeMarker(e),null===(p=l.value)||void 0===p?void 0:p.addMarker(e))): | ||
(g.value="Marker"===a?e=new k.value[a](c.value):e=new k.value[a]({...c.value,map:f.value}),h.value?null===(t=l.value)||void 0===t?void 0:t.addMarker(e):e.setMap(f.value),b.forEach(a=>{null===e||void 0===e?void 0:e.addListener(a,b=>d(a,b))})))},{immediate:!0});vue.onBeforeUnmount(()=>{var a,b;e&&(null===(a=k.value)||void 0===a?void 0:a.event.clearInstanceListeners(e),h.value?null===(b=l.value)||void 0===b?void 0:b.removeMarker(e):e.setMap(null))});return g},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(" "); | ||
required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0}, | ||
scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1}},emits:mapEvents,setup(a,{emit:b}){let c=vue.ref(),d=vue.ref(!1), | ||
e=vue.ref(),g=vue.ref(),f=vue.ref(!1);vue.provide(mapSymbol,e);vue.provide(apiSymbol,g);vue.provide(mapTilesLoadedSymbol,f);let k=()=>{const b={...a};Object.keys(b).forEach(a=>{void 0===b[a]&&delete b[a]});var c=a=>{var b;return a?{position:null===(b=g.value)||void 0===b?void 0:b.ControlPosition[a]}:{}};c={scaleControlOptions:a.scaleControlStyle?{style:a.scaleControlStyle}:{},panControlOptions:c(a.panControlPosition),zoomControlOptions:c(a.zoomControlPosition),rotateControlOptions:c(a.rotateControlPosition), | ||
streetViewControlOptions:c(a.streetViewControlPosition),fullscreenControlOptions:c(a.fullscreenControlPosition),disableDefaultUI:a.disableDefaultUi};return{...b,...c}},l=vue.watch([g,e],([a,b])=>{a&&b&&(a.event.addListenerOnce(b,"tilesloaded",()=>{f.value=!0}),setTimeout(l,0))},{immediate:!0}),h=()=>{try{const {apiKey:b,region:c,version:d,language:e,libraries:f}=a;loaderInstance.value=new Loader({apiKey:b,region:c,version:d,language:e,libraries:f})}catch(m){console.error(m)}};vue.onMounted(()=>{h(); | ||
loaderInstance.value.load().then(()=>{g.value=vue.markRaw(google.maps);e.value=vue.markRaw(new google.maps.Map(c.value,k()));var f=createCustomMarkerClass(g.value);g.value[customMarkerClassSymbol]=f;mapEvents.forEach(a=>{var c;null===(c=e.value)||void 0===c?void 0:c.addListener(a,c=>b(a,c))});d.value=!0;f=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(b=>vue.toRef(a,b));vue.watch([()=>a.center,()=>a.zoom,...f],([a,b],[c,d])=>{var f,g,h;let {center:m,zoom:l,...n}=k();null===(f=e.value)|| | ||
void 0===f?void 0:f.setOptions(n);void 0!==b&&b!==d&&(null===(g=e.value)||void 0===g?void 0:g.setZoom(b));b=!c||a.lng!==c.lng||a.lat!==c.lat;a&&b&&(null===(h=e.value)||void 0===h?void 0:h.panTo(a))})})});vue.onBeforeUnmount(()=>{var a;f.value=!1;e.value&&(null===(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value))});return{mapRef:c,ready:d,map:e,api:g,mapTilesLoaded:f}}}); | ||
function styleInject(a,b){void 0===b&&(b={});b=b.insertAt;if(a&&"undefined"!==typeof document){var c=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css";"top"===b?c.firstChild?c.insertBefore(d,c.firstChild):c.appendChild(d):c.appendChild(d);d.styleSheet?d.styleSheet.cssText=a:d.appendChild(document.createTextNode(a))}}var css_248z$2="\n.mapdiv[data-v-177d06e3] {\n width: 100%;\n height: 100%;\n}\n";styleInject(css_248z$2);let _withId$2=vue.withScopeId("data-v-177d06e3"); | ||
vue.pushScopeId("data-v-177d06e3");let _hoisted_1$2={ref:"mapRef",class:"mapdiv"};vue.popScopeId();let _sfc_render$3=_withId$2((a,b,c,d,e,g)=>(vue.openBlock(),vue.createBlock("div",null,[vue.createVNode("div",_hoisted_1$2,null,512),vue.renderSlot(a.$slots,"default",{ready:a.ready,map:a.map,api:a.api,mapTilesLoaded:a.mapTilesLoaded},void 0,!0)])));_sfc_main$3.render=_sfc_render$3;_sfc_main$3.__scopeId="data-v-177d06e3"; | ||
let isMarkerCtorKey=a=>"Marker"===a,isCustomMarkerCtorKey=a=>a===customMarkerClassSymbol,useSetupMapComponent=(a,b,c,d)=>{const e=vue.ref(),g=vue.inject(mapSymbol,vue.ref()),f=vue.inject(apiSymbol,vue.ref()),k=vue.inject(markerClusterSymbol,vue.ref()),l=vue.computed(()=>!!(k.value&&f.value&&(e.value instanceof f.value.Marker||e.value instanceof f.value[customMarkerClassSymbol])));vue.watch([g,c],(h,[m,n])=>{var q,r,p;h=JSON.stringify(c.value)!==JSON.stringify(n)||g.value!==m;g.value&&f.value&&h&& | ||
(e.value?(e.value.setOptions(c.value),l.value&&(null===(q=k.value)||void 0===q?void 0:q.removeMarker(e.value),null===(r=k.value)||void 0===r?void 0:r.addMarker(e.value))):(isMarkerCtorKey(a)?e.value=vue.markRaw(new f.value[a](c.value)):isCustomMarkerCtorKey(a)?e.value=vue.markRaw(new f.value[a](c.value)):e.value=vue.markRaw(new f.value[a]({...c.value,map:g.value})),l.value?null===(p=k.value)||void 0===p?void 0:p.addMarker(e.value):e.value.setMap(g.value),b.forEach(a=>{var b;null===(b=e.value)||void 0=== | ||
b?void 0:b.addListener(a,b=>d(a,b))})))},{immediate:!0});vue.onBeforeUnmount(()=>{var a,b;e.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value),l.value?null===(b=k.value)||void 0===b?void 0:b.removeMarker(e.value):e.value.setMap(null))});return e},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({name:"Marker",props:{options:{type:Object,required:!0}},emits:markerEvents,setup(a,{emit:b,expose:c,slots:d}){a=vue.toRef(a,"options");b=useSetupMapComponent("Marker",markerEvents,a,b);vue.provide(markerSymbol,b);c({marker:b});return()=>{var a;return null===(a=d.default)||void 0===a?void 0:a.call(d)}}}),Polyline=vue.defineComponent({name:"Polyline",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({name:"Polygon",props:{options:{type:Object,required:!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({name:"Rectangle",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});let circleEvents=polylineEvents.concat(["center_changed","radius_changed"]); | ||
var Circle=vue.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:circleEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{circle:useSetupMapComponent("Circle",circleEvents,a,b)}},render:()=>null}),_sfc_main$1=vue.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(a,{emit:b}){let c=vue.ref(null),d=vue.inject(mapSymbol,vue.ref()),e=vue.inject(apiSymbol,vue.ref()),g=vue.inject(mapTilesLoadedSymbol, | ||
var Circle=vue.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:circleEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{circle:useSetupMapComponent("Circle",circleEvents,a,b)}},render:()=>null}),_sfc_main$2=vue.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(a,{emit:b}){let c=vue.ref(null),d=vue.inject(mapSymbol,vue.ref()),e=vue.inject(apiSymbol,vue.ref()),g=vue.inject(mapTilesLoadedSymbol, | ||
vue.ref(!1)),f=vue.ref(!1),k=vue.watch([g,e,c],([c,d,e])=>{d&&c&&e&&(l(a.position),f.value=!0,b("content:loaded"),setTimeout(k,0))},{immediate:!0}),l=a=>{d.value&&e.value&&c.value&&d.value.controls[e.value.ControlPosition[a]].push(c.value)},h=a=>{if(d.value&&e.value){let b=null;a=e.value.ControlPosition[a];d.value.controls[a].forEach((a,d)=>{a===c.value&&(b=d)});null!==b&&d.value.controls[a].removeAt(b)}};vue.onBeforeUnmount(()=>h(a.position));vue.watch(()=>a.position,(a,b)=>{h(b);l(a)});vue.watch(()=> | ||
a.index,b=>{b&&c.value&&(c.value.index=a.index)});return{controlRef:c,showContent:f}}});let _hoisted_1$1={ref:"controlRef"};function _sfc_render$1(a,b,c,d,e,g){return vue.openBlock(),vue.createBlock(vue.Fragment,null,[vue.createCommentVNode("\n v-show must be used instead of v-if otherwise there\n would be no rendered content pushed to the map controls\n "),vue.withDirectives(vue.createVNode("div",_hoisted_1$1,[vue.renderSlot(a.$slots,"default")],512),[[vue.vShow,a.showContent]])],2112)} | ||
_sfc_main$1.render=_sfc_render$1;let infoWindowEvents="closeclick content_changed domready position_changed visible zindex_changed".split(" "); | ||
var _sfc_main=vue.defineComponent({props:{options:{type:Object,default:()=>({})}},emits:infoWindowEvents,setup(a,{slots:b,emit:c}){let d,e=vue.ref(),g=vue.ref(),f=vue.inject(mapSymbol,vue.ref()),k=vue.inject(apiSymbol,vue.ref()),l=vue.inject(markerSymbol,vue.ref()),h,m=vue.computed(()=>{var a;return null===(a=b.default)||void 0===a?void 0:a.call(b).some(a=>a.type!==vue.Comment)});vue.onMounted(()=>{vue.watch([f,()=>a.options],([,a],[b,q])=>{b=JSON.stringify(a)!==JSON.stringify(q)||f.value!==b;f.value&& | ||
k.value&&b&&(d?(d.setOptions({...a,content:m.value?g.value:a.content}),l.value||d.open({map:f.value})):(e.value=d=new k.value.InfoWindow({...a,content:m.value?g.value:a.content}),l.value?h=l.value.addListener("click",()=>{d.open({map:f.value,anchor:l.value})}):d.open({map:f.value}),infoWindowEvents.forEach(a=>{null===d||void 0===d?void 0:d.addListener(a,b=>c(a,b))})))},{immediate:!0})});vue.onBeforeUnmount(()=>{var a;h&&h.remove();d&&(null===(a=k.value)||void 0===a?void 0:a.event.clearInstanceListeners(d), | ||
d.close())});return{infoWindow:e,infoWindowRef:g,hasSlotContent:m,anchor:l}}}),css_248z="\n.info-window-content[data-v-5b373d6e] {\n display: none;\n}\n.mapdiv .info-window-content[data-v-5b373d6e] {\n display: block;\n}\n";styleInject(css_248z);let _withId=vue.withScopeId("data-v-5b373d6e");vue.pushScopeId("data-v-5b373d6e");let _hoisted_1={key:0,ref:"infoWindowRef",class:"info-window-content"};vue.popScopeId(); | ||
let _sfc_render=_withId((a,b,c,d,e,g)=>a.hasSlotContent?(vue.openBlock(),vue.createBlock("div",_hoisted_1,[vue.renderSlot(a.$slots,"default",{},void 0,!0)],512)):vue.createCommentVNode("v-if",!0));_sfc_main.render=_sfc_render;_sfc_main.__scopeId="data-v-5b373d6e";function sortKD(a,b,c,d,e,g){if(!(e-d<=c)){var f=d+e>>1;select(a,b,f,d,e,g%2);sortKD(a,b,c,d,f-1,g+1);sortKD(a,b,c,f+1,e,g+1)}} | ||
a.index,b=>{b&&c.value&&(c.value.index=a.index)});return{controlRef:c,showContent:f}}});let _hoisted_1$1={ref:"controlRef"};function _sfc_render$2(a,b,c,d,e,g){return vue.openBlock(),vue.createBlock(vue.Fragment,null,[vue.createCommentVNode("\n v-show must be used instead of v-if otherwise there\n would be no rendered content pushed to the map controls\n "),vue.withDirectives(vue.createVNode("div",_hoisted_1$1,[vue.renderSlot(a.$slots,"default")],512),[[vue.vShow,a.showContent]])],2112)} | ||
_sfc_main$2.render=_sfc_render$2;let infoWindowEvents="closeclick content_changed domready position_changed visible zindex_changed".split(" "); | ||
var _sfc_main$1=vue.defineComponent({props:{options:{type:Object,default:()=>({})}},emits:infoWindowEvents,setup(a,{slots:b,emit:c}){let d=vue.ref(),e=vue.ref(),g=vue.inject(mapSymbol,vue.ref()),f=vue.inject(apiSymbol,vue.ref()),k=vue.inject(markerSymbol,vue.ref()),l,h=vue.computed(()=>{var a;return null===(a=b.default)||void 0===a?void 0:a.call(b).some(a=>a.type!==vue.Comment)});vue.onMounted(()=>{vue.watch([g,()=>a.options],([,a],[b,q])=>{b=JSON.stringify(a)!==JSON.stringify(q)||g.value!==b;g.value&& | ||
f.value&&b&&(d.value?(d.value.setOptions({...a,content:h.value?e.value:a.content}),k.value||d.value.open({map:g.value})):(d.value=d.value=vue.markRaw(new f.value.InfoWindow({...a,content:h.value?e.value:a.content})),k.value?l=k.value.addListener("click",()=>{d.value&&d.value.open({map:g.value,anchor:k.value})}):d.value.open({map:g.value}),infoWindowEvents.forEach(a=>{var b;null===(b=d.value)||void 0===b?void 0:b.addListener(a,b=>c(a,b))})))},{immediate:!0})});vue.onBeforeUnmount(()=>{var a;l&&l.remove(); | ||
d.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(d.value),d.value.close())});return{infoWindow:d,infoWindowRef:e,hasSlotContent:h}}}),css_248z$1="\n.info-window-content[data-v-5b373d6e] {\n display: none;\n}\n.mapdiv .info-window-content[data-v-5b373d6e] {\n display: inline-block;\n}\n";styleInject(css_248z$1);let _withId$1=vue.withScopeId("data-v-5b373d6e");vue.pushScopeId("data-v-5b373d6e");let _hoisted_1={key:0,ref:"infoWindowRef",class:"info-window-content"};vue.popScopeId(); | ||
let _sfc_render$1=_withId$1((a,b,c,d,e,g)=>a.hasSlotContent?(vue.openBlock(),vue.createBlock("div",_hoisted_1,[vue.renderSlot(a.$slots,"default",{},void 0,!0)],512)):vue.createCommentVNode("v-if",!0));_sfc_main$1.render=_sfc_render$1;_sfc_main$1.__scopeId="data-v-5b373d6e";function sortKD(a,b,c,d,e,g){if(!(e-d<=c)){var f=d+e>>1;select(a,b,f,d,e,g%2);sortKD(a,b,c,d,f-1,g+1);sortKD(a,b,c,f+1,e,g+1)}} | ||
function select(a,b,c,d,e,g){for(;e>d;){if(600<e-d){var f=e-d+1,k=c-d+1,l=Math.log(f),h=.5*Math.exp(2*l/3);l=.5*Math.sqrt(l*h*(f-h)/f)*(0>k-f/2?-1:1);select(a,b,c,Math.max(d,Math.floor(c-k*h/f+l)),Math.min(e,Math.floor(c+(f-k)*h/f+l)),g)}f=b[2*c+g];k=d;h=e;swapItem(a,b,d,c);for(b[2*e+g]>f&&swapItem(a,b,d,e);k<h;){swapItem(a,b,k,h);k++;for(h--;b[2*k+g]<f;)k++;for(;b[2*h+g]>f;)h--}b[2*d+g]===f?swapItem(a,b,d,h):(h++,swapItem(a,b,h,e));h<=c&&(d=h+1);c<=h&&(e=h-1)}} | ||
function swapItem(a,b,c,d){swap(a,c,d);swap(b,2*c,2*d);swap(b,2*c+1,2*d+1)}function swap(a,b,c){let d=a[b];a[b]=a[c];a[c]=d} | ||
function range(a,b,c,d,e,g,f){let k=[0,a.length-1,0],l=[],h,m;for(;k.length;){var n=k.pop();let r=k.pop(),q=k.pop();if(r-q<=f){for(n=q;n<=r;n++)h=b[2*n],m=b[2*n+1],h>=c&&h<=e&&m>=d&&m<=g&&l.push(a[n]);continue}let p=Math.floor((q+r)/2);h=b[2*p];m=b[2*p+1];h>=c&&h<=e&&m>=d&&m<=g&&l.push(a[p]);let t=(n+1)%2;if(0===n?c<=h:d<=m)k.push(q),k.push(p-1),k.push(t);if(0===n?e>=h:g>=m)k.push(p+1),k.push(r),k.push(t)}return l} | ||
function within(a,b,c,d,e,g){let f=[0,a.length-1,0],k=[],l=e*e;for(;f.length;){var h=f.pop();let m=f.pop(),n=f.pop();if(m-n<=g){for(h=n;h<=m;h++)sqDist(b[2*h],b[2*h+1],c,d)<=l&&k.push(a[h]);continue}let r=Math.floor((n+m)/2),q=b[2*r],p=b[2*r+1];sqDist(q,p,c,d)<=l&&k.push(a[r]);let t=(h+1)%2;if(0===h?c-e<=q:d-e<=p)f.push(n),f.push(r-1),f.push(t);if(0===h?c+e>=q:d+e>=p)f.push(r+1),f.push(m),f.push(t)}return k}function sqDist(a,b,c,d){a-=c;b-=d;return a*a+b*b}let defaultGetX=a=>a[0],defaultGetY=a=>a[1]; | ||
function range(a,b,c,d,e,g,f){let k=[0,a.length-1,0],l=[],h,m;for(;k.length;){var n=k.pop();let q=k.pop(),r=k.pop();if(q-r<=f){for(n=r;n<=q;n++)h=b[2*n],m=b[2*n+1],h>=c&&h<=e&&m>=d&&m<=g&&l.push(a[n]);continue}let p=Math.floor((r+q)/2);h=b[2*p];m=b[2*p+1];h>=c&&h<=e&&m>=d&&m<=g&&l.push(a[p]);let t=(n+1)%2;if(0===n?c<=h:d<=m)k.push(r),k.push(p-1),k.push(t);if(0===n?e>=h:g>=m)k.push(p+1),k.push(q),k.push(t)}return l} | ||
function within(a,b,c,d,e,g){let f=[0,a.length-1,0],k=[],l=e*e;for(;f.length;){var h=f.pop();let m=f.pop(),n=f.pop();if(m-n<=g){for(h=n;h<=m;h++)sqDist(b[2*h],b[2*h+1],c,d)<=l&&k.push(a[h]);continue}let q=Math.floor((n+m)/2),r=b[2*q],p=b[2*q+1];sqDist(r,p,c,d)<=l&&k.push(a[q]);let t=(h+1)%2;if(0===h?c-e<=r:d-e<=p)f.push(n),f.push(q-1),f.push(t);if(0===h?c+e>=r:d+e>=p)f.push(q+1),f.push(m),f.push(t)}return k}function sqDist(a,b,c,d){a-=c;b-=d;return a*a+b*b}let defaultGetX=a=>a[0],defaultGetY=a=>a[1]; | ||
class KDBush{constructor(a,b=defaultGetX,c=defaultGetY,d=64,e=Float64Array){this.nodeSize=d;this.points=a;let g=this.ids=new (65536>a.length?Uint16Array:Uint32Array)(a.length);e=this.coords=new e(2*a.length);for(let d=0;d<a.length;d++)g[d]=d,e[2*d]=b(a[d]),e[2*d+1]=c(a[d]);sortKD(g,e,d,0,g.length-1,0)}range(a,b,c,d){return range(this.ids,this.coords,a,b,c,d,this.nodeSize)}within(a,b,c){return within(this.ids,this.coords,a,b,c,this.nodeSize)}} | ||
@@ -84,5 +88,7 @@ let defaultOptions={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:a=>a},fround=Math.fround||(a=>b=>{a[0]=+b;return a[0]})(new Float32Array(1)); | ||
if(c||void 0==c)this.reset(),this.clusters=b,this.renderClusters();google.maps.event.trigger(this,MarkerClustererEvents.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this));this.render()}onRemove(){google.maps.event.removeListener(this.idleListener);this.reset()}reset(){this.markers.forEach(a=>a.setMap(null));this.clusters.forEach(a=>a.delete());this.clusters=[]}renderClusters(){let a=new ClusterStats(this.markers,this.clusters),b=this.getMap(); | ||
this.clusters.forEach(c=>{1===c.markers.length?c.marker=c.markers[0]:(c.marker=this.renderer.render(c,a),this.onClusterClick&&c.marker.addListener("click",a=>{google.maps.event.trigger(this,MarkerClustererEvents.CLUSTER_CLICK,c);this.onClusterClick(a,c,b)}));c.marker.setMap(b)})}}let markerClusterEvents=["clusteringbegin","clusteringend","click"]; | ||
this.clusters.forEach(c=>{1===c.markers.length?c.marker=c.markers[0]:(c.marker=this.renderer.render(c,a),this.onClusterClick&&c.marker.addListener("click",a=>{google.maps.event.trigger(this,MarkerClustererEvents.CLUSTER_CLICK,c);this.onClusterClick(a,c,b)}));c.marker.setMap(b)})}}let markerClusterEvents=Object.values(MarkerClustererEvents); | ||
var MarkerCluster=vue.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:markerClusterEvents,setup(a,{emit:b,expose:c,slots:d}){let e=vue.ref(),g=vue.inject(mapSymbol,vue.ref()),f=vue.inject(apiSymbol,vue.ref());vue.provide(markerClusterSymbol,e);vue.watch(g,()=>{g.value&&(e.value=vue.markRaw(new MarkerClusterer({map:g.value,...a.options})),markerClusterEvents.forEach(a=>{var c;null===(c=e.value)||void 0===c?void 0:c.addListener(a,c=>b(a,c))}))},{immediate:!0}); | ||
vue.onBeforeUnmount(()=>{var a;e.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value),e.value.clearMarkers(),e.value.setMap(null))});c({markerCluster:e});return()=>{var a;return null===(a=d.default)||void 0===a?void 0:a.call(d)}}});exports.Circle=Circle;exports.CustomControl=_sfc_main$1;exports.GoogleMap=_sfc_main$2;exports.InfoWindow=_sfc_main;exports.Marker=Marker;exports.MarkerCluster=MarkerCluster;exports.Polygon=Polygon;exports.Polyline=Polyline; | ||
exports.Rectangle=Rectangle | ||
vue.onBeforeUnmount(()=>{var a;e.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value),e.value.clearMarkers(),e.value.setMap(null))});c({markerCluster:e});return()=>{var a;return null===(a=d.default)||void 0===a?void 0:a.call(d)}}}),_sfc_main=vue.defineComponent({props:{options:{type:Object,required:!0}},setup(a,{slots:b,emit:c}){let d=vue.ref(),e=vue.ref(),g=vue.computed(()=>{var a;return null===(a=b.default)||void 0===a?void 0:a.call(b).some(a=>a.type!==vue.Comment)}), | ||
f=vue.computed(()=>({...a.options,element:d.value}));vue.onMounted(()=>{e=useSetupMapComponent(customMarkerClassSymbol,[],f,c)});return{customMarkerRef:d,customMarker:e,hasSlotContent:g}}}),css_248z="\n.custom-marker-content[data-v-b9d5ec8a] {\n display: none;\n}\n.mapdiv .custom-marker-content[data-v-b9d5ec8a] {\n display: inline-block;\n}\n";styleInject(css_248z); | ||
let _withId=vue.withScopeId("data-v-b9d5ec8a"),_sfc_render=_withId((a,b,c,d,e,g)=>a.hasSlotContent?(vue.openBlock(),vue.createBlock("div",{key:0,ref:"customMarkerRef",class:"custom-marker-content",style:{cursor:a.$attrs.onClick?"pointer":void 0}},[vue.renderSlot(a.$slots,"default",{},void 0,!0),vue.renderSlot(a.$slots,"info-windows",{},void 0,!0)],4)):vue.createCommentVNode("v-if",!0));_sfc_main.render=_sfc_render;_sfc_main.__scopeId="data-v-b9d5ec8a";exports.Circle=Circle;exports.CustomControl=_sfc_main$2; | ||
exports.CustomMarker=_sfc_main;exports.GoogleMap=_sfc_main$3;exports.InfoWindow=_sfc_main$1;exports.Marker=Marker;exports.MarkerCluster=MarkerCluster;exports.Polygon=Polygon;exports.Polyline=Polyline;exports.Rectangle=Rectangle |
@@ -1,2 +0,2 @@ | ||
import{ref,defineComponent,provide,watch,onMounted,toRef,onBeforeUnmount,pushScopeId,popScopeId,openBlock,createBlock,createVNode,renderSlot,withScopeId,inject,computed,Fragment,createCommentVNode,withDirectives,vShow,Comment,markRaw}from'vue';/* | ||
import{ref,defineComponent,provide,watch,onMounted,markRaw,toRef,onBeforeUnmount,pushScopeId,popScopeId,openBlock,createBlock,createVNode,renderSlot,withScopeId,inject,computed,Fragment,createCommentVNode,withDirectives,vShow,Comment}from'vue';/* | ||
***************************************************************************** | ||
@@ -16,53 +16,59 @@ Copyright (c) Microsoft Corporation. | ||
*****************************************************************************/ | ||
let u=Symbol("map"),v=Symbol("api"),w=Symbol("marker"),x=Symbol("markerCluster"),y=Symbol("mapTilesLoaded"),z=ref(null),A="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "); | ||
var aa=function B(a,b){if(a===b)return!0;if(a&&b&&"object"==typeof a&&"object"==typeof b){if(a.constructor!==b.constructor)return!1;var d;if(Array.isArray(a)){var e=a.length;if(e!=b.length)return!1;for(d=e;0!==d--;)if(!B(a[d],b[d]))return!1;return!0}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();var g=Object.keys(a);e=g.length; | ||
if(e!==Object.keys(b).length)return!1;for(d=e;0!==d--;)if(!Object.prototype.hasOwnProperty.call(b,g[d]))return!1;for(d=e;0!==d--;)if(e=g[d],!B(a[e],b[e]))return!1;return!0}return a!==a&&b!==b}; | ||
class C{constructor({apiKey:a,channel:b,client:c,id:d="__googleMapsScriptId",libraries:e=[],language:g,region:f,version:l,mapIds:h,nonce:k,retries:m=3,url:n="https://maps.googleapis.com/maps/api/js"}){this.CALLBACK="__googleMapsCallback";this.callbacks=[];this.loading=this.done=!1;this.errors=[];this.version=l;this.apiKey=a;this.channel=b;this.client=c;this.id=d||"__googleMapsScriptId";this.libraries=e;this.language=g;this.region=f;this.mapIds=h;this.nonce=k;this.retries=m;this.url=n;if(C.instance){if(!aa(this.options, | ||
C.instance.options))throw Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(C.instance.options)}`);return C.instance}C.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}}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+ | ||
let t=Symbol("map"),u=Symbol("api"),w=Symbol("marker"),x=Symbol("markerCluster"),y=Symbol("CustomMarker"),z=Symbol("mapTilesLoaded"),A=ref(null),B="click dblclick drag dragend dragstart mousedown mousemove mouseout mouseover mouseup rightclick".split(" "); | ||
var aa=function C(a,b){if(a===b)return!0;if(a&&b&&"object"==typeof a&&"object"==typeof b){if(a.constructor!==b.constructor)return!1;var d;if(Array.isArray(a)){var e=a.length;if(e!=b.length)return!1;for(d=e;0!==d--;)if(!C(a[d],b[d]))return!1;return!0}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();var g=Object.keys(a);e=g.length; | ||
if(e!==Object.keys(b).length)return!1;for(d=e;0!==d--;)if(!Object.prototype.hasOwnProperty.call(b,g[d]))return!1;for(d=e;0!==d--;)if(e=g[d],!C(a[e],b[e]))return!1;return!0}return a!==a&&b!==b}; | ||
class D{constructor({apiKey:a,channel:b,client:c,id:d="__googleMapsScriptId",libraries:e=[],language:g,region:f,version:l,mapIds:k,nonce:h,retries:m=3,url:n="https://maps.googleapis.com/maps/api/js"}){this.CALLBACK="__googleMapsCallback";this.callbacks=[];this.loading=this.done=!1;this.errors=[];this.version=l;this.apiKey=a;this.channel=b;this.client=c;this.id=d||"__googleMapsScriptId";this.libraries=e;this.language=g;this.region=f;this.mapIds=k;this.nonce=h;this.retries=m;this.url=n;if(D.instance){if(!aa(this.options, | ||
D.instance.options))throw Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(D.instance.options)}`);return D.instance}D.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}}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+ | ||
1}createUrl(){let a=this.url;a+=`?callback=${this.CALLBACK}`;this.apiKey&&(a+=`&key=${this.apiKey}`);this.channel&&(a+=`&channel=${this.channel}`);this.client&&(a+=`&client=${this.client}`);0<this.libraries.length&&(a+=`&libraries=${this.libraries.join(",")}`);this.language&&(a+=`&language=${this.language}`);this.region&&(a+=`®ion=${this.region}`);this.version&&(a+=`&v=${this.version}`);this.mapIds&&(a+=`&map_ids=${this.mapIds.join(",")}`);return a}deleteScript(){let a=document.getElementById(this.id); | ||
a&&a.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((a,b)=>{this.loadCallback(c=>{c?b(c.error):a(window.google)})})}loadCallback(a){this.callbacks.push(a);this.execute()}setScript(){if(document.getElementById(this.id))this.callback();else{var a=this.createUrl(),b=document.createElement("script");b.id=this.id;b.type="text/javascript";b.src=a;b.onerror=this.loadErrorCallback.bind(this);b.defer=!0;b.async=!0;this.nonce&&(b.nonce=this.nonce);document.head.appendChild(b)}}reset(){this.deleteScript(); | ||
this.loading=this.done=!1;this.errors=[];this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(a){this.errors.push(a);this.errors.length<=this.retries?(a=this.errors.length*Math.pow(2,this.errors.length),console.log(`Failed to load Google Maps script, retrying in ${a} ms.`),setTimeout(()=>{this.deleteScript();this.setScript()},a)):(this.onerrorEvent=a,this.callback())}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0;this.loading= | ||
!1;this.callbacks.forEach(a=>{a(this.onerrorEvent)});this.callbacks=[]}execute(){this.resetIfRetryingFailed();this.done?this.callback():window.google&&window.google.maps&&window.google.maps.version?(console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback()):this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}let D="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(" "); | ||
var E=defineComponent({props:{apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1, | ||
!1;this.callbacks.forEach(a=>{a(this.onerrorEvent)});this.callbacks=[]}execute(){this.resetIfRetryingFailed();this.done?this.callback():window.google&&window.google.maps&&window.google.maps.version?(console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback()):this.loading||(this.loading=!0,this.setCallback(),this.setScript())}} | ||
function ba(a){return class extends a.OverlayView{constructor(a){super();let {element:b,...d}=a;this.element=b;this.opts=d;this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof a.LatLng?this.opts.position:new a.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;let a=this.element;return"none"!==a.style.display&&"hidden"!==a.style.visibility&&(""===a.style.opacity||.01<Number(a.style.opacity))}onAdd(){if(this.element){var a= | ||
this.getPanes();a&&a.overlayMouseTarget.appendChild(this.element)}}draw(){if(this.element){var a=this.getProjection().fromLatLngToDivPixel(this.getPosition());if(a){this.element.style.position="absolute";let b=this.element.offsetHeight;var c=this.element.offsetWidth;switch(this.opts.anchorPoint){case "TOP_CENTER":c=a.x-c/2;a=a.y;break;case "BOTTOM_CENTER":c=a.x-c/2;a=a.y-b;break;case "LEFT_CENTER":c=a.x;a=a.y-b/2;break;case "RIGHT_CENTER":c=a.x-c;a=a.y-b/2;break;case "TOP_LEFT":c=a.x;a=a.y;break; | ||
case "TOP_RIGHT":c=a.x-c;a=a.y;break;case "BOTTOM_LEFT":c=a.x;a=a.y-b;break;case "BOTTOM_RIGHT":c=a.x-c;a=a.y-b;break;default:c=a.x-c/2,a=a.y-b/2}this.element.style.left=c+"px";this.element.style.top=a+"px";this.element.style.transform=`translateX(${this.opts.offsetX||0}px) translateY(${this.opts.offsetY||0}px)`;this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}}onRemove(){this.element&&this.element.remove()}setOptions(a){this.opts=a;this.draw()}}}let E="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(" "); | ||
var F=defineComponent({props:{apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1, | ||
default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1}, | ||
mapTypeId:{type:[Number,String],required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1}, | ||
scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1}},emits:D,setup(a,{emit:b}){let c=ref(null),d=ref(!1),e=ref(null),g=ref(null),f=ref(!1);provide(u,e);provide(v, | ||
g);provide(y,f);let l=()=>{const b={...a};Object.keys(b).forEach(a=>{void 0===b[a]&&delete b[a]});var c=a=>{var b;return a?{position:null===(b=g.value)||void 0===b?void 0:b.ControlPosition[a]}:{}};c={scaleControlOptions:a.scaleControlStyle?{style:a.scaleControlStyle}:{},panControlOptions:c(a.panControlPosition),zoomControlOptions:c(a.zoomControlPosition),rotateControlOptions:c(a.rotateControlPosition),streetViewControlOptions:c(a.streetViewControlPosition),fullscreenControlOptions:c(a.fullscreenControlPosition), | ||
disableDefaultUI:a.disableDefaultUi};return{...b,...c}},h=watch([g,e],([a,b])=>{a&&b&&(a.event.addListenerOnce(b,"tilesloaded",()=>{f.value=!0}),setTimeout(h,0))},{immediate:!0}),k=()=>{try{const {apiKey:b,region:c,version:d,language:e,libraries:f}=a;z.value=new C({apiKey:b,region:c,version:d,language:e,libraries:f})}catch(m){console.error(m)}};onMounted(()=>{k();z.value.load().then(()=>{g.value=google.maps;e.value=new google.maps.Map(c.value,l());D.forEach(a=>{var c;null===(c=e.value)||void 0=== | ||
c?void 0:c.addListener(a,c=>b(a,c))});d.value=!0;let f=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(b=>toRef(a,b));watch([()=>a.center,()=>a.zoom,...f],([a,b],[c,d])=>{var f,g,h;let {center:k,zoom:m,...n}=l();null===(f=e.value)||void 0===f?void 0:f.setOptions(n);void 0!==b&&b!==d&&(null===(g=e.value)||void 0===g?void 0:g.setZoom(b));b=!c||a.lng!==c.lng||a.lat!==c.lat;a&&b&&(null===(h=e.value)||void 0===h?void 0:h.panTo(a))})})});onBeforeUnmount(()=>{var a;f.value=!1;e.value&&(null=== | ||
(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value))});return{mapRef:c,ready:d,map:e,api:g,mapTilesLoaded:f}}});function F(a,b){void 0===b&&(b={});b=b.insertAt;if(a&&"undefined"!==typeof document){var c=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css";"top"===b?c.firstChild?c.insertBefore(d,c.firstChild):c.appendChild(d):c.appendChild(d);d.styleSheet?d.styleSheet.cssText=a:d.appendChild(document.createTextNode(a))}}F("\n.mapdiv[data-v-177d06e3] {\n width: 100%;\n height: 100%;\n}\n"); | ||
let ba=withScopeId("data-v-177d06e3");pushScopeId("data-v-177d06e3");let ca={ref:"mapRef",class:"mapdiv"};popScopeId();let da=ba(a=>(openBlock(),createBlock("div",null,[createVNode("div",ca,null,512),renderSlot(a.$slots,"default",{ready:a.ready,map:a.map,api:a.api,mapTilesLoaded:a.mapTilesLoaded},void 0,!0)])));E.render=da;E.__scopeId="data-v-177d06e3"; | ||
let G=(a,b,c,d)=>{let e=null;const g=ref(null),f=inject(u,ref()),l=inject(v,ref()),h=inject(x,ref()),k=computed(()=>!!(h.value&&l.value&&e instanceof l.value.Marker));watch([f,c],(m,[n,t])=>{var q,p,r;m=JSON.stringify(c.value)!==JSON.stringify(t)||f.value!==n;f.value&&l.value&&m&&(e?(e.setOptions(c.value),k.value&&(null===(q=h.value)||void 0===q?void 0:q.removeMarker(e),null===(p=h.value)||void 0===p?void 0:p.addMarker(e))):(g.value="Marker"===a?e=new l.value[a](c.value):e=new l.value[a]({...c.value, | ||
map:f.value}),k.value?null===(r=h.value)||void 0===r?void 0:r.addMarker(e):e.setMap(f.value),b.forEach(a=>{null===e||void 0===e?void 0:e.addListener(a,b=>d(a,b))})))},{immediate:!0});onBeforeUnmount(()=>{var a,b;e&&(null===(a=l.value)||void 0===a?void 0:a.event.clearInstanceListeners(e),k.value?null===(b=h.value)||void 0===b?void 0:b.removeMarker(e):e.setMap(null))});return g},H="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 ea=defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:H,setup(a,{emit:b,expose:c,slots:d}){a=toRef(a,"options");b=G("Marker",H,a,b);provide(w,b);c({marker:b});return()=>{var a;return null===(a=d.default)||void 0===a?void 0:a.call(d)}}}),fa=defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:A,setup(a,{emit:b}){a=toRef(a,"options");return{polyline:G("Polyline",A,a,b)}},render:()=>null}),ha=defineComponent({name:"Polygon",props:{options:{type:Object, | ||
required:!0}},emits:A,setup(a,{emit:b}){a=toRef(a,"options");return{polygon:G("Polygon",A,a,b)}},render:()=>null});let I=A.concat(["bounds_changed"]);var ia=defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:I,setup(a,{emit:b}){a=toRef(a,"options");return{rectangle:G("Rectangle",I,a,b)}},render:()=>null});let J=A.concat(["center_changed","radius_changed"]); | ||
var ja=defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:J,setup(a,{emit:b}){a=toRef(a,"options");return{circle:G("Circle",J,a,b)}},render:()=>null}),K=defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(a,{emit:b}){let c=ref(null),d=inject(u,ref()),e=inject(v,ref()),g=inject(y,ref(!1)),f=ref(!1),l=watch([g,e,c],([c,d,e])=>{d&&c&&e&&(h(a.position),f.value=!0,b("content:loaded"),setTimeout(l,0))},{immediate:!0}), | ||
h=a=>{d.value&&e.value&&c.value&&d.value.controls[e.value.ControlPosition[a]].push(c.value)},k=a=>{if(d.value&&e.value){let b=null;a=e.value.ControlPosition[a];d.value.controls[a].forEach((a,d)=>{a===c.value&&(b=d)});null!==b&&d.value.controls[a].removeAt(b)}};onBeforeUnmount(()=>k(a.position));watch(()=>a.position,(a,b)=>{k(b);h(a)});watch(()=>a.index,b=>{b&&c.value&&(c.value.index=a.index)});return{controlRef:c,showContent:f}}});let ka={ref:"controlRef"}; | ||
K.render=function(a){return openBlock(),createBlock(Fragment,null,[createCommentVNode("\n v-show must be used instead of v-if otherwise there\n would be no rendered content pushed to the map controls\n "),withDirectives(createVNode("div",ka,[renderSlot(a.$slots,"default")],512),[[vShow,a.showContent]])],2112)};let L="closeclick content_changed domready position_changed visible zindex_changed".split(" "); | ||
var M=defineComponent({props:{options:{type:Object,default:()=>({})}},emits:L,setup(a,{slots:b,emit:c}){let d,e=ref(),g=ref(),f=inject(u,ref()),l=inject(v,ref()),h=inject(w,ref()),k,m=computed(()=>{var a;return null===(a=b.default)||void 0===a?void 0:a.call(b).some(a=>a.type!==Comment)});onMounted(()=>{watch([f,()=>a.options],([,a],[b,q])=>{b=JSON.stringify(a)!==JSON.stringify(q)||f.value!==b;f.value&&l.value&&b&&(d?(d.setOptions({...a,content:m.value?g.value:a.content}),h.value||d.open({map:f.value})): | ||
(e.value=d=new l.value.InfoWindow({...a,content:m.value?g.value:a.content}),h.value?k=h.value.addListener("click",()=>{d.open({map:f.value,anchor:h.value})}):d.open({map:f.value}),L.forEach(a=>{null===d||void 0===d?void 0:d.addListener(a,b=>c(a,b))})))},{immediate:!0})});onBeforeUnmount(()=>{var a;k&&k.remove();d&&(null===(a=l.value)||void 0===a?void 0:a.event.clearInstanceListeners(d),d.close())});return{infoWindow:e,infoWindowRef:g,hasSlotContent:m,anchor:h}}});F("\n.info-window-content[data-v-5b373d6e] {\n display: none;\n}\n.mapdiv .info-window-content[data-v-5b373d6e] {\n display: block;\n}\n"); | ||
let la=withScopeId("data-v-5b373d6e");pushScopeId("data-v-5b373d6e");let ma={key:0,ref:"infoWindowRef",class:"info-window-content"};popScopeId();let na=la(a=>a.hasSlotContent?(openBlock(),createBlock("div",ma,[renderSlot(a.$slots,"default",{},void 0,!0)],512)):createCommentVNode("v-if",!0));M.render=na;M.__scopeId="data-v-5b373d6e";function N(a,b,c,d,e,g){if(!(e-d<=c)){var f=d+e>>1;O(a,b,f,d,e,g%2);N(a,b,c,d,f-1,g+1);N(a,b,c,f+1,e,g+1)}} | ||
function O(a,b,c,d,e,g){for(;e>d;){if(600<e-d){var f=e-d+1,l=c-d+1,h=Math.log(f),k=.5*Math.exp(2*h/3);h=.5*Math.sqrt(h*k*(f-k)/f)*(0>l-f/2?-1:1);O(a,b,c,Math.max(d,Math.floor(c-l*k/f+h)),Math.min(e,Math.floor(c+(f-l)*k/f+h)),g)}f=b[2*c+g];l=d;k=e;P(a,b,d,c);for(b[2*e+g]>f&&P(a,b,d,e);l<k;){P(a,b,l,k);l++;for(k--;b[2*l+g]<f;)l++;for(;b[2*k+g]>f;)k--}b[2*d+g]===f?P(a,b,d,k):(k++,P(a,b,k,e));k<=c&&(d=k+1);c<=k&&(e=k-1)}}function P(a,b,c,d){Q(a,c,d);Q(b,2*c,2*d);Q(b,2*c+1,2*d+1)} | ||
function Q(a,b,c){let d=a[b];a[b]=a[c];a[c]=d}let oa=a=>a[0],pa=a=>a[1]; | ||
class R{constructor(a,b=oa,c=pa,d=64,e=Float64Array){this.nodeSize=d;this.points=a;let g=this.ids=new (65536>a.length?Uint16Array:Uint32Array)(a.length);e=this.coords=new e(2*a.length);for(let d=0;d<a.length;d++)g[d]=d,e[2*d]=b(a[d]),e[2*d+1]=c(a[d]);N(g,e,d,0,g.length-1,0)}range(a,b,c,d){{var e=this.ids,g=this.coords,f=this.nodeSize;let h=[0,e.length-1,0],k=[],m,n;for(;h.length;){var l=h.pop();let t=h.pop(),q=h.pop();if(t-q<=f){for(l=q;l<=t;l++)m=g[2*l],n=g[2*l+1],m>=a&&m<=c&&n>=b&&n<=d&&k.push(e[l]); | ||
continue}let p=Math.floor((q+t)/2);m=g[2*p];n=g[2*p+1];m>=a&&m<=c&&n>=b&&n<=d&&k.push(e[p]);let r=(l+1)%2;if(0===l?a<=m:b<=n)h.push(q),h.push(p-1),h.push(r);if(0===l?c>=m:d>=n)h.push(p+1),h.push(t),h.push(r)}a=k}return a}within(a,b,c){{var d=this.ids,e=this.coords,g=this.nodeSize;let m=[0,d.length-1,0],n=[],t=c*c;for(;m.length;){var f=m.pop();let q=m.pop();var l=m.pop();if(q-l<=g){for(f=l;f<=q;f++){l=e[2*f]-a;var h=e[2*f+1]-b;l=l*l+h*h;l<=t&&n.push(d[f])}continue}h=Math.floor((l+q)/2);let p=e[2*h], | ||
r=e[2*h+1];{var k=p-a;let c=r-b;k=k*k+c*c}k<=t&&n.push(d[h]);k=(f+1)%2;if(0===f?a-c<=p:b-c<=r)m.push(l),m.push(h-1),m.push(k);if(0===f?a+c>=p:b+c>=r)m.push(h+1),m.push(q),m.push(k)}a=n}return a}}let qa={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:a=>a},S=Math.fround||(a=>b=>{a[0]=+b;return a[0]})(new Float32Array(1)); | ||
class ra{constructor(a){this.options=T(Object.create(qa),a);this.trees=Array(this.options.maxZoom+1)}load(a){let {log:b,minZoom:c,maxZoom:d,nodeSize:e}=this.options;b&&console.time("total time");var g=`prepare ${a.length} points`;b&&console.time(g);this.points=a;let f=[];for(let b=0;b<a.length;b++)a[b].geometry&&f.push(sa(a[b],b));this.trees[d+1]=new R(f,U,V,e,Float32Array);b&&console.timeEnd(g);for(a=d;a>=c;a--)g=+Date.now(),f=this._cluster(f,a),this.trees[a]=new R(f,U,V,e,Float32Array),b&&console.log("z%d: %d clusters in %dms", | ||
a,f.length,+Date.now()-g);b&&console.timeEnd("total time");return this}getClusters(a,b){let c=((a[0]+180)%360+360)%360-180;var d=Math.max(-90,Math.min(90,a[1])),e=180===a[2]?180:((a[2]+180)%360+360)%360-180;let g=Math.max(-90,Math.min(90,a[3]));if(360<=a[2]-a[0])c=-180,e=180;else if(c>e){var f=this.getClusters([c,d,180,g],b);d=this.getClusters([-180,d,e,g],b);return f.concat(d)}b=this.trees[this._limitZoom(b)];e=b.range(c/360+.5,W(g),e/360+.5,W(d));d=[];for(f of e)e=b.points[f],d.push(e.numPoints? | ||
ta(e):this.points[e.index]);return d}getChildren(a){var b=this._getOriginId(a),c=this._getOriginZoom(a);let d=this.trees[c];if(!d)throw Error("No cluster with the specified id.");b=d.points[b];if(!b)throw Error("No cluster with the specified id.");b=d.within(b.x,b.y,this.options.radius/(this.options.extent*Math.pow(2,c-1)));c=[];for(let e of b)b=d.points[e],b.parentId===a&&c.push(b.numPoints?ta(b):this.points[b.index]);if(0===c.length)throw Error("No cluster with the specified id.");return c}getLeaves(a, | ||
b,c){let d=[];this._appendLeaves(d,a,b||10,c||0,0);return d}getTile(a,b,c){let d=this.trees[this._limitZoom(a)];a=Math.pow(2,a);let {extent:e,radius:g}=this.options,f=g/e,l=(c-f)/a,h=(c+1+f)/a,k={features:[]};this._addTileFeatures(d.range((b-f)/a,l,(b+1+f)/a,h),d.points,b,c,a,k);0===b&&this._addTileFeatures(d.range(1-f/a,l,1,h),d.points,a,c,a,k);b===a-1&&this._addTileFeatures(d.range(0,l,f/a,h),d.points,-1,c,a,k);return k.features.length?k:null}getClusterExpansionZoom(a){let b=this._getOriginZoom(a)- | ||
1;for(;b<=this.options.maxZoom;){a=this.getChildren(a);b++;if(1!==a.length)break;a=a[0].properties.cluster_id}return b}_appendLeaves(a,b,c,d,e){b=this.getChildren(b);for(let g of b)if((b=g.properties)&&b.cluster?e=e+b.point_count<=d?e+b.point_count:this._appendLeaves(a,b.cluster_id,c,d,e):e<d?e++:a.push(g),a.length===c)break;return e}_addTileFeatures(a,b,c,d,e,g){for(let h of a){a=b[h];let k=a.numPoints;var f=void 0;let m;var l=void 0;k?(f=ua(a),m=a.x,l=a.y):(l=this.points[a.index],f=l.properties, | ||
m=l.geometry.coordinates[0]/360+.5,l=W(l.geometry.coordinates[1]));f={type:1,geometry:[[Math.round(this.options.extent*(m*e-c)),Math.round(this.options.extent*(l*e-d))]],tags:f};let n;k?n=a.id:this.options.generateId?n=a.index:this.points[a.index].id&&(n=this.points[a.index].id);void 0!==n&&(f.id=n);g.features.push(f)}}_limitZoom(a){return Math.max(this.options.minZoom,Math.min(Math.floor(+a),this.options.maxZoom+1))}_cluster(a,b){let c=[],{radius:d,extent:e,reduce:g,minPoints:f}=this.options,l=d/ | ||
(e*Math.pow(2,b));for(let d=0;d<a.length;d++){var h=a[d];if(h.zoom<=b)continue;h.zoom=b;let e=this.trees[b+1];var k=e.within(h.x,h.y,l),m=h.numPoints||1;let p=m;for(let a of k){var n=e.points[a];n.zoom>b&&(p+=n.numPoints||1)}if(p>m&&p>=f){n=h.x*m;let a=h.y*m;m=g&&1<m?this._map(h,!0):null;let f=(d<<5)+(b+1)+this.points.length;for(let c of k){k=e.points[c];if(k.zoom<=b)continue;k.zoom=b;let d=k.numPoints||1;n+=k.x*d;a+=k.y*d;k.parentId=f;g&&(m||(m=this._map(h,!0)),g(m,this._map(k)))}h.parentId=f;c.push(va(n/ | ||
p,a/p,f,p,m))}else if(c.push(h),1<p)for(let a of k)h=e.points[a],h.zoom<=b||(h.zoom=b,c.push(h))}return c}_getOriginId(a){return a-this.points.length>>5}_getOriginZoom(a){return(a-this.points.length)%32}_map(a,b){if(a.numPoints)return b?T({},a.properties):a.properties;a=this.points[a.index].properties;let c=this.options.map(a);return b&&c===a?T({},c):c}}function va(a,b,c,d,e){return{x:S(a),y:S(b),zoom:Infinity,id:c,parentId:-1,numPoints:d,properties:e}} | ||
function sa(a,b){let [c,d]=a.geometry.coordinates;return{x:S(c/360+.5),y:S(W(d)),zoom:Infinity,index:b,parentId:-1}}function ta(a){var b=a.id,c=ua(a);return{type:"Feature",id:b,properties:c,geometry:{type:"Point",coordinates:[360*(a.x-.5),360*Math.atan(Math.exp((180-360*a.y)*Math.PI/180))/Math.PI-90]}}} | ||
function ua(a){let b=a.numPoints,c=1E4<=b?`${Math.round(b/1E3)}k`:1E3<=b?`${Math.round(b/100)/10}k`:b;return T(T({},a.properties),{cluster:!0,cluster_id:a.id,point_count:b,point_count_abbreviated:c})}function W(a){a=Math.sin(a*Math.PI/180);a=.5-.25*Math.log((1+a)/(1-a))/Math.PI;return 0>a?0:1<a?1:a}function T(a,b){for(let c in b)a[c]=b[c];return a}function U(a){return a.x}function V(a){return a.y} | ||
var xa=function wa(a,b){if(a===b)return!0;if(a&&b&&"object"==typeof a&&"object"==typeof b){if(a.constructor!==b.constructor)return!1;var d;if(Array.isArray(a)){var e=a.length;if(e!=b.length)return!1;for(d=e;0!==d--;)if(!wa(a[d],b[d]))return!1;return!0}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();var g=Object.keys(a);e=g.length; | ||
if(e!==Object.keys(b).length)return!1;for(d=e;0!==d--;)if(!Object.prototype.hasOwnProperty.call(b,g[d]))return!1;for(d=e;0!==d--;)if(e=g[d],!wa(a[e],b[e]))return!1;return!0}return a!==a&&b!==b}; | ||
class X{constructor({markers:a,position:b}){this.markers=a;b&&(this._position=b instanceof google.maps.LatLng?b:new google.maps.LatLng(b))}get bounds(){if(0!==this.markers.length||this._position)return this.markers.reduce((a,b)=>a.extend(b.getPosition()),new google.maps.LatLngBounds(this._position,this._position))}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(a=>a.getVisible()).length}push(a){this.markers.push(a)}delete(){this.marker&&(this.marker.setMap(null), | ||
delete this.marker);this.markers.length=0}}class ya{constructor({maxZoom:a=16}){this.maxZoom=a}noop({markers:a}){return za(a)}}let za=a=>a.map(a=>new X({position:a.getPosition(),markers:[a]})); | ||
class Aa extends ya{constructor(a){var {maxZoom:b,radius:c=60}=a,d=["maxZoom","radius"],e={},g;for(g in a)Object.prototype.hasOwnProperty.call(a,g)&&0>d.indexOf(g)&&(e[g]=a[g]);if(null!=a&&"function"===typeof Object.getOwnPropertySymbols){var f=0;for(g=Object.getOwnPropertySymbols(a);f<g.length;f++)0>d.indexOf(g[f])&&Object.prototype.propertyIsEnumerable.call(a,g[f])&&(e[g[f]]=a[g[f]])}super({maxZoom:b});this.superCluster=new ra(Object.assign({maxZoom:this.maxZoom,radius:c},e));this.state={zoom:null}}calculate(a){let b= | ||
!1;if(!xa(a.markers,this.markers)){b=!0;this.markers=[...a.markers];var c=this.markers.map(a=>({type:"Feature",geometry:{type:"Point",coordinates:[a.getPosition().lng(),a.getPosition().lat()]},properties:{marker:a}}));this.superCluster.load(c)}c={zoom:a.map.getZoom()};b||this.state.zoom>this.maxZoom&&c.zoom>this.maxZoom||(b=b||!xa(this.state,c));this.state=c;b&&(this.clusters=this.cluster(a));return{clusters:this.clusters,changed:b}}cluster({map:a}){return this.superCluster.getClusters([-180,-90, | ||
180,90],Math.round(a.getZoom())).map(this.transformCluster.bind(this))}transformCluster({geometry:{coordinates:[a,b]},properties:c}){if(c.cluster)return new X({markers:this.superCluster.getLeaves(c.cluster_id,Infinity).map(a=>a.properties.marker),position:new google.maps.LatLng({lat:b,lng:a})});a=c.marker;return new X({markers:[a],position:a.getPosition()})}} | ||
class Ba{constructor(a,b){this.markers={sum:a.length};a=b.map(a=>a.count);let c=a.reduce((a,b)=>a+b,0);this.clusters={count:b.length,markers:{mean:c/b.length,sum:c,min:Math.min(...a),max:Math.max(...a)}}}}class Ca{render({count:a,position:b},c){c=window.btoa(` | ||
mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number, | ||
required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1}},emits:E,setup(a,{emit:b}){let c=ref(),d=ref(!1),e=ref(),g=ref(),f=ref(!1);provide(t,e);provide(u, | ||
g);provide(z,f);let l=()=>{const b={...a};Object.keys(b).forEach(a=>{void 0===b[a]&&delete b[a]});var c=a=>{var b;return a?{position:null===(b=g.value)||void 0===b?void 0:b.ControlPosition[a]}:{}};c={scaleControlOptions:a.scaleControlStyle?{style:a.scaleControlStyle}:{},panControlOptions:c(a.panControlPosition),zoomControlOptions:c(a.zoomControlPosition),rotateControlOptions:c(a.rotateControlPosition),streetViewControlOptions:c(a.streetViewControlPosition),fullscreenControlOptions:c(a.fullscreenControlPosition), | ||
disableDefaultUI:a.disableDefaultUi};return{...b,...c}},k=watch([g,e],([a,b])=>{a&&b&&(a.event.addListenerOnce(b,"tilesloaded",()=>{f.value=!0}),setTimeout(k,0))},{immediate:!0}),h=()=>{try{const {apiKey:b,region:c,version:d,language:e,libraries:f}=a;A.value=new D({apiKey:b,region:c,version:d,language:e,libraries:f})}catch(m){console.error(m)}};onMounted(()=>{h();A.value.load().then(()=>{g.value=markRaw(google.maps);e.value=markRaw(new google.maps.Map(c.value,l()));var f=ba(g.value);g.value[y]=f; | ||
E.forEach(a=>{var c;null===(c=e.value)||void 0===c?void 0:c.addListener(a,c=>b(a,c))});d.value=!0;f=Object.keys(a).filter(a=>!["center","zoom"].includes(a)).map(b=>toRef(a,b));watch([()=>a.center,()=>a.zoom,...f],([a,b],[c,d])=>{var f,g,m;let {center:h,zoom:k,...n}=l();null===(f=e.value)||void 0===f?void 0:f.setOptions(n);void 0!==b&&b!==d&&(null===(g=e.value)||void 0===g?void 0:g.setZoom(b));b=!c||a.lng!==c.lng||a.lat!==c.lat;a&&b&&(null===(m=e.value)||void 0===m?void 0:m.panTo(a))})})});onBeforeUnmount(()=> | ||
{var a;f.value=!1;e.value&&(null===(a=g.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value))});return{mapRef:c,ready:d,map:e,api:g,mapTilesLoaded:f}}}); | ||
function G(a,b){void 0===b&&(b={});b=b.insertAt;if(a&&"undefined"!==typeof document){var c=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css";"top"===b?c.firstChild?c.insertBefore(d,c.firstChild):c.appendChild(d):c.appendChild(d);d.styleSheet?d.styleSheet.cssText=a:d.appendChild(document.createTextNode(a))}}G("\n.mapdiv[data-v-177d06e3] {\n width: 100%;\n height: 100%;\n}\n");let ca=withScopeId("data-v-177d06e3");pushScopeId("data-v-177d06e3"); | ||
let da={ref:"mapRef",class:"mapdiv"};popScopeId();let ea=ca(a=>(openBlock(),createBlock("div",null,[createVNode("div",da,null,512),renderSlot(a.$slots,"default",{ready:a.ready,map:a.map,api:a.api,mapTilesLoaded:a.mapTilesLoaded},void 0,!0)])));F.render=ea;F.__scopeId="data-v-177d06e3"; | ||
let H=(a,b,c,d)=>{const e=ref(),g=inject(t,ref()),f=inject(u,ref()),l=inject(x,ref()),k=computed(()=>!!(l.value&&f.value&&(e.value instanceof f.value.Marker||e.value instanceof f.value[y])));watch([g,c],(h,[m,n])=>{var q,r,p;h=JSON.stringify(c.value)!==JSON.stringify(n)||g.value!==m;g.value&&f.value&&h&&(e.value?(e.value.setOptions(c.value),k.value&&(null===(q=l.value)||void 0===q?void 0:q.removeMarker(e.value),null===(r=l.value)||void 0===r?void 0:r.addMarker(e.value))):(e.value="Marker"===a?markRaw(new f.value[a](c.value)): | ||
a===y?markRaw(new f.value[a](c.value)):markRaw(new f.value[a]({...c.value,map:g.value})),k.value?null===(p=l.value)||void 0===p?void 0:p.addMarker(e.value):e.value.setMap(g.value),b.forEach(a=>{var b;null===(b=e.value)||void 0===b?void 0:b.addListener(a,b=>d(a,b))})))},{immediate:!0});onBeforeUnmount(()=>{var a,b;e.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value),k.value?null===(b=l.value)||void 0===b?void 0:b.removeMarker(e.value):e.value.setMap(null))});return e}, | ||
I="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 fa=defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:I,setup(a,{emit:b,expose:c,slots:d}){a=toRef(a,"options");b=H("Marker",I,a,b);provide(w,b);c({marker:b});return()=>{var a;return null===(a=d.default)||void 0===a?void 0:a.call(d)}}}),ha=defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:B,setup(a,{emit:b}){a=toRef(a,"options");return{polyline:H("Polyline",B,a,b)}},render:()=>null}),ia=defineComponent({name:"Polygon",props:{options:{type:Object, | ||
required:!0}},emits:B,setup(a,{emit:b}){a=toRef(a,"options");return{polygon:H("Polygon",B,a,b)}},render:()=>null});let J=B.concat(["bounds_changed"]);var ja=defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:J,setup(a,{emit:b}){a=toRef(a,"options");return{rectangle:H("Rectangle",J,a,b)}},render:()=>null});let K=B.concat(["center_changed","radius_changed"]); | ||
var ka=defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:K,setup(a,{emit:b}){a=toRef(a,"options");return{circle:H("Circle",K,a,b)}},render:()=>null}),L=defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(a,{emit:b}){let c=ref(null),d=inject(t,ref()),e=inject(u,ref()),g=inject(z,ref(!1)),f=ref(!1),l=watch([g,e,c],([c,d,e])=>{d&&c&&e&&(k(a.position),f.value=!0,b("content:loaded"),setTimeout(l,0))},{immediate:!0}), | ||
k=a=>{d.value&&e.value&&c.value&&d.value.controls[e.value.ControlPosition[a]].push(c.value)},h=a=>{if(d.value&&e.value){let b=null;a=e.value.ControlPosition[a];d.value.controls[a].forEach((a,d)=>{a===c.value&&(b=d)});null!==b&&d.value.controls[a].removeAt(b)}};onBeforeUnmount(()=>h(a.position));watch(()=>a.position,(a,b)=>{h(b);k(a)});watch(()=>a.index,b=>{b&&c.value&&(c.value.index=a.index)});return{controlRef:c,showContent:f}}});let la={ref:"controlRef"}; | ||
L.render=function(a){return openBlock(),createBlock(Fragment,null,[createCommentVNode("\n v-show must be used instead of v-if otherwise there\n would be no rendered content pushed to the map controls\n "),withDirectives(createVNode("div",la,[renderSlot(a.$slots,"default")],512),[[vShow,a.showContent]])],2112)};let M="closeclick content_changed domready position_changed visible zindex_changed".split(" "); | ||
var N=defineComponent({props:{options:{type:Object,default:()=>({})}},emits:M,setup(a,{slots:b,emit:c}){let d=ref(),e=ref(),g=inject(t,ref()),f=inject(u,ref()),l=inject(w,ref()),k,h=computed(()=>{var a;return null===(a=b.default)||void 0===a?void 0:a.call(b).some(a=>a.type!==Comment)});onMounted(()=>{watch([g,()=>a.options],([,a],[b,q])=>{b=JSON.stringify(a)!==JSON.stringify(q)||g.value!==b;g.value&&f.value&&b&&(d.value?(d.value.setOptions({...a,content:h.value?e.value:a.content}),l.value||d.value.open({map:g.value})): | ||
(d.value=d.value=markRaw(new f.value.InfoWindow({...a,content:h.value?e.value:a.content})),l.value?k=l.value.addListener("click",()=>{d.value&&d.value.open({map:g.value,anchor:l.value})}):d.value.open({map:g.value}),M.forEach(a=>{var b;null===(b=d.value)||void 0===b?void 0:b.addListener(a,b=>c(a,b))})))},{immediate:!0})});onBeforeUnmount(()=>{var a;k&&k.remove();d.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(d.value),d.value.close())});return{infoWindow:d,infoWindowRef:e, | ||
hasSlotContent:h}}});G("\n.info-window-content[data-v-5b373d6e] {\n display: none;\n}\n.mapdiv .info-window-content[data-v-5b373d6e] {\n display: inline-block;\n}\n");let ma=withScopeId("data-v-5b373d6e");pushScopeId("data-v-5b373d6e");let na={key:0,ref:"infoWindowRef",class:"info-window-content"};popScopeId();let oa=ma(a=>a.hasSlotContent?(openBlock(),createBlock("div",na,[renderSlot(a.$slots,"default",{},void 0,!0)],512)):createCommentVNode("v-if",!0));N.render=oa;N.__scopeId="data-v-5b373d6e"; | ||
function O(a,b,c,d,e,g){if(!(e-d<=c)){var f=d+e>>1;P(a,b,f,d,e,g%2);O(a,b,c,d,f-1,g+1);O(a,b,c,f+1,e,g+1)}} | ||
function P(a,b,c,d,e,g){for(;e>d;){if(600<e-d){var f=e-d+1,l=c-d+1,k=Math.log(f),h=.5*Math.exp(2*k/3);k=.5*Math.sqrt(k*h*(f-h)/f)*(0>l-f/2?-1:1);P(a,b,c,Math.max(d,Math.floor(c-l*h/f+k)),Math.min(e,Math.floor(c+(f-l)*h/f+k)),g)}f=b[2*c+g];l=d;h=e;Q(a,b,d,c);for(b[2*e+g]>f&&Q(a,b,d,e);l<h;){Q(a,b,l,h);l++;for(h--;b[2*l+g]<f;)l++;for(;b[2*h+g]>f;)h--}b[2*d+g]===f?Q(a,b,d,h):(h++,Q(a,b,h,e));h<=c&&(d=h+1);c<=h&&(e=h-1)}}function Q(a,b,c,d){R(a,c,d);R(b,2*c,2*d);R(b,2*c+1,2*d+1)} | ||
function R(a,b,c){let d=a[b];a[b]=a[c];a[c]=d}let pa=a=>a[0],qa=a=>a[1]; | ||
class S{constructor(a,b=pa,c=qa,d=64,e=Float64Array){this.nodeSize=d;this.points=a;let g=this.ids=new (65536>a.length?Uint16Array:Uint32Array)(a.length);e=this.coords=new e(2*a.length);for(let d=0;d<a.length;d++)g[d]=d,e[2*d]=b(a[d]),e[2*d+1]=c(a[d]);O(g,e,d,0,g.length-1,0)}range(a,b,c,d){{var e=this.ids,g=this.coords,f=this.nodeSize;let k=[0,e.length-1,0],h=[],m,n;for(;k.length;){var l=k.pop();let q=k.pop(),r=k.pop();if(q-r<=f){for(l=r;l<=q;l++)m=g[2*l],n=g[2*l+1],m>=a&&m<=c&&n>=b&&n<=d&&h.push(e[l]); | ||
continue}let p=Math.floor((r+q)/2);m=g[2*p];n=g[2*p+1];m>=a&&m<=c&&n>=b&&n<=d&&h.push(e[p]);let v=(l+1)%2;if(0===l?a<=m:b<=n)k.push(r),k.push(p-1),k.push(v);if(0===l?c>=m:d>=n)k.push(p+1),k.push(q),k.push(v)}a=h}return a}within(a,b,c){{var d=this.ids,e=this.coords,g=this.nodeSize;let m=[0,d.length-1,0],n=[],q=c*c;for(;m.length;){var f=m.pop();let r=m.pop();var l=m.pop();if(r-l<=g){for(f=l;f<=r;f++){l=e[2*f]-a;var k=e[2*f+1]-b;l=l*l+k*k;l<=q&&n.push(d[f])}continue}k=Math.floor((l+r)/2);let p=e[2*k], | ||
v=e[2*k+1];{var h=p-a;let c=v-b;h=h*h+c*c}h<=q&&n.push(d[k]);h=(f+1)%2;if(0===f?a-c<=p:b-c<=v)m.push(l),m.push(k-1),m.push(h);if(0===f?a+c>=p:b+c>=v)m.push(k+1),m.push(r),m.push(h)}a=n}return a}}let ra={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:a=>a},T=Math.fround||(a=>b=>{a[0]=+b;return a[0]})(new Float32Array(1)); | ||
class sa{constructor(a){this.options=U(Object.create(ra),a);this.trees=Array(this.options.maxZoom+1)}load(a){let {log:b,minZoom:c,maxZoom:d,nodeSize:e}=this.options;b&&console.time("total time");var g=`prepare ${a.length} points`;b&&console.time(g);this.points=a;let f=[];for(let b=0;b<a.length;b++)a[b].geometry&&f.push(ta(a[b],b));this.trees[d+1]=new S(f,ua,va,e,Float32Array);b&&console.timeEnd(g);for(a=d;a>=c;a--)g=+Date.now(),f=this._cluster(f,a),this.trees[a]=new S(f,ua,va,e,Float32Array),b&&console.log("z%d: %d clusters in %dms", | ||
a,f.length,+Date.now()-g);b&&console.timeEnd("total time");return this}getClusters(a,b){let c=((a[0]+180)%360+360)%360-180;var d=Math.max(-90,Math.min(90,a[1])),e=180===a[2]?180:((a[2]+180)%360+360)%360-180;let g=Math.max(-90,Math.min(90,a[3]));if(360<=a[2]-a[0])c=-180,e=180;else if(c>e){var f=this.getClusters([c,d,180,g],b);d=this.getClusters([-180,d,e,g],b);return f.concat(d)}b=this.trees[this._limitZoom(b)];e=b.range(c/360+.5,V(g),e/360+.5,V(d));d=[];for(f of e)e=b.points[f],d.push(e.numPoints? | ||
wa(e):this.points[e.index]);return d}getChildren(a){var b=this._getOriginId(a),c=this._getOriginZoom(a);let d=this.trees[c];if(!d)throw Error("No cluster with the specified id.");b=d.points[b];if(!b)throw Error("No cluster with the specified id.");b=d.within(b.x,b.y,this.options.radius/(this.options.extent*Math.pow(2,c-1)));c=[];for(let e of b)b=d.points[e],b.parentId===a&&c.push(b.numPoints?wa(b):this.points[b.index]);if(0===c.length)throw Error("No cluster with the specified id.");return c}getLeaves(a, | ||
b,c){let d=[];this._appendLeaves(d,a,b||10,c||0,0);return d}getTile(a,b,c){let d=this.trees[this._limitZoom(a)];a=Math.pow(2,a);let {extent:e,radius:g}=this.options,f=g/e,l=(c-f)/a,k=(c+1+f)/a,h={features:[]};this._addTileFeatures(d.range((b-f)/a,l,(b+1+f)/a,k),d.points,b,c,a,h);0===b&&this._addTileFeatures(d.range(1-f/a,l,1,k),d.points,a,c,a,h);b===a-1&&this._addTileFeatures(d.range(0,l,f/a,k),d.points,-1,c,a,h);return h.features.length?h:null}getClusterExpansionZoom(a){let b=this._getOriginZoom(a)- | ||
1;for(;b<=this.options.maxZoom;){a=this.getChildren(a);b++;if(1!==a.length)break;a=a[0].properties.cluster_id}return b}_appendLeaves(a,b,c,d,e){b=this.getChildren(b);for(let g of b)if((b=g.properties)&&b.cluster?e=e+b.point_count<=d?e+b.point_count:this._appendLeaves(a,b.cluster_id,c,d,e):e<d?e++:a.push(g),a.length===c)break;return e}_addTileFeatures(a,b,c,d,e,g){for(let k of a){a=b[k];let h=a.numPoints;var f=void 0;let m;var l=void 0;h?(f=xa(a),m=a.x,l=a.y):(l=this.points[a.index],f=l.properties, | ||
m=l.geometry.coordinates[0]/360+.5,l=V(l.geometry.coordinates[1]));f={type:1,geometry:[[Math.round(this.options.extent*(m*e-c)),Math.round(this.options.extent*(l*e-d))]],tags:f};let n;h?n=a.id:this.options.generateId?n=a.index:this.points[a.index].id&&(n=this.points[a.index].id);void 0!==n&&(f.id=n);g.features.push(f)}}_limitZoom(a){return Math.max(this.options.minZoom,Math.min(Math.floor(+a),this.options.maxZoom+1))}_cluster(a,b){let c=[],{radius:d,extent:e,reduce:g,minPoints:f}=this.options,l=d/ | ||
(e*Math.pow(2,b));for(let d=0;d<a.length;d++){var k=a[d];if(k.zoom<=b)continue;k.zoom=b;let e=this.trees[b+1];var h=e.within(k.x,k.y,l),m=k.numPoints||1;let p=m;for(let a of h){var n=e.points[a];n.zoom>b&&(p+=n.numPoints||1)}if(p>m&&p>=f){n=k.x*m;let a=k.y*m;m=g&&1<m?this._map(k,!0):null;let f=(d<<5)+(b+1)+this.points.length;for(let c of h){h=e.points[c];if(h.zoom<=b)continue;h.zoom=b;let d=h.numPoints||1;n+=h.x*d;a+=h.y*d;h.parentId=f;g&&(m||(m=this._map(k,!0)),g(m,this._map(h)))}k.parentId=f;c.push(ya(n/ | ||
p,a/p,f,p,m))}else if(c.push(k),1<p)for(let a of h)k=e.points[a],k.zoom<=b||(k.zoom=b,c.push(k))}return c}_getOriginId(a){return a-this.points.length>>5}_getOriginZoom(a){return(a-this.points.length)%32}_map(a,b){if(a.numPoints)return b?U({},a.properties):a.properties;a=this.points[a.index].properties;let c=this.options.map(a);return b&&c===a?U({},c):c}}function ya(a,b,c,d,e){return{x:T(a),y:T(b),zoom:Infinity,id:c,parentId:-1,numPoints:d,properties:e}} | ||
function ta(a,b){let [c,d]=a.geometry.coordinates;return{x:T(c/360+.5),y:T(V(d)),zoom:Infinity,index:b,parentId:-1}}function wa(a){var b=a.id,c=xa(a);return{type:"Feature",id:b,properties:c,geometry:{type:"Point",coordinates:[360*(a.x-.5),360*Math.atan(Math.exp((180-360*a.y)*Math.PI/180))/Math.PI-90]}}} | ||
function xa(a){let b=a.numPoints,c=1E4<=b?`${Math.round(b/1E3)}k`:1E3<=b?`${Math.round(b/100)/10}k`:b;return U(U({},a.properties),{cluster:!0,cluster_id:a.id,point_count:b,point_count_abbreviated:c})}function V(a){a=Math.sin(a*Math.PI/180);a=.5-.25*Math.log((1+a)/(1-a))/Math.PI;return 0>a?0:1<a?1:a}function U(a,b){for(let c in b)a[c]=b[c];return a}function ua(a){return a.x}function va(a){return a.y} | ||
var Aa=function za(a,b){if(a===b)return!0;if(a&&b&&"object"==typeof a&&"object"==typeof b){if(a.constructor!==b.constructor)return!1;var d;if(Array.isArray(a)){var e=a.length;if(e!=b.length)return!1;for(d=e;0!==d--;)if(!za(a[d],b[d]))return!1;return!0}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();var g=Object.keys(a);e=g.length; | ||
if(e!==Object.keys(b).length)return!1;for(d=e;0!==d--;)if(!Object.prototype.hasOwnProperty.call(b,g[d]))return!1;for(d=e;0!==d--;)if(e=g[d],!za(a[e],b[e]))return!1;return!0}return a!==a&&b!==b}; | ||
class W{constructor({markers:a,position:b}){this.markers=a;b&&(this._position=b instanceof google.maps.LatLng?b:new google.maps.LatLng(b))}get bounds(){if(0!==this.markers.length||this._position)return this.markers.reduce((a,b)=>a.extend(b.getPosition()),new google.maps.LatLngBounds(this._position,this._position))}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(a=>a.getVisible()).length}push(a){this.markers.push(a)}delete(){this.marker&&(this.marker.setMap(null), | ||
delete this.marker);this.markers.length=0}}class Ba{constructor({maxZoom:a=16}){this.maxZoom=a}noop({markers:a}){return Ca(a)}}let Ca=a=>a.map(a=>new W({position:a.getPosition(),markers:[a]})); | ||
class Da extends Ba{constructor(a){var {maxZoom:b,radius:c=60}=a,d=["maxZoom","radius"],e={},g;for(g in a)Object.prototype.hasOwnProperty.call(a,g)&&0>d.indexOf(g)&&(e[g]=a[g]);if(null!=a&&"function"===typeof Object.getOwnPropertySymbols){var f=0;for(g=Object.getOwnPropertySymbols(a);f<g.length;f++)0>d.indexOf(g[f])&&Object.prototype.propertyIsEnumerable.call(a,g[f])&&(e[g[f]]=a[g[f]])}super({maxZoom:b});this.superCluster=new sa(Object.assign({maxZoom:this.maxZoom,radius:c},e));this.state={zoom:null}}calculate(a){let b= | ||
!1;if(!Aa(a.markers,this.markers)){b=!0;this.markers=[...a.markers];var c=this.markers.map(a=>({type:"Feature",geometry:{type:"Point",coordinates:[a.getPosition().lng(),a.getPosition().lat()]},properties:{marker:a}}));this.superCluster.load(c)}c={zoom:a.map.getZoom()};b||this.state.zoom>this.maxZoom&&c.zoom>this.maxZoom||(b=b||!Aa(this.state,c));this.state=c;b&&(this.clusters=this.cluster(a));return{clusters:this.clusters,changed:b}}cluster({map:a}){return this.superCluster.getClusters([-180,-90, | ||
180,90],Math.round(a.getZoom())).map(this.transformCluster.bind(this))}transformCluster({geometry:{coordinates:[a,b]},properties:c}){if(c.cluster)return new W({markers:this.superCluster.getLeaves(c.cluster_id,Infinity).map(a=>a.properties.marker),position:new google.maps.LatLng({lat:b,lng:a})});a=c.marker;return new W({markers:[a],position:a.getPosition()})}} | ||
class Ea{constructor(a,b){this.markers={sum:a.length};a=b.map(a=>a.count);let c=a.reduce((a,b)=>a+b,0);this.clusters={count:b.length,markers:{mean:c/b.length,sum:c,min:Math.min(...a),max:Math.max(...a)}}}}class Fa{render({count:a,position:b},c){c=window.btoa(` | ||
<svg fill="${a>Math.max(10,c.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"> | ||
@@ -72,9 +78,11 @@ <circle cx="120" cy="120" opacity=".6" r="70" /> | ||
<circle cx="120" cy="120" opacity=".2" r="110" /> | ||
</svg>`);return new google.maps.Marker({position:b,icon:{url:`data:image/svg+xml;base64,${c}`,scaledSize:new google.maps.Size(45,45)},label:{text:String(a),color:"rgba(255,255,255,0.9)",fontSize:"12px"},title:`Cluster of ${a} markers`,zIndex:Number(google.maps.Marker.MAX_ZINDEX)+a})}}class Da{constructor(){var a=Da,b=google.maps.OverlayView;for(let c in b.prototype)a.prototype[c]=b.prototype[c]}}var Y,Z=Y||(Y={});Z.CLUSTERING_BEGIN="clusteringbegin";Z.CLUSTERING_END="clusteringend"; | ||
Z.CLUSTER_CLICK="click";let Ea=(a,b,c)=>{c.fitBounds(b.bounds)}; | ||
class Fa extends Da{constructor({map:a,markers:b=[],algorithm:c=new Aa({}),renderer:d=new Ca,onClusterClick:e=Ea}){super();this.markers=[...b];this.clusters=[];this.algorithm=c;this.renderer=d;this.onClusterClick=e;a&&this.setMap(a)}addMarker(a,b){this.markers.includes(a)||(this.markers.push(a),b||this.render())}addMarkers(a,b){a.forEach(a=>{this.addMarker(a,!0)});b||this.render()}removeMarker(a,b){let c=this.markers.indexOf(a);if(-1===c)return!1;a.setMap(null);this.markers.splice(c,1);b||this.render(); | ||
return!0}removeMarkers(a,b){let c=!1;a.forEach(a=>{c=this.removeMarker(a,!0)||c});c&&!b&&this.render();return c}clearMarkers(a){this.markers.length=0;a||this.render()}render(){let a=this.getMap();if(a instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,Y.CLUSTERING_BEGIN,this);let {clusters:b,changed:c}=this.algorithm.calculate({markers:this.markers,map:a,mapCanvasProjection:this.getProjection()});if(c||void 0==c)this.reset(),this.clusters=b,this.renderClusters();google.maps.event.trigger(this, | ||
Y.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this));this.render()}onRemove(){google.maps.event.removeListener(this.idleListener);this.reset()}reset(){this.markers.forEach(a=>a.setMap(null));this.clusters.forEach(a=>a.delete());this.clusters=[]}renderClusters(){let a=new Ba(this.markers,this.clusters),b=this.getMap();this.clusters.forEach(c=>{1===c.markers.length?c.marker=c.markers[0]:(c.marker=this.renderer.render(c,a),this.onClusterClick&&c.marker.addListener("click", | ||
a=>{google.maps.event.trigger(this,Y.CLUSTER_CLICK,c);this.onClusterClick(a,c,b)}));c.marker.setMap(b)})}}let Ga=["clusteringbegin","clusteringend","click"]; | ||
var Ha=defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:Ga,setup(a,{emit:b,expose:c,slots:d}){let e=ref(),g=inject(u,ref()),f=inject(v,ref());provide(x,e);watch(g,()=>{g.value&&(e.value=markRaw(new Fa({map:g.value,...a.options})),Ga.forEach(a=>{var c;null===(c=e.value)||void 0===c?void 0:c.addListener(a,c=>b(a,c))}))},{immediate:!0});onBeforeUnmount(()=>{var a;e.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value),e.value.clearMarkers(), | ||
e.value.setMap(null))});c({markerCluster:e});return()=>{var a;return null===(a=d.default)||void 0===a?void 0:a.call(d)}}});export{ja as Circle,K as CustomControl,E as GoogleMap,M as InfoWindow,ea as Marker,Ha as MarkerCluster,ha as Polygon,fa as Polyline,ia as Rectangle} | ||
</svg>`);return new google.maps.Marker({position:b,icon:{url:`data:image/svg+xml;base64,${c}`,scaledSize:new google.maps.Size(45,45)},label:{text:String(a),color:"rgba(255,255,255,0.9)",fontSize:"12px"},title:`Cluster of ${a} markers`,zIndex:Number(google.maps.Marker.MAX_ZINDEX)+a})}}class Ga{constructor(){var a=Ga,b=google.maps.OverlayView;for(let c in b.prototype)a.prototype[c]=b.prototype[c]}}var X,Y=X||(X={});Y.CLUSTERING_BEGIN="clusteringbegin";Y.CLUSTERING_END="clusteringend"; | ||
Y.CLUSTER_CLICK="click";let Ha=(a,b,c)=>{c.fitBounds(b.bounds)}; | ||
class Ia extends Ga{constructor({map:a,markers:b=[],algorithm:c=new Da({}),renderer:d=new Fa,onClusterClick:e=Ha}){super();this.markers=[...b];this.clusters=[];this.algorithm=c;this.renderer=d;this.onClusterClick=e;a&&this.setMap(a)}addMarker(a,b){this.markers.includes(a)||(this.markers.push(a),b||this.render())}addMarkers(a,b){a.forEach(a=>{this.addMarker(a,!0)});b||this.render()}removeMarker(a,b){let c=this.markers.indexOf(a);if(-1===c)return!1;a.setMap(null);this.markers.splice(c,1);b||this.render(); | ||
return!0}removeMarkers(a,b){let c=!1;a.forEach(a=>{c=this.removeMarker(a,!0)||c});c&&!b&&this.render();return c}clearMarkers(a){this.markers.length=0;a||this.render()}render(){let a=this.getMap();if(a instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,X.CLUSTERING_BEGIN,this);let {clusters:b,changed:c}=this.algorithm.calculate({markers:this.markers,map:a,mapCanvasProjection:this.getProjection()});if(c||void 0==c)this.reset(),this.clusters=b,this.renderClusters();google.maps.event.trigger(this, | ||
X.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this));this.render()}onRemove(){google.maps.event.removeListener(this.idleListener);this.reset()}reset(){this.markers.forEach(a=>a.setMap(null));this.clusters.forEach(a=>a.delete());this.clusters=[]}renderClusters(){let a=new Ea(this.markers,this.clusters),b=this.getMap();this.clusters.forEach(c=>{1===c.markers.length?c.marker=c.markers[0]:(c.marker=this.renderer.render(c,a),this.onClusterClick&&c.marker.addListener("click", | ||
a=>{google.maps.event.trigger(this,X.CLUSTER_CLICK,c);this.onClusterClick(a,c,b)}));c.marker.setMap(b)})}}let Ja=Object.values(X); | ||
var Ka=defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:Ja,setup(a,{emit:b,expose:c,slots:d}){let e=ref(),g=inject(t,ref()),f=inject(u,ref());provide(x,e);watch(g,()=>{g.value&&(e.value=markRaw(new Ia({map:g.value,...a.options})),Ja.forEach(a=>{var c;null===(c=e.value)||void 0===c?void 0:c.addListener(a,c=>b(a,c))}))},{immediate:!0});onBeforeUnmount(()=>{var a;e.value&&(null===(a=f.value)||void 0===a?void 0:a.event.clearInstanceListeners(e.value),e.value.clearMarkers(), | ||
e.value.setMap(null))});c({markerCluster:e});return()=>{var a;return null===(a=d.default)||void 0===a?void 0:a.call(d)}}}),Z=defineComponent({props:{options:{type:Object,required:!0}},setup(a,{slots:b,emit:c}){let d=ref(),e=ref(),g=computed(()=>{var a;return null===(a=b.default)||void 0===a?void 0:a.call(b).some(a=>a.type!==Comment)}),f=computed(()=>({...a.options,element:d.value}));onMounted(()=>{e=H(y,[],f,c)});return{customMarkerRef:d,customMarker:e,hasSlotContent:g}}});G("\n.custom-marker-content[data-v-b9d5ec8a] {\n display: none;\n}\n.mapdiv .custom-marker-content[data-v-b9d5ec8a] {\n display: inline-block;\n}\n"); | ||
let La=withScopeId("data-v-b9d5ec8a")(a=>a.hasSlotContent?(openBlock(),createBlock("div",{key:0,ref:"customMarkerRef",class:"custom-marker-content",style:{cursor:a.$attrs.onClick?"pointer":void 0}},[renderSlot(a.$slots,"default",{},void 0,!0),renderSlot(a.$slots,"info-windows",{},void 0,!0)],4)):createCommentVNode("v-if",!0));Z.render=La;Z.__scopeId="data-v-b9d5ec8a"; | ||
export{ka as Circle,L as CustomControl,Z as CustomMarker,F as GoogleMap,N as InfoWindow,fa as Marker,Ka as MarkerCluster,ia as Polygon,ha as Polyline,ja as Rectangle} |
@@ -9,3 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
circle: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
circle: import("vue").Ref<google.maps.Circle | undefined>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -12,0 +12,0 @@ options: google.maps.CircleOptions; |
@@ -102,2 +102,6 @@ /// <reference types="google.maps" /> | ||
}; | ||
mapId: { | ||
type: StringConstructor; | ||
required: false; | ||
}; | ||
maxZoom: { | ||
@@ -187,420 +191,6 @@ type: NumberConstructor; | ||
}, { | ||
mapRef: import("vue").Ref<HTMLElement | null>; | ||
mapRef: import("vue").Ref<HTMLElement | undefined>; | ||
ready: import("vue").Ref<boolean>; | ||
map: import("vue").Ref<{ | ||
controls: { | ||
clear: () => void; | ||
forEach: (callback: (a: any, b: number) => void) => void; | ||
getArray: () => any[]; | ||
getAt: (i: number) => any; | ||
getLength: () => number; | ||
insertAt: (i: number, elem: any) => void; | ||
pop: () => any; | ||
push: (elem: any) => number; | ||
removeAt: (i: number) => any; | ||
setAt: (i: number, elem: any) => void; | ||
addListener: (eventName: string, handler: Function) => google.maps.MapsEventListener; | ||
bindTo: (key: string, target: google.maps.MVCObject, targetKey?: string | null | undefined, noNotify?: boolean | undefined) => void; | ||
get: (key: string) => any; | ||
notify: (key: string) => void; | ||
set: (key: string, value: any) => void; | ||
setValues: (values?: object | null | undefined) => void; | ||
unbind: (key: string) => void; | ||
unbindAll: () => void; | ||
}[]; | ||
data: { | ||
add: (feature?: google.maps.Data.Feature | google.maps.Data.FeatureOptions | null | undefined) => google.maps.Data.Feature; | ||
addGeoJson: (geoJson: object, options?: google.maps.Data.GeoJsonOptions | null | undefined) => google.maps.Data.Feature[]; | ||
contains: (feature: google.maps.Data.Feature) => boolean; | ||
forEach: (callback: (a: google.maps.Data.Feature) => void) => void; | ||
getControlPosition: () => google.maps.ControlPosition; | ||
getControls: () => string[] | null; | ||
getDrawingMode: () => string | null; | ||
getFeatureById: (id: string | number) => google.maps.Data.Feature | undefined; | ||
getMap: () => google.maps.Map | null; | ||
getStyle: () => google.maps.Data.StylingFunction | google.maps.Data.StyleOptions | null; | ||
loadGeoJson: (url: string, options?: google.maps.Data.GeoJsonOptions | null | undefined, callback?: ((a: google.maps.Data.Feature[]) => void) | undefined) => void; | ||
overrideStyle: (feature: google.maps.Data.Feature, style: google.maps.Data.StyleOptions) => void; | ||
remove: (feature: google.maps.Data.Feature) => void; | ||
revertStyle: (feature?: google.maps.Data.Feature | null | undefined) => void; | ||
setControlPosition: (controlPosition: google.maps.ControlPosition) => void; | ||
setControls: (controls: string[] | null) => void; | ||
setDrawingMode: (drawingMode: string | null) => void; | ||
setMap: (map: google.maps.Map | null) => void; | ||
setStyle: (style: google.maps.Data.StylingFunction | google.maps.Data.StyleOptions | null) => void; | ||
toGeoJson: (callback: (a: object) => void) => void; | ||
addListener: (eventName: string, handler: Function) => google.maps.MapsEventListener; | ||
bindTo: (key: string, target: google.maps.MVCObject, targetKey?: string | null | undefined, noNotify?: boolean | undefined) => void; | ||
get: (key: string) => any; | ||
notify: (key: string) => void; | ||
set: (key: string, value: any) => void; | ||
setValues: (values?: object | null | undefined) => void; | ||
unbind: (key: string) => void; | ||
unbindAll: () => void; | ||
}; | ||
fitBounds: (bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding | undefined) => void; | ||
getBounds: () => google.maps.LatLngBounds | undefined; | ||
getCenter: () => google.maps.LatLng | undefined; | ||
getClickableIcons: () => boolean | undefined; | ||
getDiv: () => Element; | ||
getHeading: () => number | undefined; | ||
getMapTypeId: () => string | undefined; | ||
getProjection: () => google.maps.Projection | undefined; | ||
getRenderingType: () => google.maps.RenderingType; | ||
getStreetView: () => google.maps.StreetViewPanorama; | ||
getTilt: () => number | undefined; | ||
getZoom: () => number | undefined; | ||
mapTypes: { | ||
set: (id: string, mapType: any) => void; | ||
addListener: (eventName: string, handler: Function) => google.maps.MapsEventListener; | ||
bindTo: (key: string, target: google.maps.MVCObject, targetKey?: string | null | undefined, noNotify?: boolean | undefined) => void; | ||
get: (key: string) => any; | ||
notify: (key: string) => void; | ||
setValues: (values?: object | null | undefined) => void; | ||
unbind: (key: string) => void; | ||
unbindAll: () => void; | ||
}; | ||
moveCamera: (cameraOptions: google.maps.CameraOptions) => void; | ||
overlayMapTypes: { | ||
clear: () => void; | ||
forEach: (callback: (a: any, b: number) => void) => void; | ||
getArray: () => any[]; | ||
getAt: (i: number) => any; | ||
getLength: () => number; | ||
insertAt: (i: number, elem: any) => void; | ||
pop: () => any; | ||
push: (elem: any) => number; | ||
removeAt: (i: number) => any; | ||
setAt: (i: number, elem: any) => void; | ||
addListener: (eventName: string, handler: Function) => google.maps.MapsEventListener; | ||
bindTo: (key: string, target: google.maps.MVCObject, targetKey?: string | null | undefined, noNotify?: boolean | undefined) => void; | ||
get: (key: string) => any; | ||
notify: (key: string) => void; | ||
set: (key: string, value: any) => void; | ||
setValues: (values?: object | null | undefined) => void; | ||
unbind: (key: string) => void; | ||
unbindAll: () => void; | ||
}; | ||
panBy: (x: number, y: number) => void; | ||
panTo: (latLng: google.maps.LatLng | google.maps.LatLngLiteral) => void; | ||
panToBounds: (latLngBounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding | undefined) => void; | ||
setCenter: (latlng: google.maps.LatLng | google.maps.LatLngLiteral) => void; | ||
setClickableIcons: (value: boolean) => void; | ||
setHeading: (heading: number) => void; | ||
setMapTypeId: (mapTypeId: string) => void; | ||
setOptions: (options: google.maps.MapOptions | null) => void; | ||
setStreetView: (panorama: google.maps.StreetViewPanorama | null) => void; | ||
setTilt: (tilt: number) => void; | ||
setZoom: (zoom: number) => void; | ||
addListener: (eventName: string, handler: Function) => google.maps.MapsEventListener; | ||
bindTo: (key: string, target: google.maps.MVCObject, targetKey?: string | null | undefined, noNotify?: boolean | undefined) => void; | ||
get: (key: string) => any; | ||
notify: (key: string) => void; | ||
set: (key: string, value: any) => void; | ||
setValues: (values?: object | null | undefined) => void; | ||
unbind: (key: string) => void; | ||
unbindAll: () => void; | ||
} | null>; | ||
api: import("vue").Ref<{ | ||
Animation: { | ||
[x: number]: string; | ||
readonly BOUNCE: google.maps.Animation.BOUNCE; | ||
readonly DROP: google.maps.Animation.DROP; | ||
}; | ||
BicyclingLayer: typeof google.maps.BicyclingLayer; | ||
Circle: typeof google.maps.Circle; | ||
ControlPosition: { | ||
[x: number]: string; | ||
readonly BOTTOM_CENTER: google.maps.ControlPosition.BOTTOM_CENTER; | ||
readonly BOTTOM_LEFT: google.maps.ControlPosition.BOTTOM_LEFT; | ||
readonly BOTTOM_RIGHT: google.maps.ControlPosition.BOTTOM_RIGHT; | ||
readonly LEFT_BOTTOM: google.maps.ControlPosition.LEFT_BOTTOM; | ||
readonly LEFT_CENTER: google.maps.ControlPosition.LEFT_CENTER; | ||
readonly LEFT_TOP: google.maps.ControlPosition.LEFT_TOP; | ||
readonly RIGHT_BOTTOM: google.maps.ControlPosition.RIGHT_BOTTOM; | ||
readonly RIGHT_CENTER: google.maps.ControlPosition.RIGHT_CENTER; | ||
readonly RIGHT_TOP: google.maps.ControlPosition.RIGHT_TOP; | ||
readonly TOP_CENTER: google.maps.ControlPosition.TOP_CENTER; | ||
readonly TOP_LEFT: google.maps.ControlPosition.TOP_LEFT; | ||
readonly TOP_RIGHT: google.maps.ControlPosition.TOP_RIGHT; | ||
}; | ||
Data: typeof google.maps.Data; | ||
DirectionsRenderer: typeof google.maps.DirectionsRenderer; | ||
DirectionsService: typeof google.maps.DirectionsService; | ||
DirectionsStatus: { | ||
readonly INVALID_REQUEST: google.maps.DirectionsStatus.INVALID_REQUEST; | ||
readonly MAX_WAYPOINTS_EXCEEDED: google.maps.DirectionsStatus.MAX_WAYPOINTS_EXCEEDED; | ||
readonly NOT_FOUND: google.maps.DirectionsStatus.NOT_FOUND; | ||
readonly OK: google.maps.DirectionsStatus.OK; | ||
readonly OVER_QUERY_LIMIT: google.maps.DirectionsStatus.OVER_QUERY_LIMIT; | ||
readonly REQUEST_DENIED: google.maps.DirectionsStatus.REQUEST_DENIED; | ||
readonly UNKNOWN_ERROR: google.maps.DirectionsStatus.UNKNOWN_ERROR; | ||
readonly ZERO_RESULTS: google.maps.DirectionsStatus.ZERO_RESULTS; | ||
}; | ||
DistanceMatrixElementStatus: { | ||
readonly NOT_FOUND: google.maps.DistanceMatrixElementStatus.NOT_FOUND; | ||
readonly OK: google.maps.DistanceMatrixElementStatus.OK; | ||
readonly ZERO_RESULTS: google.maps.DistanceMatrixElementStatus.ZERO_RESULTS; | ||
}; | ||
DistanceMatrixService: typeof google.maps.DistanceMatrixService; | ||
DistanceMatrixStatus: { | ||
readonly INVALID_REQUEST: google.maps.DistanceMatrixStatus.INVALID_REQUEST; | ||
readonly MAX_DIMENSIONS_EXCEEDED: google.maps.DistanceMatrixStatus.MAX_DIMENSIONS_EXCEEDED; | ||
readonly MAX_ELEMENTS_EXCEEDED: google.maps.DistanceMatrixStatus.MAX_ELEMENTS_EXCEEDED; | ||
readonly OK: google.maps.DistanceMatrixStatus.OK; | ||
readonly OVER_QUERY_LIMIT: google.maps.DistanceMatrixStatus.OVER_QUERY_LIMIT; | ||
readonly REQUEST_DENIED: google.maps.DistanceMatrixStatus.REQUEST_DENIED; | ||
readonly UNKNOWN_ERROR: google.maps.DistanceMatrixStatus.UNKNOWN_ERROR; | ||
}; | ||
ElevationService: typeof google.maps.ElevationService; | ||
ElevationStatus: { | ||
readonly INVALID_REQUEST: google.maps.ElevationStatus.INVALID_REQUEST; | ||
readonly OK: google.maps.ElevationStatus.OK; | ||
readonly OVER_QUERY_LIMIT: google.maps.ElevationStatus.OVER_QUERY_LIMIT; | ||
readonly REQUEST_DENIED: google.maps.ElevationStatus.REQUEST_DENIED; | ||
readonly UNKNOWN_ERROR: google.maps.ElevationStatus.UNKNOWN_ERROR; | ||
}; | ||
Geocoder: typeof google.maps.Geocoder; | ||
GeocoderLocationType: { | ||
readonly APPROXIMATE: google.maps.GeocoderLocationType.APPROXIMATE; | ||
readonly GEOMETRIC_CENTER: google.maps.GeocoderLocationType.GEOMETRIC_CENTER; | ||
readonly RANGE_INTERPOLATED: google.maps.GeocoderLocationType.RANGE_INTERPOLATED; | ||
readonly ROOFTOP: google.maps.GeocoderLocationType.ROOFTOP; | ||
}; | ||
GeocoderStatus: { | ||
readonly ERROR: google.maps.GeocoderStatus.ERROR; | ||
readonly INVALID_REQUEST: google.maps.GeocoderStatus.INVALID_REQUEST; | ||
readonly OK: google.maps.GeocoderStatus.OK; | ||
readonly OVER_QUERY_LIMIT: google.maps.GeocoderStatus.OVER_QUERY_LIMIT; | ||
readonly REQUEST_DENIED: google.maps.GeocoderStatus.REQUEST_DENIED; | ||
readonly UNKNOWN_ERROR: google.maps.GeocoderStatus.UNKNOWN_ERROR; | ||
readonly ZERO_RESULTS: google.maps.GeocoderStatus.ZERO_RESULTS; | ||
}; | ||
GroundOverlay: typeof google.maps.GroundOverlay; | ||
ImageMapType: typeof google.maps.ImageMapType; | ||
InfoWindow: typeof google.maps.InfoWindow; | ||
KmlLayer: typeof google.maps.KmlLayer; | ||
KmlLayerStatus: { | ||
readonly DOCUMENT_NOT_FOUND: google.maps.KmlLayerStatus.DOCUMENT_NOT_FOUND; | ||
readonly DOCUMENT_TOO_LARGE: google.maps.KmlLayerStatus.DOCUMENT_TOO_LARGE; | ||
readonly FETCH_ERROR: google.maps.KmlLayerStatus.FETCH_ERROR; | ||
readonly INVALID_DOCUMENT: google.maps.KmlLayerStatus.INVALID_DOCUMENT; | ||
readonly INVALID_REQUEST: google.maps.KmlLayerStatus.INVALID_REQUEST; | ||
readonly LIMITS_EXCEEDED: google.maps.KmlLayerStatus.LIMITS_EXCEEDED; | ||
readonly OK: google.maps.KmlLayerStatus.OK; | ||
readonly TIMED_OUT: google.maps.KmlLayerStatus.TIMED_OUT; | ||
readonly UNKNOWN: google.maps.KmlLayerStatus.UNKNOWN; | ||
}; | ||
LatLng: typeof google.maps.LatLng; | ||
LatLngBounds: typeof google.maps.LatLngBounds; | ||
MVCArray: typeof google.maps.MVCArray; | ||
MVCObject: typeof google.maps.MVCObject; | ||
Map: typeof google.maps.Map; | ||
MapTypeControlStyle: { | ||
[x: number]: string; | ||
readonly DEFAULT: google.maps.MapTypeControlStyle.DEFAULT; | ||
readonly DROPDOWN_MENU: google.maps.MapTypeControlStyle.DROPDOWN_MENU; | ||
readonly HORIZONTAL_BAR: google.maps.MapTypeControlStyle.HORIZONTAL_BAR; | ||
}; | ||
MapTypeId: { | ||
readonly HYBRID: google.maps.MapTypeId.HYBRID; | ||
readonly ROADMAP: google.maps.MapTypeId.ROADMAP; | ||
readonly SATELLITE: google.maps.MapTypeId.SATELLITE; | ||
readonly TERRAIN: google.maps.MapTypeId.TERRAIN; | ||
}; | ||
MapTypeRegistry: typeof google.maps.MapTypeRegistry; | ||
Marker: typeof google.maps.Marker; | ||
MaxZoomService: typeof google.maps.MaxZoomService; | ||
MaxZoomStatus: { | ||
readonly ERROR: google.maps.MaxZoomStatus.ERROR; | ||
readonly OK: google.maps.MaxZoomStatus.OK; | ||
}; | ||
OverlayView: typeof google.maps.OverlayView; | ||
Point: typeof google.maps.Point; | ||
Polygon: typeof google.maps.Polygon; | ||
Polyline: typeof google.maps.Polyline; | ||
Rectangle: typeof google.maps.Rectangle; | ||
RenderingType: { | ||
readonly RASTER: google.maps.RenderingType.RASTER; | ||
readonly UNINITIALIZED: google.maps.RenderingType.UNINITIALIZED; | ||
readonly VECTOR: google.maps.RenderingType.VECTOR; | ||
}; | ||
ScaleControlStyle: { | ||
[x: number]: string; | ||
readonly DEFAULT: google.maps.ScaleControlStyle.DEFAULT; | ||
}; | ||
Size: typeof google.maps.Size; | ||
StreetViewCoverageLayer: typeof google.maps.StreetViewCoverageLayer; | ||
StreetViewPanorama: typeof google.maps.StreetViewPanorama; | ||
StreetViewPreference: { | ||
readonly BEST: google.maps.StreetViewPreference.BEST; | ||
readonly NEAREST: google.maps.StreetViewPreference.NEAREST; | ||
}; | ||
StreetViewService: typeof google.maps.StreetViewService; | ||
StreetViewSource: { | ||
readonly DEFAULT: google.maps.StreetViewSource.DEFAULT; | ||
readonly OUTDOOR: google.maps.StreetViewSource.OUTDOOR; | ||
}; | ||
StreetViewStatus: { | ||
readonly OK: google.maps.StreetViewStatus.OK; | ||
readonly UNKNOWN_ERROR: google.maps.StreetViewStatus.UNKNOWN_ERROR; | ||
readonly ZERO_RESULTS: google.maps.StreetViewStatus.ZERO_RESULTS; | ||
}; | ||
StrokePosition: { | ||
[x: number]: string; | ||
readonly CENTER: google.maps.StrokePosition.CENTER; | ||
readonly INSIDE: google.maps.StrokePosition.INSIDE; | ||
readonly OUTSIDE: google.maps.StrokePosition.OUTSIDE; | ||
}; | ||
StyledMapType: typeof google.maps.StyledMapType; | ||
SymbolPath: { | ||
[x: number]: string; | ||
readonly BACKWARD_CLOSED_ARROW: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW; | ||
readonly BACKWARD_OPEN_ARROW: google.maps.SymbolPath.BACKWARD_OPEN_ARROW; | ||
readonly CIRCLE: google.maps.SymbolPath.CIRCLE; | ||
readonly FORWARD_CLOSED_ARROW: google.maps.SymbolPath.FORWARD_CLOSED_ARROW; | ||
readonly FORWARD_OPEN_ARROW: google.maps.SymbolPath.FORWARD_OPEN_ARROW; | ||
}; | ||
TrafficLayer: typeof google.maps.TrafficLayer; | ||
TrafficModel: { | ||
readonly BEST_GUESS: google.maps.TrafficModel.BEST_GUESS; | ||
readonly OPTIMISTIC: google.maps.TrafficModel.OPTIMISTIC; | ||
readonly PESSIMISTIC: google.maps.TrafficModel.PESSIMISTIC; | ||
}; | ||
TransitLayer: typeof google.maps.TransitLayer; | ||
TransitMode: { | ||
readonly BUS: google.maps.TransitMode.BUS; | ||
readonly RAIL: google.maps.TransitMode.RAIL; | ||
readonly SUBWAY: google.maps.TransitMode.SUBWAY; | ||
readonly TRAIN: google.maps.TransitMode.TRAIN; | ||
readonly TRAM: google.maps.TransitMode.TRAM; | ||
}; | ||
TransitRoutePreference: { | ||
readonly FEWER_TRANSFERS: google.maps.TransitRoutePreference.FEWER_TRANSFERS; | ||
readonly LESS_WALKING: google.maps.TransitRoutePreference.LESS_WALKING; | ||
}; | ||
TravelMode: { | ||
readonly BICYCLING: google.maps.TravelMode.BICYCLING; | ||
readonly DRIVING: google.maps.TravelMode.DRIVING; | ||
readonly TRANSIT: google.maps.TravelMode.TRANSIT; | ||
readonly WALKING: google.maps.TravelMode.WALKING; | ||
}; | ||
UnitSystem: { | ||
[x: number]: string; | ||
readonly IMPERIAL: google.maps.UnitSystem.IMPERIAL; | ||
readonly METRIC: google.maps.UnitSystem.METRIC; | ||
}; | ||
VehicleType: { | ||
readonly BUS: google.maps.VehicleType.BUS; | ||
readonly CABLE_CAR: google.maps.VehicleType.CABLE_CAR; | ||
readonly COMMUTER_TRAIN: google.maps.VehicleType.COMMUTER_TRAIN; | ||
readonly FERRY: google.maps.VehicleType.FERRY; | ||
readonly FUNICULAR: google.maps.VehicleType.FUNICULAR; | ||
readonly GONDOLA_LIFT: google.maps.VehicleType.GONDOLA_LIFT; | ||
readonly HEAVY_RAIL: google.maps.VehicleType.HEAVY_RAIL; | ||
readonly HIGH_SPEED_TRAIN: google.maps.VehicleType.HIGH_SPEED_TRAIN; | ||
readonly INTERCITY_BUS: google.maps.VehicleType.INTERCITY_BUS; | ||
readonly METRO_RAIL: google.maps.VehicleType.METRO_RAIL; | ||
readonly MONORAIL: google.maps.VehicleType.MONORAIL; | ||
readonly OTHER: google.maps.VehicleType.OTHER; | ||
readonly RAIL: google.maps.VehicleType.RAIL; | ||
readonly SHARE_TAXI: google.maps.VehicleType.SHARE_TAXI; | ||
readonly SUBWAY: google.maps.VehicleType.SUBWAY; | ||
readonly TRAM: google.maps.VehicleType.TRAM; | ||
readonly TROLLEYBUS: google.maps.VehicleType.TROLLEYBUS; | ||
}; | ||
WebglOverlayView: typeof google.maps.WebglOverlayView; | ||
drawing: { | ||
DrawingManager: typeof google.maps.drawing.DrawingManager; | ||
OverlayType: { | ||
readonly CIRCLE: google.maps.drawing.OverlayType.CIRCLE; | ||
readonly MARKER: google.maps.drawing.OverlayType.MARKER; | ||
readonly POLYGON: google.maps.drawing.OverlayType.POLYGON; | ||
readonly POLYLINE: google.maps.drawing.OverlayType.POLYLINE; | ||
readonly RECTANGLE: google.maps.drawing.OverlayType.RECTANGLE; | ||
}; | ||
}; | ||
event: { | ||
addDomListener: typeof google.maps.event.addDomListener; | ||
addDomListenerOnce: typeof google.maps.event.addDomListenerOnce; | ||
addListener: typeof google.maps.event.addListener; | ||
addListenerOnce: typeof google.maps.event.addListenerOnce; | ||
clearInstanceListeners: typeof google.maps.event.clearInstanceListeners; | ||
clearListeners: typeof google.maps.event.clearListeners; | ||
removeListener: typeof google.maps.event.removeListener; | ||
trigger: typeof google.maps.event.trigger; | ||
}; | ||
geometry: { | ||
encoding: { | ||
decodePath: typeof google.maps.geometry.encoding.decodePath; | ||
encodePath: typeof google.maps.geometry.encoding.encodePath; | ||
}; | ||
poly: { | ||
containsLocation: typeof google.maps.geometry.poly.containsLocation; | ||
isLocationOnEdge: typeof google.maps.geometry.poly.isLocationOnEdge; | ||
}; | ||
spherical: { | ||
computeArea: typeof google.maps.geometry.spherical.computeArea; | ||
computeDistanceBetween: typeof google.maps.geometry.spherical.computeDistanceBetween; | ||
computeHeading: typeof google.maps.geometry.spherical.computeHeading; | ||
computeLength: typeof google.maps.geometry.spherical.computeLength; | ||
computeOffset: typeof google.maps.geometry.spherical.computeOffset; | ||
computeOffsetOrigin: typeof google.maps.geometry.spherical.computeOffsetOrigin; | ||
computeSignedArea: typeof google.maps.geometry.spherical.computeSignedArea; | ||
interpolate: typeof google.maps.geometry.spherical.interpolate; | ||
}; | ||
}; | ||
localContext: { | ||
LocalContextMapView: typeof google.maps.localContext.LocalContextMapView; | ||
MapDirectionsOptions: typeof google.maps.localContext.MapDirectionsOptions; | ||
PlaceChooserLayoutMode: { | ||
readonly HIDDEN: google.maps.localContext.PlaceChooserLayoutMode.HIDDEN; | ||
readonly SHEET: google.maps.localContext.PlaceChooserLayoutMode.SHEET; | ||
}; | ||
PlaceChooserPosition: { | ||
readonly BLOCK_END: google.maps.localContext.PlaceChooserPosition.BLOCK_END; | ||
readonly INLINE_END: google.maps.localContext.PlaceChooserPosition.INLINE_END; | ||
readonly INLINE_START: google.maps.localContext.PlaceChooserPosition.INLINE_START; | ||
}; | ||
PlaceDetailsLayoutMode: { | ||
readonly INFO_WINDOW: google.maps.localContext.PlaceDetailsLayoutMode.INFO_WINDOW; | ||
readonly SHEET: google.maps.localContext.PlaceDetailsLayoutMode.SHEET; | ||
}; | ||
PlaceDetailsPosition: { | ||
readonly INLINE_END: google.maps.localContext.PlaceDetailsPosition.INLINE_END; | ||
readonly INLINE_START: google.maps.localContext.PlaceDetailsPosition.INLINE_START; | ||
}; | ||
}; | ||
places: { | ||
Autocomplete: typeof google.maps.places.Autocomplete; | ||
AutocompleteResponse: typeof google.maps.places.AutocompleteResponse; | ||
AutocompleteService: typeof google.maps.places.AutocompleteService; | ||
AutocompleteSessionToken: typeof google.maps.places.AutocompleteSessionToken; | ||
BusinessStatus: { | ||
readonly CLOSED_PERMANENTLY: google.maps.places.BusinessStatus.CLOSED_PERMANENTLY; | ||
readonly CLOSED_TEMPORARILY: google.maps.places.BusinessStatus.CLOSED_TEMPORARILY; | ||
readonly OPERATIONAL: google.maps.places.BusinessStatus.OPERATIONAL; | ||
}; | ||
PlacesService: typeof google.maps.places.PlacesService; | ||
PlacesServiceStatus: { | ||
readonly INVALID_REQUEST: google.maps.places.PlacesServiceStatus.INVALID_REQUEST; | ||
readonly NOT_FOUND: google.maps.places.PlacesServiceStatus.NOT_FOUND; | ||
readonly OK: google.maps.places.PlacesServiceStatus.OK; | ||
readonly OVER_QUERY_LIMIT: google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT; | ||
readonly REQUEST_DENIED: google.maps.places.PlacesServiceStatus.REQUEST_DENIED; | ||
readonly UNKNOWN_ERROR: google.maps.places.PlacesServiceStatus.UNKNOWN_ERROR; | ||
readonly ZERO_RESULTS: google.maps.places.PlacesServiceStatus.ZERO_RESULTS; | ||
}; | ||
RankBy: { | ||
[x: number]: string; | ||
readonly DISTANCE: google.maps.places.RankBy.DISTANCE; | ||
readonly PROMINENCE: google.maps.places.RankBy.PROMINENCE; | ||
}; | ||
SearchBox: typeof google.maps.places.SearchBox; | ||
}; | ||
version: string; | ||
visualization: { | ||
HeatmapLayer: typeof google.maps.visualization.HeatmapLayer; | ||
}; | ||
} | null>; | ||
map: import("vue").Ref<google.maps.Map | undefined>; | ||
api: import("vue").Ref<typeof google.maps | undefined>; | ||
mapTilesLoaded: import("vue").Ref<boolean>; | ||
@@ -638,2 +228,3 @@ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
mapTypeId?: string | undefined; | ||
mapId?: string | undefined; | ||
maxZoom?: number | undefined; | ||
@@ -640,0 +231,0 @@ minZoom?: number | undefined; |
@@ -10,1 +10,2 @@ export { default as GoogleMap } from "./GoogleMap.vue"; | ||
export { default as MarkerCluster } from "./MarkerCluster"; | ||
export { default as CustomMarker } from "./CustomMarker.vue"; |
@@ -12,3 +12,2 @@ /// <reference types="google.maps" /> | ||
hasSlotContent: import("vue").ComputedRef<boolean | undefined>; | ||
anchor: import("vue").Ref<google.maps.Marker | undefined>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -15,0 +14,0 @@ options: google.maps.InfoWindowOptions; |
import { PropType } from "vue"; | ||
import { MarkerClustererOptions } from "@googlemaps/markerclusterer"; | ||
import { MarkerClustererOptions, MarkerClustererEvents } from "@googlemaps/markerclusterer"; | ||
declare const _default: import("vue").DefineComponent<{ | ||
@@ -10,3 +10,3 @@ options: { | ||
[key: string]: any; | ||
}>[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
}>[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, MarkerClustererEvents[], MarkerClustererEvents, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
options: MarkerClustererOptions; | ||
@@ -13,0 +13,0 @@ } & {}>, { |
@@ -9,3 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
polygon: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
polygon: import("vue").Ref<google.maps.Polygon | undefined>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -12,0 +12,0 @@ options: google.maps.PolygonOptions; |
@@ -9,3 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
polyline: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
polyline: import("vue").Ref<google.maps.Polyline | undefined>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -12,0 +12,0 @@ options: google.maps.PolylineOptions; |
@@ -9,3 +9,3 @@ /// <reference types="google.maps" /> | ||
}, { | ||
rectangle: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>; | ||
rectangle: import("vue").Ref<google.maps.Rectangle | undefined>; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -12,0 +12,0 @@ options: google.maps.RectangleOptions; |
/// <reference types="google.maps" /> | ||
import { Ref } from "vue"; | ||
export declare type IComponent = google.maps.Marker | google.maps.Polyline | google.maps.Polygon | google.maps.Rectangle | google.maps.Circle; | ||
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) => Ref<IComponent | null>; | ||
import { customMarkerClassSymbol } from "../shared/index"; | ||
declare type ICtorKey = "Marker" | "Polyline" | "Polygon" | "Rectangle" | "Circle" | typeof customMarkerClassSymbol; | ||
declare type IComponent<T> = T extends "Marker" ? google.maps.Marker : T extends "Polyline" ? google.maps.Polyline : T extends "Polygon" ? google.maps.Polygon : T extends "Rectangle" ? google.maps.Rectangle : T extends "Circle" ? google.maps.Circle : T extends typeof customMarkerClassSymbol ? InstanceType<typeof google.maps.CustomMarker> : never; | ||
declare type IComponentOptions<T> = T extends "Marker" ? google.maps.MarkerOptions : T extends "Polyline" ? google.maps.PolylineOptions : T extends "Polygon" ? google.maps.PolygonOptions : T extends "Rectangle" ? google.maps.RectangleOptions : T extends "Circle" ? google.maps.CircleOptions : T extends typeof customMarkerClassSymbol ? google.maps.CustomMarkerOptions & { | ||
element?: HTMLElement; | ||
} : never; | ||
export declare const useSetupMapComponent: <T extends ICtorKey>(ctorKey: T, events: string[], options: Ref<IComponentOptions<T>>, emit: (event: string, ...args: unknown[]) => void) => Ref<IComponent<T> | undefined>; | ||
export {}; |
@@ -0,2 +1,3 @@ | ||
export * from "./shims-google-maps-d"; | ||
export * from "./@types/index"; | ||
export * from "./components/index"; |
@@ -8,2 +8,3 @@ /// <reference types="google.maps" /> | ||
export declare const markerClusterSymbol: InjectionKey<Ref<MarkerClusterer>>; | ||
export declare const customMarkerClassSymbol: "CustomMarker"; | ||
/** | ||
@@ -10,0 +11,0 @@ * Utilitary flag for components that need to know the map |
{ | ||
"name": "vue3-google-map", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"license": "MIT", | ||
@@ -90,3 +90,3 @@ "repository": { | ||
"ttypescript": "^1.5.12", | ||
"typescript": "~4.3.2", | ||
"typescript": "^4.6.4", | ||
"typescript-transform-paths": "^2.2.4", | ||
@@ -93,0 +93,0 @@ "vite": "^2.3.4", |
134
README.md
@@ -7,2 +7,4 @@ # vue3-google-map | ||
Note: Please refer to the [documentation site](https://vue3-google-map.netlify.app/) for rendered examples. | ||
## Table of Contents | ||
@@ -20,3 +22,5 @@ | ||
- [Info Window](#info-window) | ||
- [Custom Controls](#custom-controls) | ||
- [Custom Marker](#custom-marker) | ||
- [Custom Control](#custom-control) | ||
- [Marker Cluster](#marker-cluster) | ||
- [Advanced Usage](#advanced-usage) | ||
@@ -49,3 +53,3 @@ - [Contribution](#contribution) | ||
To construct a map using `vue3-google-map` you'll need to use the base `GoogleMap` component which receives your [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key), styles (e.g. setting width and height), and any [MapOptions](https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions) to configure your map ([see this](https://github.com/inocan-group/vue3-google-map/blob/develop/src/components/GoogleMap.vue#L30-L209) for all the supported `MapOptions`). | ||
Other map features can be added to your map by passing map subcomponents ([Marker](#marker), [Polyline](#polyline), [Polygon](#polygon), [Rectangle](#rectangle), [Circle](#circle), [InfoWindow](#info-window), or [CustomControl](#custom-controls)) to the default slot of the `GoogleMap` component. | ||
Other map features can be added to your map by passing map subcomponents ([Marker](#marker), [Polyline](#polyline), [Polygon](#polygon), [Rectangle](#rectangle), [Circle](#circle), [InfoWindow](#info-window), [CustomMarker](#custom-marker), [CustomControl](#custom-control), or [MarkerCluster](#marker-cluster)) to the default slot of the `GoogleMap` component. | ||
@@ -86,3 +90,5 @@ ```vue | ||
- [InfoWindow](#info-window) | ||
- [CustomControl](#custom-controls) | ||
- [CustomMarker](#custom-marker) | ||
- [CustomControl](#custom-control) | ||
- [MarkerCluster](#marker-cluster) | ||
@@ -429,4 +435,51 @@ ### Marker | ||
### Custom Controls | ||
### Custom Marker | ||
Regular markers can be customized a great deal but if you need to you can use the `CustomMarker` component and provide your own custom markup through it's `default` slot. | ||
#### Options | ||
| Parameter | Type | Description | | ||
| :-------- | :------- | :------------------------- | | ||
| `position` | `{ lat: number, lng: number}` | Sets the marker position. | | ||
| `anchorPoint` | `'CENTER' \| 'TOP_CENTER' \|'BOTTOM_CENTER' \| 'LEFT_CENTER' \| 'RIGHT_CENTER' \| 'TOP_LEFT' \| 'TOP_RIGHT' \| 'BOTTOM_LEFT' \| 'BOTTOM_RIGHT'` | Sets how the marker is anchored relative to it's `position` point. Default is `CENTER`. | | ||
| `offsetX` | `number` | Horizontal offset from the `position` point. | | ||
| `offsetY` | `number` | Vertical offset from the `position` point. | | ||
| `zIndex` | `number` | `z-index` value of the marker. | | ||
```vue | ||
<template> | ||
<GoogleMap | ||
api-key="YOUR_GOOGLE_MAPS_API_KEY" | ||
style="width: 100%; height: 500px" | ||
:center="center" | ||
:zoom="15" | ||
> | ||
<CustomMarker :options="{ position: center, anchorPoint: 'BOTTOM_CENTER' }"> | ||
<div style="text-align: center"> | ||
<div style="font-size: 1.125rem">Vuejs Amsterdam</div> | ||
<img src="https://vuejs.org/images/logo.png" width="50" height="50" style="margin-top: 8px" /> | ||
</div> | ||
</CustomMarker> | ||
</GoogleMap> | ||
</template> | ||
<script> | ||
import { defineComponent } from 'vue' | ||
import { GoogleMap, CustomMarker } from 'vue3-google-map' | ||
export default defineComponent({ | ||
components: { GoogleMap, CustomMarker }, | ||
setup() { | ||
const center = { lat: 52.36834, lng: 4.88635 } | ||
return { center } | ||
}, | ||
}) | ||
</script> | ||
``` | ||
### Custom Control | ||
Use the `CustomControl` component to add custom buttons/controls to your map. | ||
@@ -488,2 +541,74 @@ | ||
### Marker Cluster | ||
Use the `MarkerCluster` component to display a large number of markers on a map. It will combine markers of close proximity into clusters, and simplify the display of markers on the map. Can be used with the `Marker` or `CustomMarker` components. | ||
## Usage | ||
Simply pass your `Marker`/`CustomMarker`(s) in the `default` slot of the `MarkerCluster` component. | ||
```vue | ||
<template> | ||
<GoogleMap | ||
api-key="YOUR_GOOGLE_MAPS_API_KEY" | ||
style="width: 100%; height: 500px" | ||
:center="center" | ||
:zoom="3" | ||
> | ||
<MarkerCluster> | ||
<Marker v-for="(location, i) in locations" :options="{ position: location }" :key="i" /> | ||
</MarkerCluster> | ||
</GoogleMap> | ||
</template> | ||
<script> | ||
import { defineComponent } from 'vue' | ||
import { GoogleMap, Marker, MarkerCluster } from 'vue3-google-map' | ||
export default defineComponent({ | ||
components: { GoogleMap, Marker, MarkerCluster }, | ||
setup() { | ||
const center = { lat: -28.024, lng: 140.887 } | ||
const locations = [ | ||
{ lat: -31.56391, lng: 147.154312 }, | ||
{ lat: -33.718234, lng: 150.363181 }, | ||
{ lat: -33.727111, lng: 150.371124 }, | ||
{ lat: -33.848588, lng: 151.209834 }, | ||
{ lat: -33.851702, lng: 151.216968 }, | ||
{ lat: -34.671264, lng: 150.863657 }, | ||
{ lat: -35.304724, lng: 148.662905 }, | ||
{ lat: -36.817685, lng: 175.699196 }, | ||
{ lat: -36.828611, lng: 175.790222 }, | ||
{ lat: -37.75, lng: 145.116667 }, | ||
{ lat: -37.759859, lng: 145.128708 }, | ||
{ lat: -37.765015, lng: 145.133858 }, | ||
{ lat: -37.770104, lng: 145.143299 }, | ||
{ lat: -37.7737, lng: 145.145187 }, | ||
{ lat: -37.774785, lng: 145.137978 }, | ||
{ lat: -37.819616, lng: 144.968119 }, | ||
{ lat: -38.330766, lng: 144.695692 }, | ||
{ lat: -39.927193, lng: 175.053218 }, | ||
{ lat: -41.330162, lng: 174.865694 }, | ||
{ lat: -42.734358, lng: 147.439506 }, | ||
{ lat: -42.734358, lng: 147.501315 }, | ||
{ lat: -42.735258, lng: 147.438 }, | ||
{ lat: -43.999792, lng: 170.463352 }, | ||
] | ||
return { center, locations } | ||
}, | ||
}) | ||
</script> | ||
``` | ||
#### Options | ||
`MarkerCluster` accepts an `options` prop (an object) where you can configure `algorithm`, `onClusterClick`, and `renderer` from the [MarkerClustererOptions](https://googlemaps.github.io/js-markerclusterer/interfaces/MarkerClustererOptions.html) interface. Note that all these options are completely optional but non-reactive. | ||
#### Events | ||
You can listen for [the following events](https://googlemaps.github.io/js-markerclusterer/enums/MarkerClustererEvents.html) on the `MarkerCluster` component. | ||
## Advanced Usage | ||
@@ -621,2 +746,3 @@ | ||
- `InfoWindow` exposes `infoWindow` (an [InfoWindow](https://developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow) class instance). | ||
- `MarkerCluster` exposes `markerCluster` (a [MarkerClusterer](https://googlemaps.github.io/js-markerclusterer/classes/MarkerClusterer.html) class instance). | ||
@@ -623,0 +749,0 @@ ## Contribution |
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
32
749
126267
906