vue3-google-map 0.22.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -9
- package/dist/index.cjs +3 -29
- package/dist/index.mjs +1071 -789
- package/dist/index.umd.js +6 -29
- package/dist/types/@types/index.d.ts +0 -1
- package/dist/types/components/AdvancedMarker.vue.d.ts +12 -9
- package/dist/types/components/Circle.d.ts +7 -7
- package/dist/types/components/CustomControl.vue.d.ts +10 -9
- package/dist/types/components/CustomMarker.vue.d.ts +9 -7
- package/dist/types/components/GoogleMap.vue.d.ts +34 -33
- package/dist/types/components/HeatmapLayer.d.ts +11 -7
- package/dist/types/components/InfoWindow.vue.d.ts +9 -9
- package/dist/types/components/Marker.d.ts +16 -7
- package/dist/types/components/MarkerCluster.d.ts +13 -8
- package/dist/types/components/Polygon.d.ts +6 -7
- package/dist/types/components/Polyline.d.ts +6 -7
- package/dist/types/components/Rectangle.d.ts +7 -7
- package/dist/types/composables/useSetupMapComponent.d.ts +0 -1
- package/dist/types/shared/index.d.ts +0 -1
- package/dist/types/shims-google-maps.d.ts +0 -1
- package/dist/types/themes/aubergine.d.ts +0 -1
- package/dist/types/themes/dark.d.ts +0 -1
- package/dist/types/themes/grey.d.ts +0 -1
- package/dist/types/themes/minimal.d.ts +0 -1
- package/dist/types/themes/retro.d.ts +0 -1
- package/dist/types/themes/roadways.d.ts +0 -1
- package/dist/types/themes/roadwaysMinimal.d.ts +0 -1
- package/dist/types/themes/ultraLight.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -1
- package/package.json +17 -6
package/dist/index.umd.js
CHANGED
|
@@ -1,33 +1,10 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-
|
|
2
|
-
(function(w,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(w=typeof globalThis<"u"?globalThis:w||self,i(w.Vue3GoogleMap={},w.Vue))})(this,function(w,i){"use strict";var _t=Object.defineProperty;var Ct=(w,i,P)=>i in w?_t(w,i,{enumerable:!0,configurable:!0,writable:!0,value:P}):w[i]=P;var re=(w,i,P)=>(Ct(w,typeof i!="symbol"?i+"":i,P),P);const P=Symbol("map"),x=Symbol("api"),H=Symbol("marker"),W=Symbol("markerCluster"),F=Symbol("CustomMarker"),oe=Symbol("mapTilesLoaded"),$=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];/*! *****************************************************************************
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function Ee(o,e,t,n){function r(s){return s instanceof t?s:new t(function(l){l(s)})}return new(t||(t=Promise))(function(s,l){function c(d){try{h(n.next(d))}catch(u){l(u)}}function a(d){try{h(n.throw(d))}catch(u){l(u)}}function h(d){d.done?s(d.value):r(d.value).then(c,a)}h((n=n.apply(o,e||[])).next())})}var Pe=function o(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!o(e[r],t[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){var l=s[r];if(!o(e[l],t[l]))return!1}return!0}return e!==e&&t!==t};const se="__googleMapsScriptId";var j;(function(o){o[o.INITIALIZED=0]="INITIALIZED",o[o.LOADING=1]="LOADING",o[o.SUCCESS=2]="SUCCESS",o[o.FAILURE=3]="FAILURE"})(j||(j={}));class T{constructor({apiKey:e,authReferrerPolicy:t,channel:n,client:r,id:s=se,language:l,libraries:c=[],mapIds:a,nonce:h,region:d,retries:u=3,url:p="https://maps.googleapis.com/maps/api/js",version:f}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=n,this.client=r,this.id=s||se,this.language=l,this.libraries=c,this.mapIds=a,this.nonce=h,this.region=d,this.retries=u,this.url=p,this.version=f,T.instance){if(!Pe(this.options,T.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(T.instance.options)}`);return T.instance}T.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?j.FAILURE:this.done?j.SUCCESS:this.loading?j.LOADING:j.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(n=>{n?t(n.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const n={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(n).forEach(s=>!n[s]&&delete n[s]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(s=>{let l,c,a,h="The Google Maps JavaScript API",d="google",u="importLibrary",p="__ib__",f=document,m=window;m=m[d]||(m[d]={});const g=m.maps||(m.maps={}),y=new Set,v=new URLSearchParams,k=()=>l||(l=new Promise((_,E)=>Ee(this,void 0,void 0,function*(){var M;yield c=f.createElement("script"),c.id=this.id,v.set("libraries",[...y]+"");for(a in s)v.set(a.replace(/[A-Z]/g,O=>"_"+O[0].toLowerCase()),s[a]);v.set("callback",d+".maps."+p),c.src=this.url+"?"+v,g[p]=_,c.onerror=()=>l=E(Error(h+" could not load.")),c.nonce=this.nonce||((M=f.querySelector("script[nonce]"))===null||M===void 0?void 0:M.nonce)||"",f.head.append(c)})));g[u]?console.warn(h+" only loads once. Ignoring:",s):g[u]=(_,...E)=>y.add(_)&&k().then(()=>g[u](_,...E))})(n);const r=this.libraries.map(s=>this.importLibrary(s));r.length||r.push(this.importLibrary("core")),Promise.all(r).then(()=>this.callback(),s=>{const l=new ErrorEvent("error",{error:s});this.loadErrorCallback(l)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(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();return}this.loading||(this.loading=!0,this.setScript())}}}function Oe(o){return class extends o.OverlayView{constructor(n){super();re(this,"element");re(this,"opts");const{element:r,...s}=n;this.element=r,this.opts=s,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof o.LatLng?this.opts.position:new o.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const n=this.element;return n.style.display!=="none"&&n.style.visibility!=="hidden"&&(n.style.opacity===""||Number(n.style.opacity)>.01)}onAdd(){if(!this.element)return;const n=this.getPanes();n&&n.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const n=this.getProjection(),r=n==null?void 0:n.fromLatLngToDivPixel(this.getPosition());if(r){this.element.style.position="absolute";let s,l;switch(this.opts.anchorPoint){case"TOP_CENTER":s="-50%",l="-100%";break;case"BOTTOM_CENTER":s="-50%",l="0";break;case"LEFT_CENTER":s="-100%",l="-50%";break;case"RIGHT_CENTER":s="0",l="-50%";break;case"TOP_LEFT":s="-100%",l="-100%";break;case"TOP_RIGHT":s="0",l="-100%";break;case"BOTTOM_LEFT":s="-100%",l="0";break;case"BOTTOM_RIGHT":s="0",l="0";break;default:s="-50%",l="-50%"}const c=r.x+(this.opts.offsetX||0)+"px",a=r.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${s}) translateX(${c}) translateY(${l}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(n){const{element:r,...s}=n;this.element=r,this.opts=s,this.draw()}}}let ie;const ae=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],Se=i.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},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},colorScheme:{type:String,required:!1},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},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},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},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},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:ae,setup(o,{emit:e}){const t=i.ref(),n=i.ref(!1),r=i.ref(),s=i.ref(),l=i.ref(!1);i.provide(P,r),i.provide(x,s),i.provide(oe,l);const c=()=>{const u={...o};Object.keys(u).forEach(g=>{u[g]===void 0&&delete u[g]});const f=g=>{var y;return g?{position:(y=s.value)==null?void 0:y.ControlPosition[g]}:{}},m={scaleControlOptions:o.scaleControlStyle?{style:o.scaleControlStyle}:{},panControlOptions:f(o.panControlPosition),zoomControlOptions:f(o.zoomControlPosition),rotateControlOptions:f(o.rotateControlPosition),streetViewControlOptions:f(o.streetViewControlPosition),fullscreenControlOptions:f(o.fullscreenControlPosition),cameraControlOptions:f(o.cameraControlPosition),disableDefaultUI:o.disableDefaultUi};return{...u,...m}},a=i.watch([s,r],([u,p])=>{const f=u,m=p;f&&m&&(f.event.addListenerOnce(m,"tilesloaded",()=>{l.value=!0}),setTimeout(a,0))},{immediate:!0}),h=()=>{try{const{apiKey:u,region:p,version:f,language:m,libraries:g,nonce:y}=o;ie=new T({apiKey:u,region:p,version:f,language:m,libraries:g,nonce:y})}catch(u){console.error(u)}},d=u=>{s.value=i.markRaw(u.maps),r.value=i.markRaw(new u.maps.Map(t.value,c()));const p=Oe(s.value);s.value[F]=p,ae.forEach(m=>{var g;(g=r.value)==null||g.addListener(m,y=>e(m,y))}),n.value=!0;const f=Object.keys(o).filter(m=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(m)).map(m=>i.toRef(o,m));i.watch([()=>o.center,()=>o.zoom,...f],([m,g],[y,v])=>{var O,b,L;const{center:k,zoom:_,...E}=c();(O=r.value)==null||O.setOptions(E),g!==void 0&&g!==v&&((b=r.value)==null||b.setZoom(g));const M=!y||m.lng!==y.lng||m.lat!==y.lat;m&&M&&((L=r.value)==null||L.panTo(m))})};return i.onMounted(()=>{o.apiPromise&&o.apiPromise instanceof Promise?o.apiPromise.then(d):(h(),ie.load().then(d))}),i.onBeforeUnmount(()=>{var u;l.value=!1,r.value&&((u=s.value)==null||u.event.clearInstanceListeners(r.value))}),{mapRef:t,ready:n,map:r,api:s,mapTilesLoaded:l}}}),Mt="",N=(o,e)=>{const t=o.__vccOpts||o;for(const[n,r]of e)t[n]=r;return t},Le={ref:"mapRef",class:"mapdiv"};function Ae(o,e,t,n,r,s){return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Le,null,512),i.renderSlot(o.$slots,"default",i.normalizeProps(i.guardReactiveProps({ready:o.ready,map:o.map,api:o.api,mapTilesLoaded:o.mapTilesLoaded})),void 0,!0)])}const Ie=N(Se,[["render",Ae],["__scopeId","data-v-7e597c12"]]);function xe(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Te=function o(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!o(e[r],t[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){var l=s[r];if(!o(e[l],t[l]))return!1}return!0}return e!==e&&t!==t};const S=xe(Te),le=["click","drag","dragend","dragstart","gmp-click"],Re=i.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:le,setup(o,{emit:e,expose:t,slots:n}){const r=i.ref(),s=i.computed(()=>{var f;return(f=n.default)==null?void 0:f.call(n).some(m=>m.type!==i.Comment)}),l=i.toRef(o,"options"),c=i.toRef(o,"pinOptions"),a=i.ref(),h=i.inject(P,i.ref()),d=i.inject(x,i.ref()),u=i.inject(W,i.ref()),p=i.computed(()=>!!(u.value&&d.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return i.watch([h,l,c],async(f,[m,g,y])=>{var M,O,b;const k=!S(l.value,g)||!S(c.value,y)||h.value!==m;if(!h.value||!d.value||!k)return;const{AdvancedMarkerElement:_,PinElement:E}=d.value.marker;if(a.value){const{map:L,content:G,...ne}=l.value;Object.assign(a.value,{content:s.value?r.value:c.value?new E(c.value).element:G,...ne}),p.value&&((M=u.value)==null||M.removeMarker(a.value),(O=u.value)==null||O.addMarker(a.value))}else s.value?l.value.content=r.value:c.value&&(l.value.content=new E(c.value).element),a.value=i.markRaw(new _(l.value)),p.value?(b=u.value)==null||b.addMarker(a.value):a.value.map=h.value,le.forEach(L=>{var G;(G=a.value)==null||G.addListener(L,ne=>e(L,ne))})},{immediate:!0}),i.onBeforeUnmount(()=>{var f,m;a.value&&((f=d.value)==null||f.event.clearInstanceListeners(a.value),p.value?(m=u.value)==null||m.removeMarker(a.value):a.value.map=null)}),i.provide(H,a),t({marker:a}),{hasSlotContent:s,markerRef:r}}}),bt="",$e={key:0,class:"advanced-marker-wrapper"};function je(o,e,t,n,r,s){return o.hasSlotContent?(i.openBlock(),i.createElementBlock("div",$e,[i.createElementVNode("div",i.mergeProps({ref:"markerRef"},o.$attrs),[i.renderSlot(o.$slots,"default")],16)])):i.createCommentVNode("",!0)}const Be=N(Re,[["render",je]]),qe=o=>o==="Marker",Ne=o=>o===F,B=(o,e,t,n)=>{const r=i.ref(),s=i.inject(P,i.ref()),l=i.inject(x,i.ref()),c=i.inject(W,i.ref()),a=i.computed(()=>!!(c.value&&l.value&&(r.value instanceof l.value.Marker||r.value instanceof l.value[F])));return i.watch([s,t],(h,[d,u])=>{var f,m,g;const p=!S(t.value,u)||s.value!==d;!s.value||!l.value||!p||(r.value?(r.value.setOptions(t.value),a.value&&((f=c.value)==null||f.removeMarker(r.value),(m=c.value)==null||m.addMarker(r.value))):(qe(o)?r.value=i.markRaw(new l.value[o](t.value)):Ne(o)?r.value=i.markRaw(new l.value[o](t.value)):r.value=i.markRaw(new l.value[o]({...t.value,map:s.value})),a.value?(g=c.value)==null||g.addMarker(r.value):r.value.setMap(s.value),e.forEach(y=>{var v;(v=r.value)==null||v.addListener(y,k=>n(y,k))})))},{immediate:!0}),i.onBeforeUnmount(()=>{var h,d;r.value&&((h=l.value)==null||h.event.clearInstanceListeners(r.value),a.value?(d=c.value)==null||d.removeMarker(r.value):r.value.setMap(null))}),r},ce=["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"],Ze=i.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:ce,setup(o,{emit:e,expose:t,slots:n}){const r=i.toRef(o,"options"),s=B("Marker",ce,r,e);return i.provide(H,s),t({marker:s}),()=>{var l;return(l=n.default)==null?void 0:l.call(n)}}}),Ue=i.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:$,setup(o,{emit:e}){const t=i.toRef(o,"options");return{polyline:B("Polyline",$,t,e)}},render:()=>null}),De=i.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:$,setup(o,{emit:e}){const t=i.toRef(o,"options");return{polygon:B("Polygon",$,t,e)}},render:()=>null}),ue=$.concat(["bounds_changed"]),Fe=i.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:ue,setup(o,{emit:e}){const t=i.toRef(o,"options");return{rectangle:B("Rectangle",ue,t,e)}},render:()=>null}),de=$.concat(["center_changed","radius_changed"]),Ve=i.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:de,setup(o,{emit:e}){const t=i.toRef(o,"options");return{circle:B("Circle",de,t,e)}},render:()=>null}),ze=i.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(o,{emit:e}){const t=i.ref(null),n=i.inject(P,i.ref()),r=i.inject(x,i.ref()),s=i.inject(oe,i.ref(!1)),l=i.watch([s,r,t],([h,d,u])=>{d&&h&&u&&(c(o.position),e("content:loaded"),setTimeout(l,0))},{immediate:!0}),c=h=>{if(n.value&&r.value&&t.value){const d=r.value.ControlPosition[h];n.value.controls[d].push(t.value)}},a=h=>{if(n.value&&r.value){let d=null;const u=r.value.ControlPosition[h];n.value.controls[u].forEach((p,f)=>{p===t.value&&(d=f)}),d!==null&&n.value.controls[u].removeAt(d)}};return i.onBeforeUnmount(()=>a(o.position)),i.watch(()=>o.position,(h,d)=>{a(d),c(h)}),i.watch(()=>o.index,h=>{h&&t.value&&(t.value.index=o.index)}),{controlRef:t}}}),Et="",Ge={ref:"controlRef",class:"custom-control-wrapper"};function He(o,e,t,n,r,s){return i.openBlock(),i.createElementBlock("div",Ge,[i.renderSlot(o.$slots,"default",{},void 0,!0)],512)}const We=N(ze,[["render",He],["__scopeId","data-v-268ef28d"]]),he=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],Ke=i.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...he,"update:modelValue"],setup(o,{slots:e,emit:t,expose:n}){const r=i.ref(),s=i.ref(),l=i.inject(P,i.ref()),c=i.inject(x,i.ref()),a=i.inject(H,i.ref());let h,d=o.modelValue;const u=i.computed(()=>{var g;return(g=e.default)==null?void 0:g.call(e).some(y=>y.type!==i.Comment)}),p=g=>{d=g,t("update:modelValue",g)},f=g=>{r.value&&(r.value.open({map:l.value,anchor:a.value,...g}),p(!0))},m=()=>{r.value&&(r.value.close(),p(!1))};return i.onMounted(()=>{i.watch([l,()=>o.options],([g,y],[v,k])=>{var E;const _=!S(y,k)||l.value!==v;l.value&&c.value&&_&&(r.value?(r.value.setOptions({...y,content:u.value?s.value:y.content}),a.value||f()):(r.value=i.markRaw(new c.value.InfoWindow({...y,content:u.value?s.value:y.content})),a.value&&(h=a.value.addListener("click",()=>{f()})),(!a.value||d)&&f(),he.forEach(M=>{var O;(O=r.value)==null||O.addListener(M,b=>t(M,b))}),(E=r.value)==null||E.addListener("closeclick",()=>p(!1))))},{immediate:!0}),i.watch(()=>o.modelValue,g=>{g!==d&&(g?f():m())})}),i.onBeforeUnmount(()=>{var g;h&&h.remove(),r.value&&((g=c.value)==null||g.event.clearInstanceListeners(r.value),m())}),n({infoWindow:r,open:f,close:m}),{infoWindow:r,infoWindowRef:s,hasSlotContent:u,open:f,close:m}}}),Pt="",Ye={key:0,class:"info-window-wrapper"};function Je(o,e,t,n,r,s){return o.hasSlotContent?(i.openBlock(),i.createElementBlock("div",Ye,[i.createElementVNode("div",i.mergeProps({ref:"infoWindowRef"},o.$attrs),[i.renderSlot(o.$slots,"default",{},void 0,!0)],16)])):i.createCommentVNode("",!0)}const Xe=N(Ke,[["render",Je],["__scopeId","data-v-f929b615"]]),pe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],K=1,Z=8;class Y{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,n]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=n>>4;if(r!==K)throw new Error(`Got v${r} data when expected v${K}.`);const s=pe[n&15];if(!s)throw new Error("Unrecognized array type.");const[l]=new Uint16Array(e,2,1),[c]=new Uint32Array(e,4,1);return new Y(c,l,s,e)}constructor(e,t=64,n=Float64Array,r){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const s=pe.indexOf(this.ArrayType),l=e*2*this.ArrayType.BYTES_PER_ELEMENT,c=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,Z,e),this.coords=new this.ArrayType(this.data,Z+c+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Z+l+c+a),this.ids=new this.IndexArrayType(this.data,Z,e),this.coords=new this.ArrayType(this.data,Z+c+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(K<<4)+s]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:l,nodeSize:c}=this,a=[0,s.length-1,0],h=[];for(;a.length;){const d=a.pop()||0,u=a.pop()||0,p=a.pop()||0;if(u-p<=c){for(let y=p;y<=u;y++){const v=l[2*y],k=l[2*y+1];v>=e&&v<=n&&k>=t&&k<=r&&h.push(s[y])}continue}const f=p+u>>1,m=l[2*f],g=l[2*f+1];m>=e&&m<=n&&g>=t&&g<=r&&h.push(s[f]),(d===0?e<=m:t<=g)&&(a.push(p),a.push(f-1),a.push(1-d)),(d===0?n>=m:r>=g)&&(a.push(f+1),a.push(u),a.push(1-d))}return h}within(e,t,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:s,nodeSize:l}=this,c=[0,r.length-1,0],a=[],h=n*n;for(;c.length;){const d=c.pop()||0,u=c.pop()||0,p=c.pop()||0;if(u-p<=l){for(let y=p;y<=u;y++)me(s[2*y],s[2*y+1],e,t)<=h&&a.push(r[y]);continue}const f=p+u>>1,m=s[2*f],g=s[2*f+1];me(m,g,e,t)<=h&&a.push(r[f]),(d===0?e-n<=m:t-n<=g)&&(c.push(p),c.push(f-1),c.push(1-d)),(d===0?e+n>=m:t+n>=g)&&(c.push(f+1),c.push(u),c.push(1-d))}return a}}function J(o,e,t,n,r,s){if(r-n<=t)return;const l=n+r>>1;fe(o,e,l,n,r,s),J(o,e,t,n,l-1,1-s),J(o,e,t,l+1,r,1-s)}function fe(o,e,t,n,r,s){for(;r>n;){if(r-n>600){const h=r-n+1,d=t-n+1,u=Math.log(h),p=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*p*(h-p)/h)*(d-h/2<0?-1:1),m=Math.max(n,Math.floor(t-d*p/h+f)),g=Math.min(r,Math.floor(t+(h-d)*p/h+f));fe(o,e,t,m,g,s)}const l=e[2*t+s];let c=n,a=r;for(U(o,e,n,t),e[2*r+s]>l&&U(o,e,n,r);c<a;){for(U(o,e,c,a),c++,a--;e[2*c+s]<l;)c++;for(;e[2*a+s]>l;)a--}e[2*n+s]===l?U(o,e,n,a):(a++,U(o,e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function U(o,e,t,n){X(o,t,n),X(e,2*t,2*n),X(e,2*t+1,2*n+1)}function X(o,e,t){const n=o[e];o[e]=o[t],o[t]=n}function me(o,e,t,n){const r=o-t,s=e-n;return r*r+s*s}const Qe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:o=>o},ge=Math.fround||(o=>e=>(o[0]=+e,o[0]))(new Float32Array(1)),R=2,A=3,Q=4,I=5,ye=6;class ve{constructor(e){this.options=Object.assign(Object.create(Qe),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time("total time");const s=`prepare ${e.length} points`;t&&console.time(s),this.points=e;const l=[];for(let a=0;a<e.length;a++){const h=e[a];if(!h.geometry)continue;const[d,u]=h.geometry.coordinates,p=ge(V(d)),f=ge(z(u));l.push(p,f,1/0,a,-1,1),this.options.reduce&&l.push(0)}let c=this.trees[r+1]=this._createTree(l);t&&console.timeEnd(s);for(let a=r;a>=n;a--){const h=+Date.now();c=this.trees[a]=this._createTree(this._cluster(c,a)),t&&console.log("z%d: %d clusters in %dms",a,c.numItems,+Date.now()-h)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let s=e[2]===180?180:((e[2]+180)%360+360)%360-180;const l=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,s=180;else if(n>s){const u=this.getClusters([n,r,180,l],t),p=this.getClusters([-180,r,s,l],t);return u.concat(p)}const c=this.trees[this._limitZoom(t)],a=c.range(V(n),z(l),V(s),z(r)),h=c.data,d=[];for(const u of a){const p=this.stride*u;d.push(h[p+I]>1?we(h,p,this.clusterProps):this.points[h[p+A]])}return d}getChildren(e){const t=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",s=this.trees[n];if(!s)throw new Error(r);const l=s.data;if(t*this.stride>=l.length)throw new Error(r);const c=this.options.radius/(this.options.extent*Math.pow(2,n-1)),a=l[t*this.stride],h=l[t*this.stride+1],d=s.within(a,h,c),u=[];for(const p of d){const f=p*this.stride;l[f+Q]===e&&u.push(l[f+I]>1?we(l,f,this.clusterProps):this.points[l[f+A]])}if(u.length===0)throw new Error(r);return u}getLeaves(e,t,n){t=t||10,n=n||0;const r=[];return this._appendLeaves(r,e,t,n,0),r}getTile(e,t,n){const r=this.trees[this._limitZoom(e)],s=Math.pow(2,e),{extent:l,radius:c}=this.options,a=c/l,h=(n-a)/s,d=(n+1+a)/s,u={features:[]};return this._addTileFeatures(r.range((t-a)/s,h,(t+1+a)/s,d),r.data,t,n,s,u),t===0&&this._addTileFeatures(r.range(1-a/s,h,1,d),r.data,s,n,s,u),t===s-1&&this._addTileFeatures(r.range(0,h,a/s,d),r.data,-1,n,s,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,s){const l=this.getChildren(t);for(const c of l){const a=c.properties;if(a&&a.cluster?s+a.point_count<=r?s+=a.point_count:s=this._appendLeaves(e,a.cluster_id,n,r,s):s<r?s++:e.push(c),e.length===n)break}return s}_createTree(e){const t=new Y(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,n,r,s,l){for(const c of e){const a=c*this.stride,h=t[a+I]>1;let d,u,p;if(h)d=ke(t,a,this.clusterProps),u=t[a],p=t[a+1];else{const g=this.points[t[a+A]];d=g.properties;const[y,v]=g.geometry.coordinates;u=V(y),p=z(v)}const f={type:1,geometry:[[Math.round(this.options.extent*(u*s-n)),Math.round(this.options.extent*(p*s-r))]],tags:d};let m;h||this.options.generateId?m=t[a+A]:m=this.points[t[a+A]].id,m!==void 0&&(f.id=m),l.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:n,extent:r,reduce:s,minPoints:l}=this.options,c=n/(r*Math.pow(2,t)),a=e.data,h=[],d=this.stride;for(let u=0;u<a.length;u+=d){if(a[u+R]<=t)continue;a[u+R]=t;const p=a[u],f=a[u+1],m=e.within(a[u],a[u+1],c),g=a[u+I];let y=g;for(const v of m){const k=v*d;a[k+R]>t&&(y+=a[k+I])}if(y>g&&y>=l){let v=p*g,k=f*g,_,E=-1;const M=((u/d|0)<<5)+(t+1)+this.points.length;for(const O of m){const b=O*d;if(a[b+R]<=t)continue;a[b+R]=t;const L=a[b+I];v+=a[b]*L,k+=a[b+1]*L,a[b+Q]=M,s&&(_||(_=this._map(a,u,!0),E=this.clusterProps.length,this.clusterProps.push(_)),s(_,this._map(a,b)))}a[u+Q]=M,h.push(v/y,k/y,1/0,M,-1,y),s&&h.push(E)}else{for(let v=0;v<d;v++)h.push(a[u+v]);if(y>1)for(const v of m){const k=v*d;if(!(a[k+R]<=t)){a[k+R]=t;for(let _=0;_<d;_++)h.push(a[k+_])}}}}return h}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+I]>1){const l=this.clusterProps[e[t+ye]];return n?Object.assign({},l):l}const r=this.points[e[t+A]].properties,s=this.options.map(r);return n&&s===r?Object.assign({},s):s}}function we(o,e,t){return{type:"Feature",id:o[e+A],properties:ke(o,e,t),geometry:{type:"Point",coordinates:[et(o[e]),tt(o[e+1])]}}}function ke(o,e,t){const n=o[e+I],r=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,s=o[e+ye],l=s===-1?{}:Object.assign({},t[s]);return Object.assign(l,{cluster:!0,cluster_id:o[e+A],point_count:n,point_count_abbreviated:r})}function V(o){return o/360+.5}function z(o){const e=Math.sin(o*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function et(o){return(o-.5)*360}function tt(o){const e=(180-o*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! *****************************************************************************
|
|
16
|
-
Copyright (c) Microsoft Corporation.
|
|
17
|
-
|
|
18
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
19
|
-
purpose with or without fee is hereby granted.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
22
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
23
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
24
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
25
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
26
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
27
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
28
|
-
***************************************************************************** */function ee(o,e){var t={};for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&e.indexOf(n)<0&&(t[n]=o[n]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(o);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(o,n[r])&&(t[n[r]]=o[n[r]]);return t}class C{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class D{constructor({markers:e,position:t}){this.markers=e,t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(C.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>C.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(C.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}const nt=(o,e,t,n)=>{const r=_e(o.getBounds(),e,n);return t.filter(s=>r.contains(C.getPosition(s)))},_e=(o,e,t)=>{const{northEast:n,southWest:r}=rt(o,e),s=ot({northEast:n,southWest:r},t);return st(s,e)},Ce=(o,e,t)=>{const n=_e(o,e,t),r=n.getNorthEast(),s=n.getSouthWest();return[s.lng(),s.lat(),r.lng(),r.lat()]},rt=(o,e)=>({northEast:e.fromLatLngToDivPixel(o.getNorthEast()),southWest:e.fromLatLngToDivPixel(o.getSouthWest())}),ot=({northEast:o,southWest:e},t)=>(o.x+=t,o.y-=t,e.x-=t,e.y+=t,{northEast:o,southWest:e}),st=({northEast:o,southWest:e},t)=>{const n=t.fromDivPixelToLatLng(e),r=t.fromDivPixelToLatLng(o);return new google.maps.LatLngBounds(n,r)};class Me{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return at(e)}}class it extends Me{constructor(e){var{viewportPadding:t=60}=e,n=ee(e,["viewportPadding"]);super(n),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:n}){return t.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:nt(t,n,e,this.viewportPadding),map:t,mapCanvasProjection:n})}}}const at=o=>o.map(t=>new D({position:C.getPosition(t),markers:[t]}));class lt extends Me{constructor(e){var{maxZoom:t,radius:n=60}=e,r=ee(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1},this.superCluster=new ve(Object.assign({maxZoom:this.maxZoom,radius:n},r))}calculate(e){let t=!1;const n={zoom:e.map.getZoom()};if(!S(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const r=this.markers.map(s=>{const l=C.getPosition(s);return{type:"Feature",geometry:{type:"Point",coordinates:[l.lng(),l.lat()]},properties:{marker:s}}});this.superCluster.load(r)}return t||(this.state.zoom<=this.maxZoom||n.zoom<=this.maxZoom)&&(t=!S(this.state,n)),this.state=n,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[e,t]},properties:n}){if(n.cluster)return new D({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map(s=>s.properties.marker),position:{lat:t,lng:e}});const r=n.marker;return new D({markers:[r],position:C.getPosition(r)})}}class ct extends it{constructor(e){var{maxZoom:t,radius:n=60,viewportPadding:r=60}=e,s=ee(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:r}),this.superCluster=new ve(Object.assign({maxZoom:this.maxZoom,radius:n},s)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t={zoom:Math.round(e.map.getZoom()),view:Ce(e.map.getBounds(),e.mapCanvasProjection,this.viewportPadding)};let n=!S(this.state,t);if(!S(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const r=this.markers.map(s=>{const l=C.getPosition(s);return{type:"Feature",geometry:{type:"Point",coordinates:[l.lng(),l.lat()]},properties:{marker:s}}});this.superCluster.load(r)}return n&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:n}}cluster({map:e,mapCanvasProjection:t}){const n={zoom:Math.round(e.getZoom()),view:Ce(e.getBounds(),t,this.viewportPadding)};return this.superCluster.getClusters(n.view,n.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:n}){if(n.cluster)return new D({markers:this.superCluster.getLeaves(n.cluster_id,1/0).map(s=>s.properties.marker),position:{lat:t,lng:e}});const r=n.marker;return new D({markers:[r],position:C.getPosition(r)})}}class ut{constructor(e,t){this.markers={sum:e.length};const n=t.map(s=>s.count),r=n.reduce((s,l)=>s+l,0);this.clusters={count:t.length,markers:{mean:r/t.length,sum:r,min:Math.min(...n),max:Math.max(...n)}}}}class dt{render({count:e,position:t},n,r){const l=`<svg fill="${e>Math.max(10,n.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-e315b413]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ae91c15f]{display:none}.mapdiv .custom-control-wrapper[data-v-ae91c15f]{display:inline-block}.info-window-wrapper[data-v-dfef906e]{display:none}.mapdiv .info-window-wrapper[data-v-dfef906e]{display:inline-block}.custom-marker-wrapper[data-v-4b2eafc1]{display:none}.mapdiv .custom-marker-wrapper[data-v-4b2eafc1]{display:inline-block}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(k,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(k=typeof globalThis<"u"?globalThis:k||self,l(k.Vue3GoogleMap={},k.Vue))})(this,function(k,l){"use strict";var Cr=Object.defineProperty;var Mr=(k,l,O)=>l in k?Cr(k,l,{enumerable:!0,configurable:!0,writable:!0,value:O}):k[l]=O;var de=(k,l,O)=>(Mr(k,typeof l!="symbol"?l+"":l,O),O);const O=Symbol("map"),j=Symbol("api"),Q=Symbol("marker"),ee=Symbol("markerCluster"),W=Symbol("CustomMarker"),fe=Symbol("mapTilesLoaded"),$=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];function Ge(n,e,t,r){function s(o){return o instanceof t?o:new t(function(i){i(o)})}return new(t||(t=Promise))(function(o,i){function c(f){try{d(r.next(f))}catch(u){i(u)}}function a(f){try{d(r.throw(f))}catch(u){i(u)}}function d(f){f.done?o(f.value):s(f.value).then(c,a)}d((r=r.apply(n,e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function ze(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var te,pe;function We(){return pe||(pe=1,te=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),te}var He=We(),Ke=ze(He);const he="__googleMapsScriptId";var N;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(N||(N={}));class R{constructor({apiKey:e,authReferrerPolicy:t,channel:r,client:s,id:o=he,language:i,libraries:c=[],mapIds:a,nonce:d,region:f,retries:u=3,url:m="https://maps.googleapis.com/maps/api/js",version:g}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=r,this.client=s,this.id=o||he,this.language=i,this.libraries=c,this.mapIds=a,this.nonce=d,this.region=f,this.retries=u,this.url=m,this.version=g,R.instance){if(!Ke(this.options,R.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(R.instance.options)}`);return R.instance}R.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,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?N.FAILURE:this.done?N.SUCCESS:this.loading?N.LOADING:N.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+=`&key=${this.apiKey}`),this.channel&&(e+=`&channel=${this.channel}`),this.client&&(e+=`&client=${this.client}`),this.libraries.length>0&&(e+=`&libraries=${this.libraries.join(",")}`),this.language&&(e+=`&language=${this.language}`),this.region&&(e+=`®ion=${this.region}`),this.version&&(e+=`&v=${this.version}`),this.mapIds&&(e+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(e+=`&auth_referrer_policy=${this.authReferrerPolicy}`),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(r=>{r?t(r.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(o=>!r[o]&&delete r[o]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(o=>{let i,c,a,d="The Google Maps JavaScript API",f="google",u="importLibrary",m="__ib__",g=document,p=window;p=p[f]||(p[f]={});const h=p.maps||(p.maps={}),y=new Set,v=new URLSearchParams,E=()=>i||(i=new Promise((w,b)=>Ge(this,void 0,void 0,function*(){var M;yield c=g.createElement("script"),c.id=this.id,v.set("libraries",[...y]+"");for(a in o)v.set(a.replace(/[A-Z]/g,P=>"_"+P[0].toLowerCase()),o[a]);v.set("callback",f+".maps."+m),c.src=this.url+"?"+v,h[m]=w,c.onerror=()=>i=b(Error(d+" could not load.")),c.nonce=this.nonce||((M=g.querySelector("script[nonce]"))===null||M===void 0?void 0:M.nonce)||"",g.head.append(c)})));h[u]?console.warn(d+" only loads once. Ignoring:",o):h[u]=(w,...b)=>y.add(w)&&E().then(()=>h[u](w,...b))})(r);const s=this.libraries.map(o=>this.importLibrary(o));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),o=>{const i=new ErrorEvent("error",{error:o});this.loadErrorCallback(i)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(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();return}this.loading=!0,this.setScript()}}}function Je(n){return class extends n.OverlayView{constructor(r){super();de(this,"element");de(this,"opts");const{element:s,...o}=r;this.element=s,this.opts=o,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof n.LatLng?this.opts.position:new n.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const r=this.element;return r.style.display!=="none"&&r.style.visibility!=="hidden"&&(r.style.opacity===""||Number(r.style.opacity)>.01)}onAdd(){if(!this.element)return;const r=this.getPanes();r&&r.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const r=this.getProjection(),s=r==null?void 0:r.fromLatLngToDivPixel(this.getPosition());if(s){this.element.style.position="absolute";let o,i;switch(this.opts.anchorPoint){case"TOP_CENTER":o="-50%",i="-100%";break;case"BOTTOM_CENTER":o="-50%",i="0";break;case"LEFT_CENTER":o="-100%",i="-50%";break;case"RIGHT_CENTER":o="0",i="-50%";break;case"TOP_LEFT":o="-100%",i="-100%";break;case"TOP_RIGHT":o="0",i="-100%";break;case"BOTTOM_LEFT":o="-100%",i="0";break;case"BOTTOM_RIGHT":o="0",i="0";break;default:o="-50%",i="-50%"}const c=s.x+(this.opts.offsetX||0)+"px",a=s.y+(this.opts.offsetY||0)+"px";this.element.style.transform=`translateX(${o}) translateX(${c}) translateY(${i}) translateY(${a})`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(r){const{element:s,...o}=r;this.element=s,this.opts=o,this.draw()}}}let me;const ge=["bounds_changed","center_changed","click","contextmenu","dblclick","drag","dragend","dragstart","heading_changed","idle","isfractionalzoomenabled_changed","mapcapabilities_changed","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","renderingtype_changed","rightclick","tilesloaded","tilt_changed","zoom_changed"],Ye=l.defineComponent({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places","marker"]},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},colorScheme:{type:String,required:!1},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},isFractionalZoomEnabled:{type:Boolean,required:!1,default:void 0},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},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},cameraControl:{type:Boolean,required:!1,default:void 0},cameraControlPosition:{type:String,required:!1},nonce:{type:String,default:""}},emits:ge,setup(n,{emit:e}){const t=l.ref(),r=l.ref(!1),s=l.ref(),o=l.ref(),i=l.ref(!1);l.provide(O,s),l.provide(j,o),l.provide(fe,i);const c=()=>{const u={...n};Object.keys(u).forEach(h=>{u[h]===void 0&&delete u[h]});const g=h=>{var y;return h?{position:(y=o.value)==null?void 0:y.ControlPosition[h]}:{}},p={scaleControlOptions:n.scaleControlStyle?{style:n.scaleControlStyle}:{},panControlOptions:g(n.panControlPosition),zoomControlOptions:g(n.zoomControlPosition),rotateControlOptions:g(n.rotateControlPosition),streetViewControlOptions:g(n.streetViewControlPosition),fullscreenControlOptions:g(n.fullscreenControlPosition),cameraControlOptions:g(n.cameraControlPosition),disableDefaultUI:n.disableDefaultUi};return{...u,...p}},a=l.watch([o,s],([u,m])=>{const g=u,p=m;g&&p&&(g.event.addListenerOnce(p,"tilesloaded",()=>{i.value=!0}),setTimeout(a,0))},{immediate:!0}),d=()=>{try{const{apiKey:u,region:m,version:g,language:p,libraries:h,nonce:y}=n;me=new R({apiKey:u,region:m,version:g,language:p,libraries:h,nonce:y})}catch(u){console.error(u)}},f=u=>{o.value=l.markRaw(u.maps),s.value=l.markRaw(new u.maps.Map(t.value,c()));const m=Je(o.value);o.value[W]=m,ge.forEach(p=>{var h;(h=s.value)==null||h.addListener(p,y=>e(p,y))}),r.value=!0;const g=Object.keys(n).filter(p=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom","nonce"].includes(p)).map(p=>l.toRef(n,p));l.watch([()=>n.center,()=>n.zoom,...g],([p,h],[y,v])=>{var P,C,I;const{center:E,zoom:w,...b}=c();(P=s.value)==null||P.setOptions(b),h!==void 0&&h!==v&&((C=s.value)==null||C.setZoom(h));const M=!y||p.lng!==y.lng||p.lat!==y.lat;p&&M&&((I=s.value)==null||I.panTo(p))})};return l.onMounted(()=>{n.apiPromise&&n.apiPromise instanceof Promise?n.apiPromise.then(f):(d(),me.load().then(f))}),l.onBeforeUnmount(()=>{var u;i.value=!1,s.value&&((u=o.value)==null||u.event.clearInstanceListeners(s.value))}),{mapRef:t,ready:r,map:s,api:o,mapTilesLoaded:i}}}),Or="",U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Xe={ref:"mapRef",class:"mapdiv"};function Qe(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Xe,null,512),l.renderSlot(n.$slots,"default",l.normalizeProps(l.guardReactiveProps({ready:n.ready,map:n.map,api:n.api,mapTilesLoaded:n.mapTilesLoaded})),void 0,!0)])}const et=U(Ye,[["render",Qe],["__scopeId","data-v-e315b413"]]);function tt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rt=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t};const F=tt(rt),ye=["click","drag","dragend","dragstart","gmp-click"],nt=l.defineComponent({name:"AdvancedMarker",props:{options:{type:Object,required:!0},pinOptions:{type:Object,required:!1}},emits:ye,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.computed(()=>{var g;return(g=r.content)==null?void 0:g.call(r).some(p=>p.type!==l.Comment)}),i=l.toRef(n,"options"),c=l.toRef(n,"pinOptions"),a=l.ref(),d=l.inject(O,l.ref()),f=l.inject(j,l.ref()),u=l.inject(ee,l.ref()),m=l.computed(()=>!!(u.value&&f.value&&a.value instanceof google.maps.marker.AdvancedMarkerElement));return l.watch([d,i,c,s],async(g,[p,h,y,v])=>{var C,I,Ve;const E=!F(i.value,h)||!F(c.value,y),w=s.value!==v,b=E||w||d.value!==p;if(!d.value||!f.value||!b||o.value&&!s.value)return;const{AdvancedMarkerElement:M,PinElement:P}=f.value.marker;if(a.value){const{map:ce,content:X,...ue}=i.value;Object.assign(a.value,{content:o.value?s.value:c.value?new P(c.value).element:X,...ue}),m.value&&((C=u.value)==null||C.removeMarker(a.value),(I=u.value)==null||I.addMarker(a.value))}else o.value?i.value.content=s.value:c.value&&(i.value.content=new P(c.value).element),a.value=l.markRaw(new M(i.value)),m.value?(Ve=u.value)==null||Ve.addMarker(a.value):a.value.map=d.value,ye.forEach(ce=>{var X;(X=a.value)==null||X.addListener(ce,ue=>e(ce,ue))})},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var g,p;a.value&&((g=f.value)==null||g.event.clearInstanceListeners(a.value),m.value?(p=u.value)==null||p.removeMarker(a.value):a.value.map=null)}),l.provide(Q,a),t({marker:a}),{hasCustomSlotContent:o,markerRef:s}}}),br="",st={key:0,class:"advanced-marker-wrapper"};function ot(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[n.hasCustomSlotContent?(l.openBlock(),l.createElementBlock("div",st,[l.createElementVNode("div",l.mergeProps({ref:"markerRef"},n.$attrs),[l.renderSlot(n.$slots,"content")],16)])):l.createCommentVNode("v-if",!0),l.renderSlot(n.$slots,"default")],64)}const it=U(nt,[["render",ot]]),ve=n=>n==="Marker",we=n=>n===W,D=(n,e,t,r)=>{const s=l.ref(),o=l.inject(O,l.ref()),i=l.inject(j,l.ref()),c=l.inject(ee,l.ref()),a=l.computed(()=>!!(c.value&&i.value&&(s.value instanceof i.value.Marker||s.value instanceof i.value[W])));return l.watch([o,t],(d,[f,u])=>{var g,p,h;const m=!F(t.value,u)||o.value!==f;if(!(!o.value||!i.value||!m))if(s.value)s.value.setOptions(t.value),a.value&&((g=c.value)==null||g.removeMarker(s.value),(p=c.value)==null||p.addMarker(s.value));else{if(ve(n))s.value=l.markRaw(new i.value[n](t.value));else if(we(n)){const y=t.value;y.element&&(s.value=l.markRaw(new i.value[n](y)))}else s.value=l.markRaw(new i.value[n]({...t.value,map:o.value}));s.value&&(a.value?(h=c.value)==null||h.addMarker(s.value):(ve(n)||we(n))&&s.value.setMap(o.value)),e.forEach(y=>{var v;(v=s.value)==null||v.addListener(y,E=>r(y,E))})}},{immediate:!0,flush:"post"}),l.onBeforeUnmount(()=>{var d,f;s.value&&((d=i.value)==null||d.event.clearInstanceListeners(s.value),a.value?(f=c.value)==null||f.removeMarker(s.value):s.value.setMap(null))}),s},Ee=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],at=l.defineComponent({name:"Marker",props:{options:{type:Object,required:!0}},emits:Ee,setup(n,{emit:e,expose:t,slots:r}){const s=l.toRef(n,"options"),o=D("Marker",Ee,s,e);return l.provide(Q,o),t({marker:o}),()=>{var i;return(i=r.default)==null?void 0:i.call(r)}}}),lt=l.defineComponent({name:"Polyline",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polyline:D("Polyline",$,t,e)}},render:()=>null}),ct=l.defineComponent({name:"Polygon",props:{options:{type:Object,required:!0}},emits:$,setup(n,{emit:e}){const t=l.toRef(n,"options");return{polygon:D("Polygon",$,t,e)}},render:()=>null}),ke=$.concat(["bounds_changed"]),ut=l.defineComponent({name:"Rectangle",props:{options:{type:Object,required:!0}},emits:ke,setup(n,{emit:e}){const t=l.toRef(n,"options");return{rectangle:D("Rectangle",ke,t,e)}},render:()=>null}),_e=$.concat(["center_changed","radius_changed"]),dt=l.defineComponent({name:"Circle",props:{options:{type:Object,required:!0}},emits:_e,setup(n,{emit:e}){const t=l.toRef(n,"options");return{circle:D("Circle",_e,t,e)}},render:()=>null}),ft=l.defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(n,{emit:e}){const t=l.ref(null),r=l.inject(O,l.ref()),s=l.inject(j,l.ref()),o=l.inject(fe,l.ref(!1)),i=l.watch([o,s,t],([d,f,u])=>{f&&d&&u&&(c(n.position),e("content:loaded"),setTimeout(i,0))},{immediate:!0}),c=d=>{if(r.value&&s.value&&t.value){const f=s.value.ControlPosition[d];t.value.index=n.index,r.value.controls[f].push(t.value)}},a=d=>{if(r.value&&s.value){let f=null;const u=s.value.ControlPosition[d];r.value.controls[u].forEach((m,g)=>{m===t.value&&(f=g)}),f!==null&&r.value.controls[u].removeAt(f)}};return l.onBeforeUnmount(()=>a(n.position)),l.watch(()=>n.position,(d,f)=>{a(f),c(d)}),l.watch(()=>n.index,d=>{t.value&&(t.value.index=d)}),{controlRef:t}}}),Pr="",pt={ref:"controlRef",class:"custom-control-wrapper"};function ht(n,e,t,r,s,o){return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createCommentVNode(`
|
|
3
|
+
v-show must be used instead of v-if otherwise there
|
|
4
|
+
would be no rendered content pushed to the map controls
|
|
5
|
+
`),l.createElementVNode("div",pt,[l.renderSlot(n.$slots,"default",{},void 0,!0)],512)],2112)}const mt=U(ft,[["render",ht],["__scopeId","data-v-ae91c15f"]]),Ce=["closeclick","content_changed","domready","position_changed","visible","zindex_changed"],gt=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>({})},modelValue:{type:Boolean}},emits:[...Ce,"update:modelValue"],setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.ref(),i=l.inject(O,l.ref()),c=l.inject(j,l.ref()),a=l.inject(Q,l.ref());let d,f=n.modelValue;const u=l.computed(()=>{var h;return(h=e.default)==null?void 0:h.call(e).some(y=>y.type!==l.Comment)}),m=h=>{f=h,t("update:modelValue",h)},g=h=>{s.value&&(s.value.open({map:i.value,anchor:a.value,...h}),m(!0))},p=()=>{s.value&&(s.value.close(),m(!1))};return l.onMounted(()=>{l.watch([i,()=>n.options],([h,y],[v,E])=>{var b;const w=!F(y,E)||i.value!==v;i.value&&c.value&&w&&(s.value?(s.value.setOptions({...y,content:u.value?o.value:y.content}),a.value||g()):(s.value=l.markRaw(new c.value.InfoWindow({...y,content:u.value?o.value:y.content})),a.value&&(d=a.value.addListener("click",()=>{g()})),(!a.value||f)&&g(),Ce.forEach(M=>{var P;(P=s.value)==null||P.addListener(M,C=>t(M,C))}),(b=s.value)==null||b.addListener("closeclick",()=>m(!1))))},{immediate:!0}),l.watch(()=>n.modelValue,h=>{h!==f&&(h?g():p())})}),l.onBeforeUnmount(()=>{var h;d&&d.remove(),s.value&&((h=c.value)==null||h.event.clearInstanceListeners(s.value),p())}),r({infoWindow:s,open:g,close:p}),{infoWindow:s,infoWindowRef:o,hasSlotContent:u,open:g,close:p}}}),Sr="",yt={key:0,class:"info-window-wrapper"};function vt(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",yt,[l.createElementVNode("div",l.mergeProps({ref:"infoWindowRef"},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("v-if",!0)}const wt=U(gt,[["render",vt],["__scopeId","data-v-dfef906e"]]);var Et=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty;function Me(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function H(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);var o=s.cache,i=o.get(t),c=o.get(r);if(i&&c)return i===r&&c===t;o.set(t,r),o.set(r,t);var a=n(t,r,s);return o.delete(t),o.delete(r),a}}function Oe(n){return Et(n).concat(kt(n))}var Ct=Object.hasOwn||function(n,e){return _t.call(n,e)};function x(n,e){return n===e||!n&&!e&&n!==n&&e!==e}var Mt="__v",Ot="__o",bt="_owner",be=Object.getOwnPropertyDescriptor,Pe=Object.keys;function Pt(n,e,t){var r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function St(n,e){return x(n.getTime(),e.getTime())}function qt(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function At(n,e){return n===e}function Se(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.entries(),i,c,a=0;(i=o.next())&&!i.done;){for(var d=e.entries(),f=!1,u=0;(c=d.next())&&!c.done;){if(s[u]){u++;continue}var m=i.value,g=c.value;if(t.equals(m[0],g[0],a,u,n,e,t)&&t.equals(m[1],g[1],m[0],g[0],n,e,t)){f=s[u]=!0;break}u++}if(!f)return!1;a++}return!0}var Tt=x;function Lt(n,e,t){var r=Pe(n),s=r.length;if(Pe(e).length!==s)return!1;for(;s-- >0;)if(!Ae(n,e,t,r[s]))return!1;return!0}function Z(n,e,t){var r=Oe(n),s=r.length;if(Oe(e).length!==s)return!1;for(var o,i,c;s-- >0;)if(o=r[s],!Ae(n,e,t,o)||(i=be(n,o),c=be(e,o),(i||c)&&(!i||!c||i.configurable!==c.configurable||i.enumerable!==c.enumerable||i.writable!==c.writable)))return!1;return!0}function It(n,e){return x(n.valueOf(),e.valueOf())}function jt(n,e){return n.source===e.source&&n.flags===e.flags}function qe(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.values(),i,c;(i=o.next())&&!i.done;){for(var a=e.values(),d=!1,f=0;(c=a.next())&&!c.done;){if(!s[f]&&t.equals(i.value,c.value,i.value,c.value,n,e,t)){d=s[f]=!0;break}f++}if(!d)return!1}return!0}function Rt(n,e){var t=n.length;if(e.length!==t)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function xt(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Ae(n,e,t,r){return(r===bt||r===Ot||r===Mt)&&(n.$$typeof||e.$$typeof)?!0:Ct(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}var Bt="[object Arguments]",$t="[object Boolean]",Nt="[object Date]",Dt="[object Error]",Ut="[object Map]",Ft="[object Number]",Zt="[object Object]",Vt="[object RegExp]",Gt="[object Set]",zt="[object String]",Wt="[object URL]",Ht=Array.isArray,Te=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Le=Object.assign,Kt=Object.prototype.toString.call.bind(Object.prototype.toString);function Jt(n){var e=n.areArraysEqual,t=n.areDatesEqual,r=n.areErrorsEqual,s=n.areFunctionsEqual,o=n.areMapsEqual,i=n.areNumbersEqual,c=n.areObjectsEqual,a=n.arePrimitiveWrappersEqual,d=n.areRegExpsEqual,f=n.areSetsEqual,u=n.areTypedArraysEqual,m=n.areUrlsEqual;return function(p,h,y){if(p===h)return!0;if(p==null||h==null)return!1;var v=typeof p;if(v!==typeof h)return!1;if(v!=="object")return v==="number"?i(p,h,y):v==="function"?s(p,h,y):!1;var E=p.constructor;if(E!==h.constructor)return!1;if(E===Object)return c(p,h,y);if(Ht(p))return e(p,h,y);if(Te!=null&&Te(p))return u(p,h,y);if(E===Date)return t(p,h,y);if(E===RegExp)return d(p,h,y);if(E===Map)return o(p,h,y);if(E===Set)return f(p,h,y);var w=Kt(p);return w===Nt?t(p,h,y):w===Vt?d(p,h,y):w===Ut?o(p,h,y):w===Gt?f(p,h,y):w===Zt?typeof p.then!="function"&&typeof h.then!="function"&&c(p,h,y):w===Wt?m(p,h,y):w===Dt?r(p,h,y):w===Bt?c(p,h,y):w===$t||w===Ft||w===zt?a(p,h,y):!1}}function Yt(n){var e=n.circular,t=n.createCustomConfig,r=n.strict,s={areArraysEqual:r?Z:Pt,areDatesEqual:St,areErrorsEqual:qt,areFunctionsEqual:At,areMapsEqual:r?Me(Se,Z):Se,areNumbersEqual:Tt,areObjectsEqual:r?Z:Lt,arePrimitiveWrappersEqual:It,areRegExpsEqual:jt,areSetsEqual:r?Me(qe,Z):qe,areTypedArraysEqual:r?Z:Rt,areUrlsEqual:xt};if(t&&(s=Le({},s,t(s))),e){var o=H(s.areArraysEqual),i=H(s.areMapsEqual),c=H(s.areObjectsEqual),a=H(s.areSetsEqual);s=Le({},s,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:c,areSetsEqual:a})}return s}function Xt(n){return function(e,t,r,s,o,i,c){return n(e,t,c)}}function Qt(n){var e=n.circular,t=n.comparator,r=n.createState,s=n.equals,o=n.strict;if(r)return function(a,d){var f=r(),u=f.cache,m=u===void 0?e?new WeakMap:void 0:u,g=f.meta;return t(a,d,{cache:m,equals:s,meta:g,strict:o})};if(e)return function(a,d){return t(a,d,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var i={cache:void 0,equals:s,meta:void 0,strict:o};return function(a,d){return t(a,d,i)}}var K=q();q({strict:!0}),q({circular:!0}),q({circular:!0,strict:!0}),q({createInternalComparator:function(){return x}}),q({strict:!0,createInternalComparator:function(){return x}}),q({circular:!0,createInternalComparator:function(){return x}}),q({circular:!0,createInternalComparator:function(){return x},strict:!0});function q(n){n===void 0&&(n={});var e=n.circular,t=e===void 0?!1:e,r=n.createInternalComparator,s=n.createState,o=n.strict,i=o===void 0?!1:o,c=Yt(n),a=Jt(c),d=r?r(a):Xt(a);return Qt({circular:t,comparator:a,createState:s,equals:d,strict:i})}const Ie=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],re=1,V=8;class ne{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==re)throw new Error(`Got v${s} data when expected v${re}.`);const o=Ie[r&15];if(!o)throw new Error("Unrecognized array type.");const[i]=new Uint16Array(e,2,1),[c]=new Uint32Array(e,4,1);return new ne(c,i,o,e)}constructor(e,t=64,r=Float64Array,s){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const o=Ie.indexOf(this.ArrayType),i=e*2*this.ArrayType.BYTES_PER_ELEMENT,c=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-c%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,V,e),this.coords=new this.ArrayType(this.data,V+c+a,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(V+i+c+a),this.ids=new this.IndexArrayType(this.data,V,e),this.coords=new this.ArrayType(this.data,V+c+a,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(re<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return se(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:c}=this,a=[0,o.length-1,0],d=[];for(;a.length;){const f=a.pop()||0,u=a.pop()||0,m=a.pop()||0;if(u-m<=c){for(let y=m;y<=u;y++){const v=i[2*y],E=i[2*y+1];v>=e&&v<=r&&E>=t&&E<=s&&d.push(o[y])}continue}const g=m+u>>1,p=i[2*g],h=i[2*g+1];p>=e&&p<=r&&h>=t&&h<=s&&d.push(o[g]),(f===0?e<=p:t<=h)&&(a.push(m),a.push(g-1),a.push(1-f)),(f===0?r>=p:s>=h)&&(a.push(g+1),a.push(u),a.push(1-f))}return d}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:i}=this,c=[0,s.length-1,0],a=[],d=r*r;for(;c.length;){const f=c.pop()||0,u=c.pop()||0,m=c.pop()||0;if(u-m<=i){for(let y=m;y<=u;y++)Re(o[2*y],o[2*y+1],e,t)<=d&&a.push(s[y]);continue}const g=m+u>>1,p=o[2*g],h=o[2*g+1];Re(p,h,e,t)<=d&&a.push(s[g]),(f===0?e-r<=p:t-r<=h)&&(c.push(m),c.push(g-1),c.push(1-f)),(f===0?e+r>=p:t+r>=h)&&(c.push(g+1),c.push(u),c.push(1-f))}return a}}function se(n,e,t,r,s,o){if(s-r<=t)return;const i=r+s>>1;je(n,e,i,r,s,o),se(n,e,t,r,i-1,1-o),se(n,e,t,i+1,s,1-o)}function je(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const d=s-r+1,f=t-r+1,u=Math.log(d),m=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*m*(d-m)/d)*(f-d/2<0?-1:1),p=Math.max(r,Math.floor(t-f*m/d+g)),h=Math.min(s,Math.floor(t+(d-f)*m/d+g));je(n,e,t,p,h,o)}const i=e[2*t+o];let c=r,a=s;for(G(n,e,r,t),e[2*s+o]>i&&G(n,e,r,s);c<a;){for(G(n,e,c,a),c++,a--;e[2*c+o]<i;)c++;for(;e[2*a+o]>i;)a--}e[2*r+o]===i?G(n,e,r,a):(a++,G(n,e,a,s)),a<=t&&(r=a+1),t<=a&&(s=a-1)}}function G(n,e,t,r){oe(n,t,r),oe(e,2*t,2*r),oe(e,2*t+1,2*r+1)}function oe(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function Re(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const er={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},xe=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),B=2,A=3,ie=4,T=5,Be=6;class $e{constructor(e){this.options=Object.assign(Object.create(er),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const i=[];for(let a=0;a<e.length;a++){const d=e[a];if(!d.geometry)continue;const[f,u]=d.geometry.coordinates,m=xe(J(f)),g=xe(Y(u));i.push(m,g,1/0,a,-1,1),this.options.reduce&&i.push(0)}let c=this.trees[s+1]=this._createTree(i);t&&console.timeEnd(o);for(let a=s;a>=r;a--){const d=+Date.now();c=this.trees[a]=this._createTree(this._cluster(c,a)),t&&console.log("z%d: %d clusters in %dms",a,c.numItems,+Date.now()-d)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const u=this.getClusters([r,s,180,i],t),m=this.getClusters([-180,s,o,i],t);return u.concat(m)}const c=this.trees[this._limitZoom(t)],a=c.range(J(r),Y(i),J(o),Y(s)),d=c.data,f=[];for(const u of a){const m=this.stride*u;f.push(d[m+T]>1?Ne(d,m,this.clusterProps):this.points[d[m+A]])}return f}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);const i=o.data;if(t*this.stride>=i.length)throw new Error(s);const c=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=i[t*this.stride],d=i[t*this.stride+1],f=o.within(a,d,c),u=[];for(const m of f){const g=m*this.stride;i[g+ie]===e&&u.push(i[g+T]>1?Ne(i,g,this.clusterProps):this.points[i[g+A]])}if(u.length===0)throw new Error(s);return u}getLeaves(e,t,r){t=t||10,r=r||0;const s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){const s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:i,radius:c}=this.options,a=c/i,d=(r-a)/o,f=(r+1+a)/o,u={features:[]};return this._addTileFeatures(s.range((t-a)/o,d,(t+1+a)/o,f),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-a/o,d,1,f),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,d,a/o,f),s.data,-1,r,o,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){const i=this.getChildren(t);for(const c of i){const a=c.properties;if(a&&a.cluster?o+a.point_count<=s?o+=a.point_count:o=this._appendLeaves(e,a.cluster_id,r,s,o):o<s?o++:e.push(c),e.length===r)break}return o}_createTree(e){const t=new ne(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,i){for(const c of e){const a=c*this.stride,d=t[a+T]>1;let f,u,m;if(d)f=De(t,a,this.clusterProps),u=t[a],m=t[a+1];else{const h=this.points[t[a+A]];f=h.properties;const[y,v]=h.geometry.coordinates;u=J(y),m=Y(v)}const g={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(m*o-s))]],tags:f};let p;d||this.options.generateId?p=t[a+A]:p=this.points[t[a+A]].id,p!==void 0&&(g.id=p),i.features.push(g)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:s,reduce:o,minPoints:i}=this.options,c=r/(s*Math.pow(2,t)),a=e.data,d=[],f=this.stride;for(let u=0;u<a.length;u+=f){if(a[u+B]<=t)continue;a[u+B]=t;const m=a[u],g=a[u+1],p=e.within(a[u],a[u+1],c),h=a[u+T];let y=h;for(const v of p){const E=v*f;a[E+B]>t&&(y+=a[E+T])}if(y>h&&y>=i){let v=m*h,E=g*h,w,b=-1;const M=((u/f|0)<<5)+(t+1)+this.points.length;for(const P of p){const C=P*f;if(a[C+B]<=t)continue;a[C+B]=t;const I=a[C+T];v+=a[C]*I,E+=a[C+1]*I,a[C+ie]=M,o&&(w||(w=this._map(a,u,!0),b=this.clusterProps.length,this.clusterProps.push(w)),o(w,this._map(a,C)))}a[u+ie]=M,d.push(v/y,E/y,1/0,M,-1,y),o&&d.push(b)}else{for(let v=0;v<f;v++)d.push(a[u+v]);if(y>1)for(const v of p){const E=v*f;if(!(a[E+B]<=t)){a[E+B]=t;for(let w=0;w<f;w++)d.push(a[E+w])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+T]>1){const i=this.clusterProps[e[t+Be]];return r?Object.assign({},i):i}const s=this.points[e[t+A]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function Ne(n,e,t){return{type:"Feature",id:n[e+A],properties:De(n,e,t),geometry:{type:"Point",coordinates:[tr(n[e]),rr(n[e+1])]}}}function De(n,e,t){const r=n[e+T],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+Be],i=o===-1?{}:Object.assign({},t[o]);return Object.assign(i,{cluster:!0,cluster_id:n[e+A],point_count:r,point_count_abbreviated:s})}function J(n){return n/360+.5}function Y(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function tr(n){return(n-.5)*360}function rr(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ae(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}typeof SuppressedError=="function"&&SuppressedError;class _{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class z{constructor({markers:e,position:t}){this.markers=[],e&&(this.markers=e),t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(_.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>_.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(_.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function S(n,e="assertion failed"){if(n==null)throw Error(e)}const nr=(n,e,t,r)=>{const s=n.getBounds();S(s);const o=Ue(s,e,r);return t.filter(i=>o.contains(_.getPosition(i)))},Ue=(n,e,t)=>{const{northEast:r,southWest:s}=or(n,e),o=ir({northEast:r,southWest:s},t);return ar(o,e)},sr=(n,e,t)=>{const r=Ue(n,e,t),s=r.getNorthEast(),o=r.getSouthWest();return[o.lng(),o.lat(),s.lng(),s.lat()]},or=(n,e)=>{const t=e.fromLatLngToDivPixel(n.getNorthEast()),r=e.fromLatLngToDivPixel(n.getSouthWest());return S(t),S(r),{northEast:t,southWest:r}},ir=({northEast:n,southWest:e},t)=>(n.x+=t,n.y-=t,e.x-=t,e.y+=t,{northEast:n,southWest:e}),ar=({northEast:n,southWest:e},t)=>{const r=t.fromDivPixelToLatLng(e),s=t.fromDivPixelToLatLng(n);return new google.maps.LatLngBounds(r,s)};class Fe{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return cr(e)}}class lr extends Fe{constructor(e){var{viewportPadding:t=60}=e,r=ae(e,["viewportPadding"]);super(r),this.viewportPadding=60,this.viewportPadding=t}calculate({markers:e,map:t,mapCanvasProjection:r}){const s=t.getZoom();return S(s),s>=this.maxZoom?{clusters:this.noop({markers:e}),changed:!1}:{clusters:this.cluster({markers:nr(t,r,e,this.viewportPadding),map:t,mapCanvasProjection:r})}}}const cr=n=>n.map(t=>new z({position:_.getPosition(t),markers:[t]}));class ur extends Fe{constructor(e){var{maxZoom:t,radius:r=60}=e,s=ae(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new $e(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1,r=e.map.getZoom();S(r),r=Math.round(r);const s={zoom:r};if(!K(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const c=_.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[c.lng(),c.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!K(this.state,s)),this.state=s,e.markers.length===0?(this.clusters=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return S(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new z({markers:[s],position:_.getPosition(s)})}}class dr extends lr{constructor(e){var{maxZoom:t,radius:r=60,viewportPadding:s=60}=e,o=ae(e,["maxZoom","radius","viewportPadding"]);super({maxZoom:t,viewportPadding:s}),this.markers=[],this.clusters=[],this.superCluster=new $e(Object.assign({maxZoom:this.maxZoom,radius:r},o)),this.state={zoom:-1,view:[0,0,0,0]}}calculate(e){const t=this.getViewportState(e);let r=!K(this.state,t);if(!K(e.markers,this.markers)){r=!0,this.markers=[...e.markers];const s=this.markers.map(o=>{const i=_.getPosition(o);return{type:"Feature",geometry:{type:"Point",coordinates:[i.lng(),i.lat()]},properties:{marker:o}}});this.superCluster.load(s)}return r&&(this.clusters=this.cluster(e),this.state=t),{clusters:this.clusters,changed:r}}cluster(e){const t=this.getViewportState(e);return this.superCluster.getClusters(t.view,t.zoom).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new z({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new z({markers:[s],position:_.getPosition(s)})}getViewportState(e){const t=e.map.getZoom(),r=e.map.getBounds();return S(t),S(r),{zoom:Math.round(t),view:sr(r,e.mapCanvasProjection,this.viewportPadding)}}}class fr{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,i)=>o+i,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class pr{render({count:e,position:t},r,s){const i=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
29
6
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
30
7
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
31
8
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
32
9
|
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
|
|
33
|
-
</svg>`,c=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(
|
|
10
|
+
</svg>`,c=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(_.isAdvancedMarkerAvailable(s)){const u=new DOMParser().parseFromString(i,"image/svg+xml").documentElement;u.setAttribute("transform","translate(0 25)");const m={map:s,position:t,zIndex:a,title:c,content:u};return new google.maps.marker.AdvancedMarkerElement(m)}const d={position:t,zIndex:a,title:c,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(d)}}function hr(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class le{constructor(){hr(le,google.maps.OverlayView)}}var L;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click",n.GMP_CLICK="gmp-click"})(L||(L={}));const mr=(n,e,t)=>{e.bounds&&t.fitBounds(e.bounds)};class gr extends le{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:s=new ur(r),renderer:o=new pr,onClusterClick:i=mr}){super(),this.map=null,this.idleListener=null,this.markers=[...t],this.clusters=[],this.algorithm=s,this.renderer=o,this.onClusterClick=i,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(r=>{this.addMarker(r,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return r===-1?!1:(_.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(s=>{r=this.removeMarker(s,!0)||r}),r&&!t&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,L.CLUSTERING_BEGIN,this);const{clusters:t,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const s=new Set;for(const i of t)i.markers.length==1&&s.add(i.markers[0]);const o=[];for(const i of this.clusters)i.marker!=null&&(i.markers.length==1?s.has(i.marker)||_.setMap(i.marker,null):o.push(i.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>o.forEach(i=>_.setMap(i,null)))}google.maps.event.trigger(this,L.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();S(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>_.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new fr(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{if(r.markers.length===1)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,e,t),r.markers.forEach(s=>_.setMap(s,null)),this.onClusterClick){const s=_.isAdvancedMarker(r.marker)?L.GMP_CLICK:L.CLUSTER_CLICK;r.marker.addListener(s,o=>{google.maps.event.trigger(this,L.CLUSTER_CLICK,r),this.onClusterClick(o,r,t)})}_.setMap(r.marker,t)})}}const Ze=Object.values(L),yr=l.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:Ze,setup(n,{emit:e,expose:t,slots:r}){const s=l.ref(),o=l.inject(O,l.ref()),i=l.inject(j,l.ref());return l.provide(ee,s),l.watch(o,()=>{o.value&&(s.value=l.markRaw(new gr({map:o.value,algorithm:new dr(n.options.algorithmOptions??{}),...n.options})),Ze.forEach(c=>{var a;(a=s.value)==null||a.addListener(c,d=>e(c,d))}))},{immediate:!0}),l.onBeforeUnmount(()=>{var c;s.value&&((c=i.value)==null||c.event.clearInstanceListeners(s.value),s.value.clearMarkers(),s.value.setMap(null))}),t({markerCluster:s}),()=>{var c;return(c=r.default)==null?void 0:c.call(r)}}}),vr=l.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(n,{slots:e,emit:t,expose:r}){const s=l.ref(),o=l.computed(()=>{var a;return(a=e.default)==null?void 0:a.call(e).some(d=>d.type!==l.Comment)}),i=l.computed(()=>({...n.options,element:s.value})),c=D(W,[],i,t);return r({customMarker:c}),{customMarkerRef:s,customMarker:c,hasSlotContent:o}}}),qr="",wr={key:0,class:"custom-marker-wrapper"};function Er(n,e,t,r,s,o){return n.hasSlotContent?(l.openBlock(),l.createElementBlock("div",wr,[l.createElementVNode("div",l.mergeProps({ref:"customMarkerRef",style:{cursor:n.$attrs.onClick?"pointer":void 0}},n.$attrs),[l.renderSlot(n.$slots,"default",{},void 0,!0)],16)])):l.createCommentVNode("v-if",!0)}const kr=U(vr,[["render",Er],["__scopeId","data-v-4b2eafc1"]]),_r=l.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(n){const e=l.ref(),t=l.inject(O,l.ref()),r=l.inject(j,l.ref());return l.watch([t,()=>n.options],([s,o],[i,c])=>{const a=!F(o,c)||t.value!==i;if(t.value&&r.value&&a){let d;if(o.data&&!(o.data instanceof r.value.MVCArray)){const f=r.value.LatLng,u=o.data.map(m=>m instanceof f||"location"in m&&(m.location instanceof f||m.location===null)?m:"location"in m?{...m,location:new f(m.location)}:new f(m));d={...o,data:u}}else d=o;e.value?e.value.setOptions(d):e.value=l.markRaw(new r.value.visualization.HeatmapLayer({...d,map:t.value}))}},{immediate:!0}),l.onBeforeUnmount(()=>{e.value&&e.value.setMap(null)}),{heatmapLayer:e}},render:()=>null});k.AdvancedMarker=it,k.Circle=dt,k.CustomControl=mt,k.CustomMarker=kr,k.GoogleMap=et,k.HeatmapLayer=_r,k.InfoWindow=wt,k.Marker=at,k.MarkerCluster=yr,k.Polygon=ct,k.Polyline=lt,k.Rectangle=ut,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PropType, type Ref } from "vue";
|
|
2
|
+
export interface IAdvancedMarkerExposed {
|
|
3
|
+
marker: Ref<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
4
|
+
}
|
|
5
|
+
export declare const markerEvents: string[];
|
|
6
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
7
|
options: {
|
|
5
8
|
type: PropType<google.maps.marker.AdvancedMarkerElementOptions>;
|
|
6
9
|
required: true;
|
|
@@ -9,10 +12,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
12
|
type: PropType<google.maps.marker.PinElementOptions>;
|
|
10
13
|
required: false;
|
|
11
14
|
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
markerRef:
|
|
15
|
-
},
|
|
15
|
+
}>, {
|
|
16
|
+
hasCustomSlotContent: import("vue").ComputedRef<boolean | undefined>;
|
|
17
|
+
markerRef: Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
19
|
options: {
|
|
17
20
|
type: PropType<google.maps.marker.AdvancedMarkerElementOptions>;
|
|
18
21
|
required: true;
|
|
@@ -21,7 +24,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
21
24
|
type: PropType<google.maps.marker.PinElementOptions>;
|
|
22
25
|
required: false;
|
|
23
26
|
};
|
|
24
|
-
}>> & {
|
|
27
|
+
}>> & Readonly<{
|
|
25
28
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
26
|
-
}, {}, {}>;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
30
|
export default _default;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/// <reference types="google.maps" />
|
|
2
1
|
import { PropType } from "vue";
|
|
3
|
-
declare const
|
|
2
|
+
export declare const circleEvents: string[];
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
4
|
options: {
|
|
5
5
|
type: PropType<google.maps.CircleOptions>;
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
|
-
}
|
|
9
|
-
circle: import("vue").Ref<google.maps.Circle | undefined>;
|
|
10
|
-
},
|
|
8
|
+
}>, {
|
|
9
|
+
circle: import("vue").Ref<google.maps.Circle | undefined, google.maps.Circle | undefined>;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
11
|
options: {
|
|
12
12
|
type: PropType<google.maps.CircleOptions>;
|
|
13
13
|
required: true;
|
|
14
14
|
};
|
|
15
|
-
}>> & {
|
|
15
|
+
}>> & Readonly<{
|
|
16
16
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
17
|
-
}, {}, {}>;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
18
|
export default _default;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { PropType, Ref } from "vue";
|
|
2
|
-
|
|
2
|
+
import { IControlPosition } from "../@types/index";
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
4
|
position: {
|
|
4
|
-
type: PropType<
|
|
5
|
+
type: PropType<IControlPosition>;
|
|
5
6
|
required: true;
|
|
6
7
|
};
|
|
7
8
|
index: {
|
|
8
9
|
type: NumberConstructor;
|
|
9
10
|
default: number;
|
|
10
11
|
};
|
|
11
|
-
}
|
|
12
|
-
controlRef: Ref<HTMLElement | null>;
|
|
13
|
-
},
|
|
12
|
+
}>, {
|
|
13
|
+
controlRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "content:loaded"[], "content:loaded", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
15
|
position: {
|
|
15
|
-
type: PropType<
|
|
16
|
+
type: PropType<IControlPosition>;
|
|
16
17
|
required: true;
|
|
17
18
|
};
|
|
18
19
|
index: {
|
|
19
20
|
type: NumberConstructor;
|
|
20
21
|
default: number;
|
|
21
22
|
};
|
|
22
|
-
}>> & {
|
|
23
|
+
}>> & Readonly<{
|
|
23
24
|
"onContent:loaded"?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
}
|
|
25
|
+
}>, {
|
|
25
26
|
index: number;
|
|
26
|
-
}, {}>;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
28
|
export default _default;
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
/// <reference path="../shims-google-maps.d.ts" />
|
|
2
|
-
/// <reference types="google.maps" />
|
|
3
1
|
import { PropType } from "vue";
|
|
4
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
3
|
options: {
|
|
6
4
|
type: PropType<google.maps.CustomMarkerOptions>;
|
|
7
5
|
required: true;
|
|
8
6
|
};
|
|
9
|
-
}
|
|
10
|
-
customMarkerRef: import("vue").Ref<HTMLElement | undefined>;
|
|
7
|
+
}>, {
|
|
8
|
+
customMarkerRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
11
9
|
customMarker: import("vue").Ref<(google.maps.OverlayView & {
|
|
12
10
|
getPosition(): google.maps.LatLng | null;
|
|
13
11
|
getVisible(): boolean;
|
|
14
12
|
setOptions(options: google.maps.CustomMarkerOptions): void;
|
|
13
|
+
}) | undefined, (google.maps.OverlayView & {
|
|
14
|
+
getPosition(): google.maps.LatLng | null;
|
|
15
|
+
getVisible(): boolean;
|
|
16
|
+
setOptions(options: google.maps.CustomMarkerOptions): void;
|
|
15
17
|
}) | undefined>;
|
|
16
18
|
hasSlotContent: import("vue").ComputedRef<boolean | undefined>;
|
|
17
|
-
},
|
|
19
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
20
|
options: {
|
|
19
21
|
type: PropType<google.maps.CustomMarkerOptions>;
|
|
20
22
|
required: true;
|
|
21
23
|
};
|
|
22
|
-
}
|
|
24
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
25
|
export default _default;
|