vue3-google-map 0.22.0 → 0.23.0
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 +79 -9
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +140 -134
- package/dist/index.umd.js +3 -3
- package/dist/types/components/AdvancedMarker.vue.d.ts +1 -1
- package/dist/types/components/HeatmapLayer.d.ts +5 -0
- package/dist/types/components/Marker.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-7e597c12]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-268ef28d]{display:none}.mapdiv .custom-control-wrapper[data-v-268ef28d]{display:inline-block}.info-window-wrapper[data-v-f929b615]{display:none}.mapdiv .info-window-wrapper[data-v-f929b615]{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(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"),
|
|
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"),T=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
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
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}/*! *****************************************************************************
|
|
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 x{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,x.instance){if(!Pe(this.options,x.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(x.instance.options)}`);return x.instance}x.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(T,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 x({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 Te(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var xe=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=Te(xe),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.content)==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(T,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}),{hasCustomSlotContent:s,markerRef:r}}}),bt="",$e={key:0,class:"advanced-marker-wrapper"};function je(o,e,t,n,r,s){return i.openBlock(),i.createElementBlock(i.Fragment,null,[o.hasCustomSlotContent?(i.openBlock(),i.createElementBlock("div",$e,[i.createElementVNode("div",i.mergeProps({ref:"markerRef"},o.$attrs),[i.renderSlot(o.$slots,"content")],16)])):i.createCommentVNode("",!0),i.renderSlot(o.$slots,"default")],64)}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(T,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(T,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(T,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
16
|
Copyright (c) Microsoft Corporation.
|
|
17
17
|
|
|
18
18
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
31
31
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
32
32
|
<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(C.isAdvancedMarkerAvailable(r)){const d=document.createElement("div");d.innerHTML=l;const u=d.firstElementChild;u.setAttribute("transform","translate(0 25)");const p={map:r,position:t,zIndex:a,title:c,content:u};return new google.maps.marker.AdvancedMarkerElement(p)}const h={position:t,zIndex:a,title:c,icon:{url:`data:image/svg+xml;base64,${btoa(l)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(h)}}function ht(o,e){for(let t in e.prototype)o.prototype[t]=e.prototype[t]}class te{constructor(){ht(te,google.maps.OverlayView)}}var q;(function(o){o.CLUSTERING_BEGIN="clusteringbegin",o.CLUSTERING_END="clusteringend",o.CLUSTER_CLICK="click"})(q||(q={}));const pt=(o,e,t)=>{t.fitBounds(e.bounds)};class ft extends te{constructor({map:e,markers:t=[],algorithmOptions:n={},algorithm:r=new lt(n),renderer:s=new dt,onClusterClick:l=pt}){super(),this.markers=[...t],this.clusters=[],this.algorithm=r,this.renderer=s,this.onClusterClick=l,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(n=>{this.addMarker(n,!0)}),t||this.render()}removeMarker(e,t){const n=this.markers.indexOf(e);return n===-1?!1:(C.setMap(e,null),this.markers.splice(n,1),t||this.render(),!0)}removeMarkers(e,t){let n=!1;return e.forEach(r=>{n=this.removeMarker(r,!0)||n}),n&&!t&&this.render(),n}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,q.CLUSTERING_BEGIN,this);const{clusters:t,changed:n}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(n||n==null){const r=new Set;for(const l of t)l.markers.length==1&&r.add(l.markers[0]);const s=[];for(const l of this.clusters)l.marker!=null&&(l.markers.length==1?r.has(l.marker)||C.setMap(l.marker,null):s.push(l.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>s.forEach(l=>C.setMap(l,null)))}google.maps.event.trigger(this,q.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>C.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new ut(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(n=>{n.markers.length===1?n.marker=n.markers[0]:(n.marker=this.renderer.render(n,e,t),n.markers.forEach(r=>C.setMap(r,null)),this.onClusterClick&&n.marker.addListener("click",r=>{google.maps.event.trigger(this,q.CLUSTER_CLICK,n),this.onClusterClick(r,n,t)})),C.setMap(n.marker,t)})}}const be=Object.values(q),mt=i.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:be,setup(o,{emit:e,expose:t,slots:n}){const r=i.ref(),s=i.inject(P,i.ref()),l=i.inject(
|
|
33
|
+
</svg>`,c=`Cluster of ${e} markers`,a=Number(google.maps.Marker.MAX_ZINDEX)+e;if(C.isAdvancedMarkerAvailable(r)){const d=document.createElement("div");d.innerHTML=l;const u=d.firstElementChild;u.setAttribute("transform","translate(0 25)");const p={map:r,position:t,zIndex:a,title:c,content:u};return new google.maps.marker.AdvancedMarkerElement(p)}const h={position:t,zIndex:a,title:c,icon:{url:`data:image/svg+xml;base64,${btoa(l)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(h)}}function ht(o,e){for(let t in e.prototype)o.prototype[t]=e.prototype[t]}class te{constructor(){ht(te,google.maps.OverlayView)}}var q;(function(o){o.CLUSTERING_BEGIN="clusteringbegin",o.CLUSTERING_END="clusteringend",o.CLUSTER_CLICK="click"})(q||(q={}));const pt=(o,e,t)=>{t.fitBounds(e.bounds)};class ft extends te{constructor({map:e,markers:t=[],algorithmOptions:n={},algorithm:r=new lt(n),renderer:s=new dt,onClusterClick:l=pt}){super(),this.markers=[...t],this.clusters=[],this.algorithm=r,this.renderer=s,this.onClusterClick=l,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(n=>{this.addMarker(n,!0)}),t||this.render()}removeMarker(e,t){const n=this.markers.indexOf(e);return n===-1?!1:(C.setMap(e,null),this.markers.splice(n,1),t||this.render(),!0)}removeMarkers(e,t){let n=!1;return e.forEach(r=>{n=this.removeMarker(r,!0)||n}),n&&!t&&this.render(),n}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,q.CLUSTERING_BEGIN,this);const{clusters:t,changed:n}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(n||n==null){const r=new Set;for(const l of t)l.markers.length==1&&r.add(l.markers[0]);const s=[];for(const l of this.clusters)l.marker!=null&&(l.markers.length==1?r.has(l.marker)||C.setMap(l.marker,null):s.push(l.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>s.forEach(l=>C.setMap(l,null)))}google.maps.event.trigger(this,q.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>C.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new ut(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(n=>{n.markers.length===1?n.marker=n.markers[0]:(n.marker=this.renderer.render(n,e,t),n.markers.forEach(r=>C.setMap(r,null)),this.onClusterClick&&n.marker.addListener("click",r=>{google.maps.event.trigger(this,q.CLUSTER_CLICK,n),this.onClusterClick(r,n,t)})),C.setMap(n.marker,t)})}}const be=Object.values(q),mt=i.defineComponent({name:"MarkerCluster",props:{options:{type:Object,default:()=>({})}},emits:be,setup(o,{emit:e,expose:t,slots:n}){const r=i.ref(),s=i.inject(P,i.ref()),l=i.inject(T,i.ref());return i.provide(W,r),i.watch(s,()=>{s.value&&(r.value=i.markRaw(new ft({map:s.value,algorithm:new ct(o.options.algorithmOptions??{}),...o.options})),be.forEach(c=>{var a;(a=r.value)==null||a.addListener(c,h=>e(c,h))}))},{immediate:!0}),i.onBeforeUnmount(()=>{var c;r.value&&((c=l.value)==null||c.event.clearInstanceListeners(r.value),r.value.clearMarkers(),r.value.setMap(null))}),t({markerCluster:r}),()=>{var c;return(c=n.default)==null?void 0:c.call(n)}}}),gt=i.defineComponent({inheritAttrs:!1,props:{options:{type:Object,required:!0}},setup(o,{slots:e,emit:t,expose:n}){const r=i.ref(),s=i.computed(()=>{var a;return(a=e.default)==null?void 0:a.call(e).some(h=>h.type!==i.Comment)}),l=i.computed(()=>({...o.options,element:r.value})),c=B(F,[],l,t);return n({customMarker:c}),{customMarkerRef:r,customMarker:c,hasSlotContent:s}}}),Ot="",yt={key:0,class:"custom-marker-wrapper"};function vt(o,e,t,n,r,s){return o.hasSlotContent?(i.openBlock(),i.createElementBlock("div",yt,[i.createElementVNode("div",i.mergeProps({ref:"customMarkerRef",style:{cursor:o.$attrs.onClick?"pointer":void 0}},o.$attrs),[i.renderSlot(o.$slots,"default",{},void 0,!0)],16)])):i.createCommentVNode("",!0)}const wt=N(gt,[["render",vt],["__scopeId","data-v-4b2eafc1"]]),kt=i.defineComponent({name:"HeatmapLayer",props:{options:{type:Object,default:()=>({})}},setup(o){const e=i.ref(),t=i.inject(P,i.ref()),n=i.inject(T,i.ref());return i.watch([t,()=>o.options],([r,s],[l,c])=>{const a=!S(s,c)||t.value!==l;if(t.value&&n.value&&a){let h;if(s.data&&!(s.data instanceof n.value.MVCArray)){const d=n.value.LatLng,u=s.data.map(p=>p instanceof d||"location"in p&&(p.location instanceof d||p.location===null)?p:"location"in p?{...p,location:new d(p.location)}:new d(p));h={...s,data:u}}else h=s;e.value?e.value.setOptions(h):e.value=i.markRaw(new n.value.visualization.HeatmapLayer({...h,map:t.value}))}},{immediate:!0}),i.onBeforeUnmount(()=>{e.value&&e.value.setMap(null)}),{heatmapLayer:e}},render:()=>null});w.AdvancedMarker=Be,w.Circle=Ve,w.CustomControl=We,w.CustomMarker=wt,w.GoogleMap=Ie,w.HeatmapLayer=kt,w.InfoWindow=Xe,w.Marker=Ze,w.MarkerCluster=mt,w.Polygon=De,w.Polyline=Ue,w.Rectangle=Fe,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -10,7 +10,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10
10
|
required: false;
|
|
11
11
|
};
|
|
12
12
|
}, {
|
|
13
|
-
|
|
13
|
+
hasCustomSlotContent: import("vue").ComputedRef<boolean | undefined>;
|
|
14
14
|
markerRef: import("vue").Ref<HTMLElement | undefined>;
|
|
15
15
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
16
|
options: {
|
|
@@ -6,6 +6,11 @@ interface ExtendedHeatmapLayerOptions extends Omit<HeatmapLayerOptions, "data">
|
|
|
6
6
|
location: google.maps.LatLngLiteral;
|
|
7
7
|
})[];
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated The HeatmapLayer component was deprecated on May 27, 2025 and will be sunset in May 2026.
|
|
11
|
+
* Google recommends migrating to third-party library integrations like deck.gl, which offers a HeatmapLayer implementation.
|
|
12
|
+
* @see {@link https://developers.google.com/maps/deprecations} for more information.
|
|
13
|
+
*/
|
|
9
14
|
declare const _default: import("vue").DefineComponent<{
|
|
10
15
|
options: {
|
|
11
16
|
type: PropType<ExtendedHeatmapLayerOptions>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
2
|
import { PropType } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The Marker component is deprecated as of February 2024. Use AdvancedMarker instead.
|
|
5
|
+
* The google.maps.Marker API is deprecated and will be removed in a future version.
|
|
6
|
+
* Migrate to AdvancedMarker for the latest features and better performance.
|
|
7
|
+
* @see {@link https://developers.google.com/maps/deprecations} for more information.
|
|
8
|
+
*/
|
|
3
9
|
declare const _default: import("vue").DefineComponent<{
|
|
4
10
|
options: {
|
|
5
11
|
type: PropType<google.maps.MarkerOptions>;
|