You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
17 KiB
2 lines
17 KiB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./leaflet-src-DKb5ysSI.js","./index-BLqts8WY.js","./index-DJsLjCDx.css"])))=>i.map(i=>d[i]);
|
|
import{U as P,r as g,ao as w,Y as I,ap as L,aq as k,E as j,ar as x,W as le,Z as X,as as Te,at as _,au as Ce,$ as Z,al as Y}from"./index-BLqts8WY.js";const re=(e,t)=>{for(const o of Object.keys(t))e.on(o,t[o])},ue=e=>{for(const t of Object.keys(e)){const o=e[t];o&&R(o.cancel)&&o.cancel()}},_e=e=>!e||typeof e.charAt!="function"?e:e.charAt(0).toUpperCase()+e.slice(1),R=e=>typeof e=="function",N=(e,t,o)=>{for(const n in o){const l="set"+_e(n);e[l]?le(()=>o[n],(a,i)=>{e[l](a,i)}):t[l]&&le(()=>o[n],a=>{t[l](a)})}},S=(e,t,o={})=>{const n={...o};for(const l in e){const a=t[l],i=e[l];a&&(a&&a.custom===!0||i!==void 0&&(n[l]=i))}return n},U=e=>{const t={},o={};for(const n in e)if(n.startsWith("on")&&!n.startsWith("onUpdate")&&n!=="onReady"){const l=n.slice(2).toLocaleLowerCase();t[l]=e[n]}else o[n]=e[n];return{listeners:t,attrs:o}},Be=async e=>{const t=await Promise.all([L(()=>import("./marker-icon-2x-D4k_ikNW.js"),[],import.meta.url),L(()=>import("./marker-icon-C2eJqgqv.js"),[],import.meta.url),L(()=>import("./marker-shadow-DU6CIJ0p.js"),[],import.meta.url)]);delete e.Default.prototype._getIconUrl,e.Default.mergeOptions({iconRetinaUrl:t[0].default,iconUrl:t[1].default,shadowUrl:t[2].default})},G=e=>{const t=g((...n)=>console.warn(`Method ${e} has been invoked without being replaced`)),o=(...n)=>t.value(...n);return o.wrapped=t,_(e,o),o},W=(e,t)=>e.wrapped.value=t,B=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||globalThis,O=e=>{const t=w(e);if(t===void 0)throw new Error(`Attempt to inject ${e.description} before it was provided.`);return t},E=Symbol("useGlobalLeaflet"),V=Symbol("addLayer"),Q=Symbol("removeLayer"),de=Symbol("registerControl"),Re=Symbol("registerLayerControl"),pe=Symbol("canSetParentHtml"),ce=Symbol("setParentHtml"),fe=Symbol("setIcon"),je=Symbol("bindPopup"),Pe=Symbol("bindTooltip"),we=Symbol("unbindPopup"),Ie=Symbol("unbindTooltip"),F={options:{type:Object,default:()=>({}),custom:!0}},H=e=>({options:e.options,methods:{}}),M={...F,pane:{type:String},attribution:{type:String},name:{type:String,custom:!0},layerType:{type:String,custom:!0},visible:{type:Boolean,custom:!0,default:!0}},ee=(e,t,o)=>{const n=O(V),l=O(Q),{options:a,methods:i}=H(e),s=S(e,M,a),r=()=>n({leafletObject:t.value}),p=()=>l({leafletObject:t.value}),d={...i,setAttribution(c){p(),t.value.options.attribution=c,e.visible&&r()},setName(){p(),e.visible&&r()},setLayerType(){p(),e.visible&&r()},setVisible(c){t.value&&(c?r():p())},bindPopup(c){if(!t.value||!R(t.value.bindPopup)){console.warn("Attempt to bind popup before bindPopup method available on layer.");return}t.value.bindPopup(c)},bindTooltip(c){if(!t.value||!R(t.value.bindTooltip)){console.warn("Attempt to bind tooltip before bindTooltip method available on layer.");return}t.value.bindTooltip(c)},unbindTooltip(){t.value&&(R(t.value.closeTooltip)&&t.value.closeTooltip(),R(t.value.unbindTooltip)&&t.value.unbindTooltip())},unbindPopup(){t.value&&(R(t.value.closePopup)&&t.value.closePopup(),R(t.value.unbindPopup)&&t.value.unbindPopup())},updateVisibleProp(c){o.emit("update:visible",c)}};return _(je,d.bindPopup),_(Pe,d.bindTooltip),_(we,d.unbindPopup),_(Ie,d.unbindTooltip),X(()=>{d.unbindPopup(),d.unbindTooltip(),p()}),{options:s,methods:d}},ye=(e,t)=>{if(e&&t.default)return x("div",{style:{display:"none"}},t.default())},me={...M,interactive:{type:Boolean,default:void 0},bubblingMouseEvents:{type:Boolean,default:void 0}},Ne=(e,t,o)=>{const{options:n,methods:l}=ee(e,t,o);return{options:S(e,me,n),methods:l}},te={...me,stroke:{type:Boolean,default:void 0},color:{type:String},weight:{type:Number},opacity:{type:Number},lineCap:{type:String},lineJoin:{type:String},dashArray:{type:String},dashOffset:{type:String},fill:{type:Boolean,default:void 0},fillColor:{type:String},fillOpacity:{type:Number},fillRule:{type:String},className:{type:String}},Ee=(e,t,o)=>{const{options:n,methods:l}=Ne(e,t,o),a=S(e,te,n),i=O(Q),s={...l,setStroke(r){t.value.setStyle({stroke:r})},setColor(r){t.value.setStyle({color:r})},setWeight(r){t.value.setStyle({weight:r})},setOpacity(r){t.value.setStyle({opacity:r})},setLineCap(r){t.value.setStyle({lineCap:r})},setLineJoin(r){t.value.setStyle({lineJoin:r})},setDashArray(r){t.value.setStyle({dashArray:r})},setDashOffset(r){t.value.setStyle({dashOffset:r})},setFill(r){t.value.setStyle({fill:r})},setFillColor(r){t.value.setStyle({fillColor:r})},setFillOpacity(r){t.value.setStyle({fillOpacity:r})},setFillRule(r){t.value.setStyle({fillRule:r})},setClassName(r){t.value.setStyle({className:r})}};return Y(()=>{i({leafletObject:t.value})}),{options:a,methods:s}},De={...te,radius:{type:Number},latLng:{type:[Object,Array],required:!0,custom:!0}};({...De});const $={...F,position:{type:String}},ze=(e,t)=>{const{options:o,methods:n}=H(e),l=S(e,$,o),a={...n,setPosition(i){t.value&&t.value.setPosition(i)}};return X(()=>{t.value&&t.value.remove()}),{options:l,methods:a}},ke=e=>e.default?x("div",{ref:"root"},e.default()):null;P({name:"LControl",props:{...$,disableClickPropagation:{type:Boolean,custom:!0,default:!0},disableScrollPropagation:{type:Boolean,custom:!0,default:!1}},setup(e,t){const o=g(),n=g(),l=w(E),a=O(de),{options:i,methods:s}=ze(e,o);return I(async()=>{const{Control:r,DomEvent:p}=l?B.L:await L(()=>import("./leaflet-src.esm-HdBnhJze.js"),[],import.meta.url),d=r.extend({onAdd(){return n.value}});o.value=k(new d(i)),N(s,o.value,e),a({leafletObject:o.value}),e.disableClickPropagation&&n.value&&p.disableClickPropagation(n.value),e.disableScrollPropagation&&n.value&&p.disableScrollPropagation(n.value),j(()=>t.emit("ready",o.value))}),{root:n,leafletObject:o}},render(){return ke(this.$slots)}});({...$});({...$});({...$});({...$});const be={...M};({...be});({...be});const ne={...M,opacity:{type:Number},zIndex:{type:Number},tileSize:{type:[Number,Array,Object]},noWrap:{type:Boolean,default:void 0},minZoom:{type:Number},maxZoom:{type:Number},className:{type:String}},ve=(e,t,o)=>{const{options:n,methods:l}=ee(e,t,o),a=S(e,ne,n),i={...l,setTileComponent(){var s;(s=t.value)==null||s.redraw()}};return X(()=>{t.value.off()}),{options:a,methods:i}},xe=(e,t,o,n)=>e.extend({initialize(l){this.tileComponents={},this.on("tileunload",this._unloadTile),o.setOptions(this,l)},createTile(l){const a=this._tileCoordsToKey(l);this.tileComponents[a]=t.create("div");const i=x({setup:n,props:["coords"]},{coords:l});return Te(i,this.tileComponents[a]),this.tileComponents[a]},_unloadTile(l){const a=this._tileCoordsToKey(l.coords);this.tileComponents[a]&&(this.tileComponents[a].innerHTML="",this.tileComponents[a]=void 0)}});P({props:{...ne,childRender:{type:Function,required:!0}},setup(e,t){const o=g(),n=g(null),l=g(!1),a=w(E),i=O(V),{options:s,methods:r}=ve(e,o,t);return I(async()=>{const{GridLayer:p,DomUtil:d,Util:c}=a?B.L:await L(()=>import("./leaflet-src.esm-HdBnhJze.js"),[],import.meta.url),v=xe(p,d,c,e.childRender);o.value=k(new v(s));const{listeners:f}=U(t.attrs);o.value.on(f),N(r,o.value,e),i({...e,...r,leafletObject:o.value}),l.value=!0,j(()=>t.emit("ready",o.value))}),{root:n,ready:l,leafletObject:o}},render(){return this.ready?x("div",{style:{display:"none"},ref:"root"}):null}});const se={iconUrl:{type:String},iconRetinaUrl:{type:String},iconSize:{type:[Object,Array]},iconAnchor:{type:[Object,Array]},popupAnchor:{type:[Object,Array]},tooltipAnchor:{type:[Object,Array]},shadowUrl:{type:String},shadowRetinaUrl:{type:String},shadowSize:{type:[Object,Array]},shadowAnchor:{type:[Object,Array]},bgPos:{type:[Object,Array]},className:{type:String}};P({name:"LIcon",props:{...se,...F},setup(e,t){const o=g(),n=w(E),l=O(pe),a=O(ce),i=O(fe);let s,r,p,d,c;const v=(T,m,b)=>{const h=T&&T.innerHTML;if(!m){b&&c&&l()&&a(h);return}const{listeners:z}=U(t.attrs);c&&r(c,z);const{options:J}=H(e),C=S(e,se,J);h&&(C.html=h),c=C.html?p(C):d(C),s(c,z),i(c)},f=()=>{j(()=>v(o.value,!0,!1))},A=()=>{j(()=>v(o.value,!1,!0))},D={setIconUrl:f,setIconRetinaUrl:f,setIconSize:f,setIconAnchor:f,setPopupAnchor:f,setTooltipAnchor:f,setShadowUrl:f,setShadowRetinaUrl:f,setShadowAnchor:f,setBgPos:f,setClassName:f,setHtml:f};return I(async()=>{const{DomEvent:T,divIcon:m,icon:b}=n?B.L:await L(()=>import("./leaflet-src.esm-HdBnhJze.js"),[],import.meta.url);s=T.on,r=T.off,p=m,d=b,N(D,{},e),new MutationObserver(A).observe(o.value,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),f()}),{root:o}},render(){const e=this.$slots.default?this.$slots.default():void 0;return x("div",{ref:"root"},e)}});({...M});function ge(e,t,o){var n,l,a;t===void 0&&(t=50),o===void 0&&(o={});var i=(n=o.isImmediate)!=null&&n,s=(l=o.callback)!=null&&l,r=o.maxWait,p=Date.now(),d=[];function c(){if(r!==void 0){var f=Date.now()-p;if(f+t>=r)return r-f}return t}var v=function(){var f=[].slice.call(arguments),A=this;return new Promise(function(D,T){var m=i&&a===void 0;if(a!==void 0&&clearTimeout(a),a=setTimeout(function(){if(a=void 0,p=Date.now(),!i){var h=e.apply(A,f);s&&s(h),d.forEach(function(z){return(0,z.resolve)(h)}),d=[]}},c()),m){var b=e.apply(A,f);return s&&s(b),D(b)}d.push({resolve:D,reject:T})})};return v.cancel=function(f){a!==void 0&&clearTimeout(a),d.forEach(function(A){return(0,A.reject)(f)}),d=[]},v}const ie={...F,center:{type:[Object,Array]},bounds:{type:[Array,Object]},maxBounds:{type:[Array,Object]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},paddingBottomRight:{type:[Object,Array]},paddingTopLeft:{type:Object},padding:{type:Object},worldCopyJump:{type:Boolean,default:void 0},crs:{type:[String,Object]},maxBoundsViscosity:{type:Number},inertia:{type:Boolean,default:void 0},inertiaDeceleration:{type:Number},inertiaMaxSpeed:{type:Number},easeLinearity:{type:Number},zoomAnimation:{type:Boolean,default:void 0},zoomAnimationThreshold:{type:Number},fadeAnimation:{type:Boolean,default:void 0},markerZoomAnimation:{type:Boolean,default:void 0},noBlockingAnimations:{type:Boolean,default:void 0},useGlobalLeaflet:{type:Boolean,default:!0,custom:!0}},Je=P({inheritAttrs:!1,emits:["ready","update:zoom","update:center","update:bounds"],props:ie,setup(e,t){const o=g(),n=Ce({ready:!1,layersToAdd:[],layersInControl:[]}),{options:l}=H(e),a=S(e,ie,l),{listeners:i,attrs:s}=U(t.attrs),r=G(V),p=G(Q),d=G(de),c=G(Re);_(E,e.useGlobalLeaflet);const v=Z(()=>{const m={};return e.noBlockingAnimations&&(m.animate=!1),m}),f=Z(()=>{const m=v.value;return e.padding&&(m.padding=e.padding),e.paddingTopLeft&&(m.paddingTopLeft=e.paddingTopLeft),e.paddingBottomRight&&(m.paddingBottomRight=e.paddingBottomRight),m}),A={moveend:ge(m=>{n.leafletRef&&(t.emit("update:zoom",n.leafletRef.getZoom()),t.emit("update:center",n.leafletRef.getCenter()),t.emit("update:bounds",n.leafletRef.getBounds()))}),overlayadd(m){const b=n.layersInControl.find(h=>h.name===m.name);b&&b.updateVisibleProp(!0)},overlayremove(m){const b=n.layersInControl.find(h=>h.name===m.name);b&&b.updateVisibleProp(!1)}};I(async()=>{e.useGlobalLeaflet&&(B.L=B.L||await L(()=>import("./leaflet-src-DKb5ysSI.js").then(u=>u.l),__vite__mapDeps([0,1,2]),import.meta.url));const{map:m,CRS:b,Icon:h,latLngBounds:z,latLng:J,stamp:C}=e.useGlobalLeaflet?B.L:await L(()=>import("./leaflet-src.esm-HdBnhJze.js"),[],import.meta.url);try{a.beforeMapMount&&await a.beforeMapMount()}catch(u){console.error(`The following error occurred running the provided beforeMapMount hook ${u.message}`)}await Be(h);const Ae=typeof a.crs=="string"?b[a.crs]:a.crs;a.crs=Ae||b.EPSG3857;const q={addLayer(u){u.layerType!==void 0&&(n.layerControl===void 0?n.layersToAdd.push(u):n.layersInControl.find(y=>C(y.leafletObject)===C(u.leafletObject))||(n.layerControl.addLayer(u),n.layersInControl.push(u))),u.visible!==!1&&n.leafletRef.addLayer(u.leafletObject)},removeLayer(u){u.layerType!==void 0&&(n.layerControl===void 0?n.layersToAdd=n.layersToAdd.filter(y=>y.name!==u.name):(n.layerControl.removeLayer(u.leafletObject),n.layersInControl=n.layersInControl.filter(y=>C(y.leafletObject)!==C(u.leafletObject)))),n.leafletRef.removeLayer(u.leafletObject)},registerLayerControl(u){n.layerControl=u,n.layersToAdd.forEach(y=>{n.layerControl.addLayer(y)}),n.layersToAdd=[],d(u)},registerControl(u){n.leafletRef.addControl(u.leafletObject)},setZoom(u){const y=n.leafletRef.getZoom();u!==y&&n.leafletRef.setZoom(u,v.value)},setCrs(u){const y=n.leafletRef.getBounds();n.leafletRef.options.crs=u,n.leafletRef.fitBounds(y,{animate:!1,padding:[0,0]})},fitBounds(u){n.leafletRef.fitBounds(u,f.value)},setBounds(u){if(!u)return;const y=z(u);y.isValid()&&!(n.lastSetBounds||n.leafletRef.getBounds()).equals(y,0)&&(n.lastSetBounds=y,n.leafletRef.fitBounds(y))},setCenter(u){if(u==null)return;const y=J(u),ae=n.lastSetCenter||n.leafletRef.getCenter();(ae.lat!==y.lat||ae.lng!==y.lng)&&(n.lastSetCenter=y,n.leafletRef.panTo(y,v.value))}};W(r,q.addLayer),W(p,q.removeLayer),W(d,q.registerControl),W(c,q.registerLayerControl),n.leafletRef=k(m(o.value,a)),N(q,n.leafletRef,e),re(n.leafletRef,A),re(n.leafletRef,i),n.ready=!0,j(()=>t.emit("ready",n.leafletRef))}),Y(()=>{ue(A),n.leafletRef&&(n.leafletRef.off(),n.leafletRef.remove())});const D=Z(()=>n.leafletRef),T=Z(()=>n.ready);return{root:o,ready:T,leafletObject:D,attrs:s}},render({attrs:e}){return e.style||(e.style={}),e.style.width||(e.style.width="100%"),e.style.height||(e.style.height="100%"),x("div",{...e,ref:"root"},this.ready&&this.$slots.default?this.$slots.default():{})}}),Ue=["Symbol(Comment)","Symbol(Text)"],Ve=["LTooltip","LPopup"],he={...M,draggable:{type:Boolean,default:void 0},icon:{type:[Object]},zIndexOffset:{type:Number},latLng:{type:[Object,Array],custom:!0,required:!0}},Me=(e,t,o)=>{const{options:n,methods:l}=ee(e,t,o),a=S(e,he,n),i={...l,setDraggable(s){t.value.dragging&&(s?t.value.dragging.enable():t.value.dragging.disable())},latLngSync(s){o.emit("update:latLng",s.latlng),o.emit("update:lat-lng",s.latlng)},setLatLng(s){if(s!=null&&t.value){const r=t.value.getLatLng();(!r||!r.equals(s))&&t.value.setLatLng(s)}}};return{options:a,methods:i}},$e=(e,t)=>{const o=t.slots.default&&t.slots.default();return o&&o.length&&o.some(qe)};function qe(e){return!(Ue.includes(e.type.toString())||Ve.includes(e.type.name))}const Ke=P({name:"LMarker",props:he,setup(e,t){const o=g(),n=g(!1),l=w(E),a=O(V);_(pe,()=>{var p;return!!((p=o.value)!=null&&p.getElement())}),_(ce,p=>{var d,c;const v=R((d=o.value)==null?void 0:d.getElement)&&((c=o.value)==null?void 0:c.getElement());v&&(v.innerHTML=p)}),_(fe,p=>{var d;return((d=o.value)==null?void 0:d.setIcon)&&o.value.setIcon(p)});const{options:i,methods:s}=Me(e,o,t),r={moveHandler:ge(s.latLngSync)};return I(async()=>{const{marker:p,divIcon:d}=l?B.L:await L(()=>import("./leaflet-src.esm-HdBnhJze.js"),[],import.meta.url);$e(i,t)&&(i.icon=d({className:""})),o.value=k(p(e.latLng,i));const{listeners:c}=U(t.attrs);o.value.on(c),o.value.on("move",r.moveHandler),N(s,o.value,e),a({...e,...s,leafletObject:o.value}),n.value=!0,j(()=>t.emit("ready",o.value))}),Y(()=>ue(r)),{ready:n,leafletObject:o}},render(){return ye(this.ready,this.$slots)}}),Se={...te,smoothFactor:{type:Number},noClip:{type:Boolean,default:void 0},latLngs:{type:Array,required:!0,custom:!0}},Fe=(e,t,o)=>{const{options:n,methods:l}=Ee(e,t,o),a=S(e,Se,n),i={...l,setSmoothFactor(s){t.value.setStyle({smoothFactor:s})},setNoClip(s){t.value.setStyle({noClip:s})},addLatLng(s){t.value.addLatLng(s)}};return{options:a,methods:i}},K={...Se},Ze=(e,t,o)=>{const{options:n,methods:l}=Fe(e,t,o),a=S(e,K,n),i={...l,toGeoJSON(s){return t.value.toGeoJSON(s)}};return{options:a,methods:i}},Le={...F,content:{type:String,default:null}};({...Le});const Oe={...K,latLngs:{...K.latLngs,required:!1},bounds:{type:Object,custom:!0}},Ge=(e,t,o)=>{const{options:n,methods:l}=Ze(e,t,o),a=S(e,Oe,n),i={...l,setBounds(s){t.value.setBounds(s)},setLatLngs(s){t.value.setBounds(s)}};return{options:a,methods:i}},Xe=P({name:"LRectangle",props:Oe,setup(e,t){const o=g(),n=g(!1),l=w(E),a=O(V),{options:i,methods:s}=Ge(e,o,t);return I(async()=>{const{rectangle:r,latLngBounds:p}=l?B.L:await L(()=>import("./leaflet-src.esm-HdBnhJze.js"),[],import.meta.url),d=e.bounds?p(e.bounds):p(e.latLngs||[]);o.value=k(r(d,i));const{listeners:c}=U(t.attrs);o.value.on(c),N(s,o.value,e),a({...e,...s,leafletObject:o.value}),n.value=!0,j(()=>t.emit("ready",o.value))}),{ready:n,leafletObject:o}},render(){return ye(this.ready,this.$slots)}}),oe={...ne,tms:{type:Boolean,default:void 0},subdomains:{type:[String,Array],validator:e=>typeof e=="string"?!0:Array.isArray(e)?e.every(t=>typeof t=="string"):!1},detectRetina:{type:Boolean,default:void 0},url:{type:String,required:!0,custom:!0}},We=(e,t,o)=>{const{options:n,methods:l}=ve(e,t,o),a=S(e,oe,n),i={...l};return{options:a,methods:i}},Ye=P({props:oe,setup(e,t){const o=g(),n=w(E),l=O(V),{options:a,methods:i}=We(e,o,t);return I(async()=>{const{tileLayer:s}=n?B.L:await L(()=>import("./leaflet-src.esm-HdBnhJze.js"),[],import.meta.url);o.value=k(s(e.url,a));const{listeners:r}=U(t.attrs);o.value.on(r),N(i,o.value,e),l({...e,...i,leafletObject:o.value}),j(()=>t.emit("ready",o.value))}),{leafletObject:o}},render(){return null}});({...Le});({...oe});export{Je as i,Xe as m,Ke as u,Ye as v};
|
|
|