@nextgis/leaflet-map-adapter 2.0.0-alpha.1 → 2.0.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/lib/leaflet-map-adapter.esm-browser.js +3 -2
- package/lib/leaflet-map-adapter.esm-browser.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-browser.prod.js +1 -1
- package/lib/leaflet-map-adapter.esm-browser.prod.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.js +3 -2
- package/lib/leaflet-map-adapter.esm-bundler.js.map +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.prod.js +1 -1
- package/lib/leaflet-map-adapter.esm-bundler.prod.js.map +1 -1
- package/lib/leaflet-map-adapter.global.js +3 -2
- package/lib/leaflet-map-adapter.global.js.map +1 -1
- package/lib/leaflet-map-adapter.global.prod.js +1 -1
- package/lib/leaflet-map-adapter.global.prod.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{EventEmitter as t}from"events";import{Control as e,DomEvent as s,GeoJSON as o,DivIcon as i,Marker as r,CircleMarker as n,FeatureGroup as a,ImageOverlay as l,Layer as p,Util as c,CRS as h,GridLayer as u,DomUtil as d,TileLayer as m,Map as y}from"leaflet";import{defined as f,debounce as v}from"@nextgis/utils";import{isPaintCallback as b,isPaint as _}from"@nextgis/paint";function g(t,o={},i){return new(e.extend({onAdd(){const e=document.createElement("div"),r=t.onAdd(i);return e.classList.add("leaflet-control"),o.bar&&e.classList.add("leaflet-bar"),o.addClass&&e.classList.add(o.addClass),o.margin||o.bar||(e.style.marginBottom="0px",e.style.marginTop="0px",e.style.marginLeft="0px",e.style.marginRight="0px"),r&&e.appendChild(r),s.disableClickPropagation(e),e},onRemove(){t.onRemove()}}))}function O(t){const e=t.getNorthEast(),s=t.getSouthWest();return[s.lng,s.lat,e.lng,e.lat]}function P(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let s="";for(const o in e){e[o]>(s?e[s]:0)&&(s=o)}return s}const w={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},L={stroke:!1,opacity:1},C={};for(const ae in w){const t=w[ae],e=C[t]||[];e.push(ae),C[t]=e}function x(t,e){return-1!==(C[e]||[]).indexOf(t)}function j(t){const e=new o;return(Array.isArray(t)?t:[t]).forEach((t=>e.addData(t))),e.getBounds()}function M(t){return{getBounds:()=>function(t){return O(j(t))}(t),getCenter:()=>function(t){const{lat:e,lng:s}=j(t).getCenter();return[s,e]}(t)}}var S=Object.defineProperty,E=(t,e,s)=>(((t,e,s)=>{e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s);class T{constructor(t,e){if(this.map=t,this.options=e,E(this,"layer"),E(this,"pane","order-0"),void 0!==e.order){const s="order-"+e.order;let o=t.getPane(s);o||(o=t.createPane(s)),o.style.zIndex=String(Math.round(100*e.order)),this.pane=s}}addLayer(t){Object.assign(this.options,t)}}function k(t){const e=t.containerPoint,s=t.latlng,{lat:o,lng:i}=s;return{latLng:s,lngLat:[i,o],pixel:{left:e.x,top:e.y},source:t}}var Z=Object.defineProperty,B=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,A=(t,e,s)=>e in t?Z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;function U({layer:t,source:e}){const s=e.target.feature;return((t,e)=>{for(var s in e||(e={}))z.call(e,s)&&A(t,s,e[s]);if(B)for(var s of B(e))I.call(e,s)&&A(t,s,e[s]);return t})({layer:t,feature:s,event:k(e),source:e},M(s))}var W=Object.defineProperty,D=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,N=(t,e,s)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,V=(t,e,s)=>(N(t,"symbol"!=typeof e?e+"":e,s),s);class ${constructor(t){V(this,"layer"),V(this,"_onclick"),V(this,"_mouseout"),V(this,"_mouseover"),this.layer=t}handleMouseEvents(t){const{onClick:e,onLayerClick:s,onMouseOut:o,onMouseOver:i}=this.layer.options,r=e||s;r&&(this._onclick=e=>{const s=!!this.layer._getSelected(t);r(((t,e)=>{for(var s in e||(e={}))F.call(e,s)&&N(t,s,e[s]);if(D)for(var s of D(e))R.call(e,s)&&N(t,s,e[s]);return t})({selected:s},this._createMouseEvent(e)))},t.on("click",this._onclick,this)),o&&(this._mouseout=t=>{o(this._createMouseEvent(t))},t.on("mouseout",this._mouseout,this)),i&&(this._mouseover=t=>{i(this._createMouseEvent(t))},t.on("mouseover",this._mouseover,this))}stopMouseEvents(t){this._mouseover&&t.off("mouseover",this._mouseover,this),this._mouseout&&t.off("mouseout",this._mouseout,this),this._onclick&&t.off("click",this._onclick,this)}_createMouseEvent(t){return U({layer:this.layer,source:t})}}var G=Object.defineProperty,H=Object.defineProperties,q=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,Q=(t,e,s)=>e in t?G(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Y=(t,e)=>{for(var s in e||(e={}))X.call(e,s)&&Q(t,s,e[s]);if(J)for(var s of J(e))K.call(e,s)&&Q(t,s,e[s]);return t};class tt{constructor(t){var e,s;Q(this,"symbol"!=typeof(e="layer")?e+"":e,s),this.layer=t}setPaintEachLayer(t){this.layer._layers.forEach((e=>{this.setPaint(e,t)}))}setPaint(t,e){let s;const{layer:o,feature:i}=t;if(o&&i&&(b(e)?s=e(i):_(e)&&(s=e),s))if("point"===this.layer.type&&"icon"===s.type){const t=o,e=this._createDivIcon(s);setTimeout((()=>{t.setIcon(e)}),10)}else"setStyle"in o&&o.setStyle(this.preparePaint(s))}preparePaint(t){if("get-paint"!==t.type){const e="line"===this.layer.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],s={};"radius"in t&&"number"==typeof t.radius&&(s.radius=t.radius);for(const[o,i]of e){const e=this.layer.options.opacity;let r=t[i];f(e)&&-1!==i.toLowerCase().indexOf("opacity")&&(r=Number(r)*e),void 0!==r&&Object.defineProperty(s,o,{enumerable:!0,value:r})}return s}return L}_createDivIcon(t){const e=t,{html:s,rotate:o,className:r}=e,n=((t,e)=>{var s={};for(var o in t)X.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&J)for(var o of J(t))e.indexOf(o)<0&&K.call(t,o)&&(s[o]=t[o]);return s})(e,["html","rotate","className"]),a=document.createElement("div");r&&(a.className=r),o&&(a.style.transform=`rotateZ(${o}deg)`),s&&(a.innerHTML=s);var l;return new i((l=Y({className:""},n),H(l,q({html:a}))))}createPaintToLayer(t){if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return(e,s)=>{const o=this._createDivIcon(t);return new r(s,{icon:o})}}else if("pin"===t.type)return(t,e)=>new r(e);return(e,s)=>new n(s,this.preparePaint(Y(Y({},L),t)))}createPaintOptions(t){const e={},s=this.preparePaint(t);return t&&(e.style=()=>s),"point"===this.layer.type?e.pointToLayer=this.createPaintToLayer(t):"line"===this.layer.type&&(s.stroke=!0),e}}var et=Object.defineProperty,st=Object.defineProperties,ot=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,at=(t,e,s)=>e in t?et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,lt=(t,e)=>{for(var s in e||(e={}))rt.call(e,s)&&at(t,s,e[s]);if(it)for(var s of it(e))nt.call(e,s)&&at(t,s,e[s]);return t},pt=(t,e)=>st(t,ot(e)),ct=(t,e,s)=>(at(t,"symbol"!=typeof e?e+"":e,s),s);function ht(t,e,s){const o=new XMLHttpRequest;o.open("GET",t),o.responseType="arraybuffer";for(const i in s)o.setRequestHeader(i,s[i]);return o.onload=function(){const t=new Uint8Array(this.response),s=new Blob([t],{type:"image/png"}),o=(window.URL||window.webkitURL).createObjectURL(s);e(o)},o.send(),()=>{o.abort()}}var ut=Object.defineProperty,dt=(t,e,s)=>(((t,e,s)=>{e in t?ut(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s);class mt extends l{constructor(t,e,s){super(t,e,s),dt(this,"_abort",[])}cancelLoad(){this._abort&&(this._abort.forEach((t=>t())),this._abort=[])}_initImage(){super._initImage();const t=this.options.headers;if(t){const e=this._image,s=e.src;e.src="",this._abort.push(ht(s,(t=>{e.src=t}),t))}}}var yt=Object.defineProperty,ft=(t,e,s)=>(((t,e,s)=>{e in t?yt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s);class vt extends p{constructor(t,e){super(e),ft(this,"defaultWmsParams",{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1}),ft(this,"options",{crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,viewPortBuffer:0,setViewDelay:100}),ft(this,"wmsParams"),ft(this,"_url"),ft(this,"_currentUrl"),ft(this,"_currentOverlay"),this._url=t;const s={},o={};let i;for(i in e)i in this.options?o[i]=e[i]:s[i]=e[i];c.setOptions(this,o),this.wmsParams=c.extend({},this.defaultWmsParams,s)}setParams(t){c.extend(this.wmsParams,t),this.update()}getAttribution(){return this.options.attribution||""}onAdd(){return this.update(),this}onRemove(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this}getEvents(){return{moveend:v(this.update,this.options.setViewDelay)}}update(){if(!this._map)return;this.updateWmsParams();const t=this.getImageUrl();if(this._currentUrl===t)return;this._currentUrl=t;const e=this.options.viewPortBuffer||0,s=this._map.getBounds().pad(e),o=new mt(t,s,{opacity:0,pane:this.options.pane,headers:this.options.headers});o.addTo(this._map),this._currentOverlay&&this._currentOverlay.cancelLoad(),o.once("load",(()=>{this._map&&(o._url===this._currentUrl?(this._currentOverlay&&this._map.removeLayer(this._currentOverlay),this._currentOverlay=o,o.setOpacity(void 0!==this.options.opacity?this.options.opacity:1),!0===this.options.isBack&&o.bringToBack(),!1===this.options.isBack&&o.bringToFront(),void 0!==this.options.zIndex&&o.setZIndex(this.options.zIndex)):this._map.removeLayer(o))}),this);const{minZoom:i,maxZoom:r}=this.options;(i&&this._map.getZoom()<i||r&&this._map.getZoom()>r)&&this._map.removeLayer(o)}setOpacity(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)}bringToBack(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()}bringToFront(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()}setZIndex(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)}updateWmsParams(t){t||(t=this._map);const e=this.options.viewPortBuffer||0,s=t.getBounds().pad(e),o=t.getSize();if(0!==this.options.viewPortBuffer){const t=e+1;o.x=Math.ceil(o.x*t),o.y=Math.ceil(o.y*t)}const i=parseFloat(this.wmsParams.version),r=this.options.crs||t.options.crs,n=i>=1.3?"crs":"srs";if(r){const t=r.project(s.getNorthWest()),e=r.project(s.getSouthEast()),a={width:o.x,height:o.y};a[n]=r.code,a.bbox=(i>=1.3&&r===h.EPSG4326?[e.y,t.x,t.y,e.x]:[t.x,e.y,e.x,t.y]).join(","),c.extend(this.wmsParams,a)}}getImageUrl(){const t=c.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}var bt=Object.defineProperty,_t=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,Pt=(t,e,s)=>e in t?bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,wt=(t,e)=>{for(var s in e||(e={}))gt.call(e,s)&&Pt(t,s,e[s]);if(_t)for(var s of _t(e))Ot.call(e,s)&&Pt(t,s,e[s]);return t};function Lt(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=function(t,e=10){let s;function o(...i){o.clear(),s=setTimeout((()=>{s=null,t.apply(this,i)}),e)}return o.clear=function(){s&&(clearTimeout(s),s=null)},o}(((...t)=>{u.prototype._update.call(this,...t)}),this.options.setViewDelay))}createTile(t,e){const s=this.getTileUrl(t),o=document.createElement("img");return o.abort=ht(s,(t=>{o.src=t,e(null,o)}),this.options.headers),(this.options.crossOrigin||""===this.options.crossOrigin)&&(o.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),o.alt="",o.setAttribute("role","presentation"),o}_abortLoading(){const t=this._tiles,e=this._tileZoom;for(const s in t)if(t[s].coords.z!==e){const e=t[s].el;e.onload=c.falseFn,e.onerror=c.falseFn,e.complete||(e.abort&&e.abort(),e.src=c.emptyImageUrl,d.remove(e),delete t[s])}}}}const Ct=Lt(class extends m{constructor(t,e){super(t,e),Object.assign(this.options,e)}});var xt=Object.defineProperty,jt=Object.defineProperties,Mt=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,kt=(t,e,s)=>e in t?xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Zt=(t,e)=>{for(var s in e||(e={}))Et.call(e,s)&&kt(t,s,e[s]);if(St)for(var s of St(e))Tt.call(e,s)&&kt(t,s,e[s]);return t};class Bt extends T{addLayer(t){if(this.options=Object.assign(this.options,t),t){const s=t,{url:o}=s,i=((t,e)=>{var s={};for(var o in t)Et.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&St)for(var o of St(t))e.indexOf(o)<0&&Tt.call(t,o)&&(s[o]=t[o]);return s})(s,["url"]);if(o){const t=Zt({pane:this.pane,attribution:i.attribution,minZoom:i.minZoom,maxZoom:i.maxZoom},i.nativeOptions);let s;return i.subdomains&&(t.subdomains=i.subdomains),s=i.headers?new Ct(o,(e=Zt({},t),jt(e,Mt({headers:i.headers,setViewDelay:i.setViewDelay})))):new m(o,t),s}}var e}}var zt=Object.defineProperty,It=Object.defineProperties,At=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,Ft=(t,e,s)=>e in t?zt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;const Rt=Lt(class extends m.WMS{constructor(t,e){super(t,e)}});var Nt=Object.defineProperty,Vt=Object.defineProperties,$t=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Jt=(t,e,s)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Xt=(t,e)=>{for(var s in e||(e={}))Ht.call(e,s)&&Jt(t,s,e[s]);if(Gt)for(var s of Gt(e))qt.call(e,s)&&Jt(t,s,e[s]);return t};function Kt(t){return[[t[3],t[0]],[t[1],t[2]]]}var Qt=Object.defineProperty,Yt=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,se=(t,e,s)=>e in t?Qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,oe=(t,e)=>{for(var s in e||(e={}))te.call(e,s)&&se(t,s,e[s]);if(Yt)for(var s of Yt(e))ee.call(e,s)&&se(t,s,e[s]);return t},ie=(t,e,s)=>(se(t,"symbol"!=typeof e?e+"":e,s),s);const re=class e{constructor(){ie(this,"options",{target:"map"}),ie(this,"layerAdapters",e.layerAdapters),ie(this,"controlAdapters",e.controlAdapters),ie(this,"emitter",new t),ie(this,"map"),ie(this,"_resizeObserver"),ie(this,"_unselectCb",[]),ie(this,"_universalEvents",["move","zoom","zoomend","zoomstart","moveend","movestart"]),ie(this,"_positionEvents",["mousemove","mouseout","mouseover"])}create(t){if(this.options=oe({},t),this.options.target){const{zoom:t,center:e,maxZoom:s,minZoom:o,maxBounds:i,mapAdapterOptions:r}=this.options;this.map=this.options.map||new y(this.options.target,oe({attributionControl:!1,zoomControl:!1,maxBounds:i?Kt(i):void 0,maxZoom:s,minZoom:o,center:e&&[e[1],e[0]],zoom:t},r));const n=this.map.createPane("order-0");this.map._addUnselectCb=t=>{this._addUnselectCb(t)},n.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}}destroy(){this.map&&this.map.remove(),this._stopWatchSizeChangeToUpdateMinZoom()}getContainer(){return this.map&&this.map.getContainer()}getControlContainer(){const t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")}setCursor(t){this.map&&(this.map.getContainer().style.cursor=t)}setView(t,e){const s=this.map;if(s)if(Array.isArray(t)){const s=t,[o,i]=s;this.map&&("number"==typeof e?this.map.setView([i,o],e,{animate:!1}):this.setCenter([o,i]))}else{const{zoom:e,center:o,maxBounds:i,bounds:r,minZoom:n,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),r&&this.fitBounds(r),void 0!==i)if(i){const t=Kt(i);s.setMaxBounds(t),s.setMinZoom(s.getBoundsZoom(t)),this._watchSizeChangeToUpdateMinZoom(t)}else s.setMaxBounds(null),this._stopWatchSizeChangeToUpdateMinZoom();void 0!==a&&s.setMaxZoom(a),void 0!==n&&(this._stopWatchSizeChangeToUpdateMinZoom(),s.setMinZoom(n))}}setCenter(t){const[e,s]=t;this.map&&this.map.panTo([s,e])}getCenter(){const t=this.map;if(t){const e=t.getBounds().getCenter();return[e.lng,e.lat]}}setZoom(t){this.map&&this.map.setZoom(t)}getZoom(){var t;return null!=(t=this.map&&this.map.getZoom())?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),s=t.getNorthEast();return[e.lng,e.lat,s.lng,s.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:s,offset:o,padding:i}=e,r={};s&&(r.maxZoom=s),i&&(r.padding=[i,i]),o&&(r.padding=o),this.map.fitBounds(Kt(t),r)}}getLayerAdapter(t){return e.layerAdapters[t]}createControl(t,e){return g(t,e,this)}createButtonControl(t){return function(t,e){const o=document.createElement("a"),i=t.title||"";o.href="#",o.title=i,o.setAttribute("role","button"),o.setAttribute("aria-label",i),t.addClass&&o.classList.add(t.addClass),s.disableClickPropagation(o),s.on(o,"click",s.stop),t.html instanceof HTMLElement?o.appendChild(t.html):"string"==typeof t.html&&(o.innerHTML=t.html);const r=e=>{e.stopPropagation(),t.onClick()};return g({onAdd:()=>(void 0!==t.onClick&&o.addEventListener("click",r),o),onRemove(){const e=o.parentNode;e&&e.removeChild(o),void 0!==t.onClick&&o.removeEventListener("click",r)}},{bar:!0},e)}(t,this)}addControl(t,e){if(t.options.position=e.replace("-",""),this.map)return this.map.addControl(t),t}removeControl(t){this.map&&this.map.removeControl(t)}removeLayer(t){t&&t.remove&&t.remove()}showLayer(t){this.map&&t.addTo(this.map)}hideLayer(t){t.remove()}setLayerOpacity(t,e){"setOpacity"in t&&t.setOpacity(e)}setLayerOrder(t,e,s){}onMapClick(t){const e=k(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const s=this.map;if(s&&(s.locate(t),e)){const{locationfound:t,locationerror:o}=e,i=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&s.on("locationfound",i,this),o&&s.on("locationerror",o,this);return{stop:()=>{void 0!==t&&s.off("locationfound",i),o&&s.off("locationerror",o)}}}return{stop:()=>{}}}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_watchSizeChangeToUpdateMinZoom(t){this._stopWatchSizeChangeToUpdateMinZoom();const e=this.getContainer(),s=this.map;e&&s&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((()=>{s.setMinZoom(s.getBoundsZoom(t))})),this._resizeObserver.observe(e))}_stopWatchSizeChangeToUpdateMinZoom(){const t=this.map;t&&t.setMinZoom(0),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)}_addMapListeners(){const t=this.map;if(t){t.on("click",(t=>{this.onMapClick(t)}));for(const e of this._universalEvents)t.on(e,(()=>this.emitter.emit(e,this)),t);for(const e of this._positionEvents)t.on(e,(t=>this.emitter.emit(e,k(t))),t)}}};ie(re,"layerAdapters",{GEOJSON:class extends T{constructor(t,e){super(t,e),ct(this,"layer"),ct(this,"selected",!1),ct(this,"type"),ct(this,"_layers",[]),ct(this,"_events"),ct(this,"paint"),ct(this,"selectedPaint"),ct(this,"_selectedLayers",[]),ct(this,"_filteredLayers",[]),ct(this,"_filterFun"),ct(this,"_openedPopup",[]),ct(this,"_paint"),ct(this,"$updateTooltip",v((()=>{this.updateTooltip()}),300)),ct(this,"$unselect",(()=>{this.unselect()})),this._events=new $(this),this._paint=new tt(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new a([],pt(lt({},t.nativeOptions),{pane:this.pane})),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer}beforeRemove(){this._removeMapListener()}select(t){if(this.unselect(),t){const e=this._layers.filter(t);for(const t of e)this._selectLayer(t,"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._paint.setPaintEachLayer(this.selectedPaint))}unselect(t){if(t){this._layers.filter(t).forEach((t=>{this._unSelectLayer(t)}))}else if(this.selected){for(const t of this._openedPopup)this._removePopup(t[0]);this.paint&&this._paint.setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}}getSelected(){return this._selectedLayers.map((t=>lt({target:this,feature:t.feature,layer:t},M(t.feature))))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,s=e&&e._map;if(e&&s){e.remove();const o=[];this._layers.forEach((({feature:s,layer:i})=>{if(i){!t||t(lt({target:this,feature:s,layer:i},M(s)))?(e.addLayer(i),o.push(lt({target:this,feature:s,layer:i},M(s)))):e.removeLayer(i)}})),this._filteredLayers=o,e.addTo(s)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map((({layer:t,feature:e})=>lt({feature:e,layer:t,visible:t&&!!t._map,target:this},M(e))))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let s=this._layers.length;s--;){const o=this._layers[s];if(o){const{feature:i,layer:r}=o;if(i&&r){t(i)&&(e.removeLayer(r),this._layers.splice(s,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const e=this.options;let s;if(e){if(t){let o;if(e.type)o=e.type;else{const e=function(t){let e;e="FeatureCollection"===t.type?P(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?P(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);o=w[e]}if(this.type&&this.type!==o)return void console.warn("no other data type than layer can be added");this.type=o,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter((t=>x(t.geometry.type,e)));else if("Feature"===t.type){if(!x(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter((t=>x(t.type,e))));return t}(t,o),t&&(s=this._getGeoJsonOptions(e,o))}new o(t||void 0,s)}}openPopup(t,e){if(t){this._layers.filter(t).forEach((t=>{this._openPopup(t,e,"api")}))}}closePopup(t){(t?this._openedPopup.filter((e=>t(e[2]))):this._openedPopup).forEach((t=>{this._removePopup(t[0])}))}updateTooltip(t){t?this._updateTooltip(t):this.getLayers().forEach((t=>this._updateTooltip({feature:t.feature,layer:t.layer})))}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getBounds();if(t.isValid())return O(t)}}setOpacity(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)}setPaint(t){if(t){this.paint=t;for(const e of this._layers)this._paint.setPaint(e,t)}}setSelectedPaint(t){if(t){this.selectedPaint=t;for(const e of this._selectedLayers)this._paint.setPaint(e,t)}}updatePaint(t){this.paint=lt(lt({},this.paint),t);for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint=lt(lt({},this.selectedPaint),t);for(const e of this._selectedLayers)this._paint.setPaint(e,this.selectedPaint)}_getSelected(t){return this._selectedLayers.find((e=>e.layer===t))}_updateTooltip(t){const{feature:e,layer:s}=t,{label:o,labelField:i,labelOnHover:r}=this.options;if(s){let n;if(s.unbindTooltip(),e.properties&&i?n=e.properties[i]:o&&(n=o(lt(lt({target:this},t),M(e)))),n){const t=!r;s.bindTooltip(String(n),{permanent:t,sticky:!1})}}}_openPopup(t){return e=this,s=arguments,o=function*(t,e={},s,o){var i,r;const{feature:n,layer:a}=t,{minWidth:l,autoPan:p,maxWidth:c,closeButton:h}=lt({minWidth:300},e),u=null!=h?h:!this.options.selectOnHover;let d;const m=[],y=t=>{m.push(t)},v=()=>{d&&this._removePopup(d)};let b;if(b=e.createPopupContent?yield e.createPopupContent(lt({layer:a,feature:n,target:this,type:s,close:v,onClose:y},M(n))):e.popupContent,b&&a){const e={minWidth:l,autoPan:p,closeButton:u,closeOnClick:!1,autoClose:!1};if(f(c)&&(e.maxWidth=c),d=a.bindPopup(b,e),null==(r=null==(i=this.options.popupOptions)?void 0:i.unselectOnClose)||r){const t=a.getPopup();t&&t.once("remove",(()=>{v()}),this)}this._openedPopup.push([d,m,t]),d.openPopup(o)}},new Promise(((t,i)=>{var r=t=>{try{a(o.next(t))}catch(e){i(e)}},n=t=>{try{a(o.throw(t))}catch(e){i(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,n);a((o=o.apply(e,s)).next())}));var e,s,o}_removePopup(t){var e,s;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex((e=>e[0]===t));if(-1!==o){const t=null==(s=null==(e=this.options.popupOptions)?void 0:e.unselectOnClose)||s,[,i,r]=this._openedPopup[o];for(const e of i)e(r);i.length=0,t&&this._unSelectLayer(r),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const s=t.paint;let o={};return"function"==typeof s?"point"===e?o.pointToLayer=(t,e)=>{const o=s(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?lt(lt({},L),s(t)):pt(lt({},L),{type:"path"}))}:o=this._paint.createPaintOptions(s),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const s=this.layer;if(s){const o=lt({target:this,feature:t,layer:e},M(t));e.options.pane=this.pane,this._layers.push(o);let i=!0;if(this._filterFun&&(i=this._filterFun(o)),i){const{popup:i,popupOptions:r,selectable:n,interactive:a,selectOnHover:l}=this.options;e.options.interactive=!f(a)||a,s.addLayer(e),n&&(l?(e.on("mouseover",(()=>{this._selectLayer(o,"hover")})),e.on("mouseout",(()=>{this._unSelectLayer(o)}))):e.on("click",(t=>this._selectOnLayerClick(t)),this)),this._events.handleMouseEvents(e),setTimeout((()=>{i&&this._openPopup(lt({target:this,layer:e,feature:t},M(t)),r,"api"),this._updateTooltip({layer:e,feature:t})}))}}}_selectOnLayerClick(t){s.stopPropagation(t);const e=t.target,o=e.feature,i=lt({target:this,layer:e,feature:o},M(o)),r=this._getSelected(e);r?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(r):this._selectLayer(i,"click",t.latlng)}_selectLayer(t,e,s){const{multiselect:o}=this.options;o||(this.map._addUnselectCb((()=>{this._unSelectLayer(t)})),this._selectedLayers.forEach((t=>this._unSelectLayer(t)))),this._selectedLayers.push(t),this.selected=!0;const{selectedPaint:i,popupOnSelect:r,popupOptions:n}=this.options;if(i&&t.layer&&this._paint.setPaint(t,i),r&&this._openPopup(t,n,e,s),this.options.onSelect){const s=t.feature?[t.feature]:[];this.options.onSelect(lt({type:e,layer:this,features:s},M(s)))}}_unSelectLayer(t){const e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._paint.setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0}_addMapClickListener(){const t=this.map;if(t){const{unselectOnClick:e}=this.options;(null==e||e)&&t.on("click",this.$unselect)}}_removeMapClickListener(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)}_addMapListener(){const t=this.map;if(t){const{label:e,labelField:s,labelOnHover:o}=this.options;this._addMapClickListener(),!s&&!e||o||(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}}_removeMapListener(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)}},IMAGE:class extends T{constructor(){var t,e;super(...arguments),Pt(this,"symbol"!=typeof(t="layer")?t+"":t,e)}addLayer(t){const e=t&&t.url;if(e){const s=(t=wt({transparent:!0},t)).updateWmsParams;if(this.layer=new vt(e,wt(wt(wt({pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay},t),t.params),t.nativeOptions)),s){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=s(this.wmsParams)}}return this.layer}}},TILE:Bt,WMS:class extends T{addLayer(t){Object.assign(this.options,t);const e=t,{url:s}=e,o=((t,e)=>{var s={};for(var o in t)Ht.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&Gt)for(var o of Gt(t))e.indexOf(o)<0&&qt.call(t,o)&&(s[o]=t[o]);return s})(e,["url"]);if(s){const e=Xt({pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format},t.nativeOptions);let r;return r=o.headers?new Rt(s,(i=Xt({},e),Vt(i,$t({headers:o.headers})))):new m.WMS(s,e),r}var i}},OSM:class extends Bt{addLayer(t){return super.addLayer((e=((t,e)=>{for(var s in e||(e={}))Wt.call(e,s)&&Ft(t,s,e[s]);if(Ut)for(var s of Ut(e))Dt.call(e,s)&&Ft(t,s,e[s]);return t})({name:"OpenStreetMap",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},t),It(e,At({url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))));var e}}}),ie(re,"controlAdapters",{ZOOM:e.Zoom,ATTRIBUTION:class extends e.Attribution{constructor(t){super(t);const e=t&&t.customAttribution;if(e){let t=[];Array.isArray(e)?t=e:e&&(t=[e]),t.forEach((t=>this.addAttribution(t)))}}}}),ie(re,"Map",y);let ne=re;export{ne as default};
|
|
1
|
+
import{EventEmitter as t}from"events";import{Control as e,DomEvent as s,GeoJSON as o,DivIcon as i,Marker as r,CircleMarker as n,FeatureGroup as a,ImageOverlay as l,Layer as p,Util as c,CRS as h,GridLayer as u,DomUtil as d,TileLayer as m,Map as y}from"leaflet";import{defined as f,debounce as v}from"@nextgis/utils";import{isPaintCallback as b,isPaint as _}from"@nextgis/paint";function g(t,o={},i){return new(e.extend({onAdd(){const e=document.createElement("div"),r=t.onAdd(i);return e.classList.add("leaflet-control"),o.bar&&e.classList.add("leaflet-bar"),o.addClass&&e.classList.add(o.addClass),o.margin||o.bar||(e.style.marginBottom="0px",e.style.marginTop="0px",e.style.marginLeft="0px",e.style.marginRight="0px"),r&&e.appendChild(r),s.disableClickPropagation(e),e},onRemove(){t.onRemove()}}))}function O(t){const e=t.getNorthEast(),s=t.getSouthWest();return[s.lng,s.lat,e.lng,e.lat]}function P(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let s="";for(const o in e){e[o]>(s?e[s]:0)&&(s=o)}return s}const w={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},L={stroke:!1,opacity:1},C={};for(const ae in w){const t=w[ae],e=C[t]||[];e.push(ae),C[t]=e}function x(t,e){return-1!==(C[e]||[]).indexOf(t)}function j(t){const e=new o;return(Array.isArray(t)?t:[t]).forEach((t=>e.addData(t))),e.getBounds()}function M(t){return{getBounds:()=>function(t){return O(j(t))}(t),getCenter:()=>function(t){const{lat:e,lng:s}=j(t).getCenter();return[s,e]}(t)}}var S=Object.defineProperty,E=(t,e,s)=>(((t,e,s)=>{e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s);class T{constructor(t,e){if(this.map=t,this.options=e,E(this,"layer"),E(this,"pane","order-0"),void 0!==e.order){const s="order-"+e.order;let o=t.getPane(s);o||(o=t.createPane(s)),o.style.zIndex=String(Math.round(100*e.order)),this.pane=s}}addLayer(t){Object.assign(this.options,t)}}function k(t){const e=t.containerPoint,s=t.latlng,{lat:o,lng:i}=s;return{latLng:s,lngLat:[i,o],pixel:{left:e.x,top:e.y},source:t}}var Z=Object.defineProperty,B=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,A=(t,e,s)=>e in t?Z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;function U({layer:t,source:e}){const s=e.target.feature;return((t,e)=>{for(var s in e||(e={}))z.call(e,s)&&A(t,s,e[s]);if(B)for(var s of B(e))I.call(e,s)&&A(t,s,e[s]);return t})({layer:t,feature:s,event:k(e),source:e},M(s))}var W=Object.defineProperty,D=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,N=(t,e,s)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,V=(t,e,s)=>(N(t,"symbol"!=typeof e?e+"":e,s),s);class ${constructor(t){V(this,"layer"),V(this,"_onclick"),V(this,"_mouseout"),V(this,"_mouseover"),this.layer=t}handleMouseEvents(t){const{onClick:e,onLayerClick:s,onMouseOut:o,onMouseOver:i}=this.layer.options,r=e||s;r&&(this._onclick=e=>{const s=!!this.layer._getSelected(t);r(((t,e)=>{for(var s in e||(e={}))F.call(e,s)&&N(t,s,e[s]);if(D)for(var s of D(e))R.call(e,s)&&N(t,s,e[s]);return t})({selected:s},this._createMouseEvent(e)))},t.on("click",this._onclick,this)),o&&(this._mouseout=t=>{o(this._createMouseEvent(t))},t.on("mouseout",this._mouseout,this)),i&&(this._mouseover=t=>{i(this._createMouseEvent(t))},t.on("mouseover",this._mouseover,this))}stopMouseEvents(t){this._mouseover&&t.off("mouseover",this._mouseover,this),this._mouseout&&t.off("mouseout",this._mouseout,this),this._onclick&&t.off("click",this._onclick,this)}_createMouseEvent(t){return U({layer:this.layer,source:t})}}var G=Object.defineProperty,H=Object.defineProperties,q=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,Q=(t,e,s)=>e in t?G(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Y=(t,e)=>{for(var s in e||(e={}))X.call(e,s)&&Q(t,s,e[s]);if(J)for(var s of J(e))K.call(e,s)&&Q(t,s,e[s]);return t};class tt{constructor(t){var e,s;Q(this,"symbol"!=typeof(e="layer")?e+"":e,s),this.layer=t}setPaintEachLayer(t){this.layer._layers.forEach((e=>{this.setPaint(e,t)}))}setPaint(t,e){let s;const{layer:o,feature:i}=t;if(o&&i&&(b(e)?s=e(i):_(e)&&(s=e),s))if("point"===this.layer.type&&"icon"===s.type){const t=o,e=this._createDivIcon(s);setTimeout((()=>{t.setIcon(e)}),10)}else"setStyle"in o&&o.setStyle(this.preparePaint(s))}preparePaint(t){if("get-paint"!==t.type){const e="line"===this.layer.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],s={};"radius"in t&&"number"==typeof t.radius&&(s.radius=t.radius);for(const[o,i]of e){const e=this.layer.options.opacity;let r=t[i];f(e)&&-1!==i.toLowerCase().indexOf("opacity")&&(r=Number(r)*e),void 0!==r&&Object.defineProperty(s,o,{enumerable:!0,value:r})}return s}return L}_createDivIcon(t){const e=t,{html:s,rotate:o,className:r}=e,n=((t,e)=>{var s={};for(var o in t)X.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&J)for(var o of J(t))e.indexOf(o)<0&&K.call(t,o)&&(s[o]=t[o]);return s})(e,["html","rotate","className"]),a=document.createElement("div");r&&(a.className=r),o&&(a.style.transform=`rotateZ(${o}deg)`),s&&(a.innerHTML=s);var l;return new i((l=Y({className:""},n),H(l,q({html:a}))))}createPaintToLayer(t){if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return(e,s)=>{const o=this._createDivIcon(t);return new r(s,{icon:o})}}else if("pin"===t.type)return(t,e)=>new r(e);return(e,s)=>new n(s,this.preparePaint(Y(Y({},L),t)))}createPaintOptions(t){const e={},s=this.preparePaint(t);return t&&(e.style=()=>s),"point"===this.layer.type?e.pointToLayer=this.createPaintToLayer(t):"line"===this.layer.type&&(s.stroke=!0),e}}var et=Object.defineProperty,st=Object.defineProperties,ot=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,at=(t,e,s)=>e in t?et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,lt=(t,e)=>{for(var s in e||(e={}))rt.call(e,s)&&at(t,s,e[s]);if(it)for(var s of it(e))nt.call(e,s)&&at(t,s,e[s]);return t},pt=(t,e)=>st(t,ot(e)),ct=(t,e,s)=>(at(t,"symbol"!=typeof e?e+"":e,s),s);function ht(t,e,s){const o=new XMLHttpRequest;o.open("GET",t),o.responseType="arraybuffer";for(const i in s)o.setRequestHeader(i,s[i]);return o.onload=function(){const t=new Uint8Array(this.response),s=new Blob([t],{type:"image/png"}),o=(window.URL||window.webkitURL).createObjectURL(s);e(o)},o.send(),()=>{o.abort()}}var ut=Object.defineProperty,dt=(t,e,s)=>(((t,e,s)=>{e in t?ut(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s);class mt extends l{constructor(t,e,s){super(t,e,s),dt(this,"_abort",[])}cancelLoad(){this._abort&&(this._abort.forEach((t=>t())),this._abort=[])}_initImage(){super._initImage();const t=this.options.headers;if(t){const e=this._image,s=e.src;e.src="",this._abort.push(ht(s,(t=>{e.src=t}),t))}}}var yt=Object.defineProperty,ft=(t,e,s)=>(((t,e,s)=>{e in t?yt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s);class vt extends p{constructor(t,e){super(e),ft(this,"defaultWmsParams",{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1}),ft(this,"options",{crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,viewPortBuffer:0,setViewDelay:100}),ft(this,"wmsParams"),ft(this,"_url"),ft(this,"_currentUrl"),ft(this,"_currentOverlay"),this._url=t;const s={},o={};let i;for(i in e)i in this.options?o[i]=e[i]:s[i]=e[i];c.setOptions(this,o),this.wmsParams=c.extend({},this.defaultWmsParams,s)}setParams(t){c.extend(this.wmsParams,t),this.update()}getAttribution(){return this.options.attribution||""}onAdd(){return this.update(),this}onRemove(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this}getEvents(){return{moveend:v(this.update,this.options.setViewDelay)}}update(){if(!this._map)return;this.updateWmsParams();const t=this.getImageUrl();if(this._currentUrl===t)return;this._currentUrl=t;const e=this.options.viewPortBuffer||0,s=this._map.getBounds().pad(e),o=new mt(t,s,{opacity:0,pane:this.options.pane,headers:this.options.headers});o.addTo(this._map),this._currentOverlay&&this._currentOverlay.cancelLoad(),o.once("load",(()=>{this._map&&(o._url===this._currentUrl?(this._currentOverlay&&this._map.removeLayer(this._currentOverlay),this._currentOverlay=o,o.setOpacity(void 0!==this.options.opacity?this.options.opacity:1),!0===this.options.isBack&&o.bringToBack(),!1===this.options.isBack&&o.bringToFront(),void 0!==this.options.zIndex&&o.setZIndex(this.options.zIndex)):this._map.removeLayer(o))}),this);const{minZoom:i,maxZoom:r}=this.options;(i&&this._map.getZoom()<i||r&&this._map.getZoom()>r)&&this._map.removeLayer(o)}setOpacity(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)}bringToBack(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()}bringToFront(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()}setZIndex(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)}updateWmsParams(t){t||(t=this._map);const e=this.options.viewPortBuffer||0,s=t.getBounds().pad(e),o=t.getSize();if(0!==this.options.viewPortBuffer){const t=e+1;o.x=Math.ceil(o.x*t),o.y=Math.ceil(o.y*t)}const i=parseFloat(this.wmsParams.version),r=this.options.crs||t.options.crs,n=i>=1.3?"crs":"srs";if(r){const t=r.project(s.getNorthWest()),e=r.project(s.getSouthEast()),a={width:o.x,height:o.y};a[n]=r.code,a.bbox=(i>=1.3&&r===h.EPSG4326?[e.y,t.x,t.y,e.x]:[t.x,e.y,e.x,t.y]).join(","),c.extend(this.wmsParams,a)}}getImageUrl(){const t=c.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}var bt=Object.defineProperty,_t=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,Pt=(t,e,s)=>e in t?bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,wt=(t,e)=>{for(var s in e||(e={}))gt.call(e,s)&&Pt(t,s,e[s]);if(_t)for(var s of _t(e))Ot.call(e,s)&&Pt(t,s,e[s]);return t};function Lt(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=function(t,e=10){let s;function o(...i){o.clear(),s=setTimeout((()=>{s=null,t.apply(this,i)}),e)}return o.clear=function(){s&&(clearTimeout(s),s=null)},o}(((...t)=>{u.prototype._update.call(this,...t)}),this.options.setViewDelay))}createTile(t,e){const s=this.getTileUrl(t),o=document.createElement("img");return o.abort=ht(s,(t=>{o.src=t,e(null,o)}),this.options.headers),(this.options.crossOrigin||""===this.options.crossOrigin)&&(o.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),o.alt="",o.setAttribute("role","presentation"),o}_abortLoading(){const t=this._tiles,e=this._tileZoom;for(const s in t)if(t[s].coords.z!==e){const e=t[s].el;e.onload=c.falseFn,e.onerror=c.falseFn,e.complete||(e.abort&&e.abort(),e.src=c.emptyImageUrl,d.remove(e),delete t[s])}}}}const Ct=Lt(class extends m{constructor(t,e){super(t,e),Object.assign(this.options,e)}});var xt=Object.defineProperty,jt=Object.defineProperties,Mt=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,kt=(t,e,s)=>e in t?xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Zt=(t,e)=>{for(var s in e||(e={}))Et.call(e,s)&&kt(t,s,e[s]);if(St)for(var s of St(e))Tt.call(e,s)&&kt(t,s,e[s]);return t};class Bt extends T{addLayer(t){if(this.options=Object.assign(this.options,t),t){const s=t,{url:o}=s,i=((t,e)=>{var s={};for(var o in t)Et.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&St)for(var o of St(t))e.indexOf(o)<0&&Tt.call(t,o)&&(s[o]=t[o]);return s})(s,["url"]);if(o){const t=Zt({pane:this.pane,attribution:i.attribution,minZoom:i.minZoom,maxZoom:i.maxZoom},i.nativeOptions);let s;return i.subdomains&&(t.subdomains=i.subdomains),s=i.headers?new Ct(o,(e=Zt({},t),jt(e,Mt({headers:i.headers,setViewDelay:i.setViewDelay})))):new m(o,t),s}}var e}}var zt=Object.defineProperty,It=Object.defineProperties,At=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,Ft=(t,e,s)=>e in t?zt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;const Rt=Lt(class extends m.WMS{constructor(t,e){super(t,e)}});var Nt=Object.defineProperty,Vt=Object.defineProperties,$t=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Jt=(t,e,s)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Xt=(t,e)=>{for(var s in e||(e={}))Ht.call(e,s)&&Jt(t,s,e[s]);if(Gt)for(var s of Gt(e))qt.call(e,s)&&Jt(t,s,e[s]);return t};function Kt(t){return[[t[3],t[0]],[t[1],t[2]]]}var Qt=Object.defineProperty,Yt=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,se=(t,e,s)=>e in t?Qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,oe=(t,e)=>{for(var s in e||(e={}))te.call(e,s)&&se(t,s,e[s]);if(Yt)for(var s of Yt(e))ee.call(e,s)&&se(t,s,e[s]);return t},ie=(t,e,s)=>(se(t,"symbol"!=typeof e?e+"":e,s),s);const re=class e{constructor(){ie(this,"options",{target:"map"}),ie(this,"layerAdapters",e.layerAdapters),ie(this,"controlAdapters",e.controlAdapters),ie(this,"emitter",new t),ie(this,"map"),ie(this,"_resizeObserver"),ie(this,"_unselectCb",[]),ie(this,"_universalEvents",["move","zoom","zoomend","zoomstart","moveend","movestart"]),ie(this,"_positionEvents",["mousemove","mouseout","mouseover"])}create(t){if(this.options=oe({},t),this.options.target){const{zoom:t,center:e,maxZoom:s,minZoom:o,maxBounds:i,mapAdapterOptions:r}=this.options;this.map=this.options.map||new y(this.options.target,oe({attributionControl:!1,zoomControl:!1,maxBounds:i?Kt(i):void 0,maxZoom:s,minZoom:o,center:e&&[e[1],e[0]],zoom:t},r));const n=this.map.createPane("order-0");this.map._addUnselectCb=t=>{this._addUnselectCb(t)},n.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}}destroy(){this.map&&this.map.remove(),this._stopWatchSizeChangeToUpdateMinZoom()}getContainer(){return this.map&&this.map.getContainer()}getControlContainer(){const t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")}setCursor(t){this.map&&(this.map.getContainer().style.cursor=t)}setView(t,e){const s=this.map;if(s)if(Array.isArray(t)){const s=t,[o,i]=s;this.map&&("number"==typeof e?this.map.setView([i,o],e,{animate:!1}):this.setCenter([o,i]))}else{const{zoom:e,center:o,maxBounds:i,bounds:r,minZoom:n,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),r&&this.fitBounds(r),void 0!==i)if(i){const t=Kt(i);s.setMaxBounds(t),s.setMinZoom(s.getBoundsZoom(t)),this._watchSizeChangeToUpdateMinZoom(t)}else s.setMaxBounds(null),this._stopWatchSizeChangeToUpdateMinZoom();void 0!==a&&s.setMaxZoom(a),void 0!==n&&(this._stopWatchSizeChangeToUpdateMinZoom(),s.setMinZoom(n))}}setCenter(t){const[e,s]=t;this.map&&this.map.panTo([s,e])}getCenter(){const t=this.map;if(t){const e=t.getBounds().getCenter();return[e.lng,e.lat]}}setZoom(t){this.map&&this.map.setZoom(t)}getZoom(){var t;return null!=(t=this.map&&this.map.getZoom())?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),s=t.getNorthEast();return[e.lng,e.lat,s.lng,s.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:s,offset:o,padding:i}=e,r={};s&&(r.maxZoom=s),i&&(r.padding=[i,i]),o&&(r.padding=o),this.map.fitBounds(Kt(t),r)}}getLayerAdapter(t){return e.layerAdapters[t]}createControl(t,e){return g(t,e,this)}createButtonControl(t){return function(t,e){const o=document.createElement("a"),i=t.title||"";o.href="#",o.title=i,o.setAttribute("role","button"),o.setAttribute("aria-label",i),t.addClass&&o.classList.add(t.addClass),s.disableClickPropagation(o),s.on(o,"click",s.stop),t.html instanceof HTMLElement?o.appendChild(t.html):"string"==typeof t.html&&(o.innerHTML=t.html);const r=e=>{e.stopPropagation(),t.onClick()};return g({onAdd:()=>(void 0!==t.onClick&&o.addEventListener("click",r),o),onRemove(){const e=o.parentNode;e&&e.removeChild(o),void 0!==t.onClick&&o.removeEventListener("click",r)}},{bar:!0},e)}(t,this)}addControl(t,e){if(t.options.position=e.replace("-",""),this.map)return this.map.addControl(t),t}removeControl(t){this.map&&this.map.removeControl(t)}removeLayer(t){t&&t.remove&&t.remove()}showLayer(t){this.map&&t.addTo(this.map)}hideLayer(t){t.remove()}setLayerOpacity(t,e){"setOpacity"in t&&t.setOpacity(e)}setLayerOrder(t,e,s){}onMapClick(t){const e=k(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const s=this.map;if(s&&(s.locate(t),e)){const{locationfound:t,locationerror:o}=e,i=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&s.on("locationfound",i,this),o&&s.on("locationerror",o,this);return{stop:()=>{void 0!==t&&s.off("locationfound",i),o&&s.off("locationerror",o)}}}return{stop:()=>{}}}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_watchSizeChangeToUpdateMinZoom(t){this._stopWatchSizeChangeToUpdateMinZoom();const e=this.getContainer(),s=this.map;e&&s&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((()=>{s.setMinZoom(s.getBoundsZoom(t))})),this._resizeObserver.observe(e))}_stopWatchSizeChangeToUpdateMinZoom(){const t=this.map;t&&t.setMinZoom(0),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)}_addMapListeners(){const t=this.map;if(t){t.on("click",(t=>{this.onMapClick(t)}));for(const e of this._universalEvents)t.on(e,(()=>this.emitter.emit(e,this)),t);for(const e of this._positionEvents)t.on(e,(t=>this.emitter.emit(e,k(t))),t)}}};ie(re,"layerAdapters",{GEOJSON:class extends T{constructor(t,e){super(t,e),ct(this,"layer"),ct(this,"selected",!1),ct(this,"type"),ct(this,"_layers",[]),ct(this,"_events"),ct(this,"paint"),ct(this,"selectedPaint"),ct(this,"_selectedLayers",[]),ct(this,"_filteredLayers",[]),ct(this,"_filterFun"),ct(this,"_openedPopup",[]),ct(this,"_paint"),ct(this,"$updateTooltip",v((()=>{this.updateTooltip()}),300)),ct(this,"$unselect",(()=>{this.unselect()})),this._events=new $(this),this._paint=new tt(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new a([],pt(lt({},t.nativeOptions),{pane:this.pane})),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer}beforeRemove(){this._removeMapListener()}select(t){if(this.unselect(),t){const e=this._layers.filter(t);for(const t of e)this._selectLayer(t,"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._paint.setPaintEachLayer(this.selectedPaint))}unselect(t){if(t){this._layers.filter(t).forEach((t=>{this._unSelectLayer(t)}))}else if(this.selected){for(const t of this._openedPopup)this._removePopup(t[0]);this.paint&&this._paint.setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}}getSelected(){return this._selectedLayers.map((t=>lt({target:this,feature:t.feature,layer:t},M(t.feature))))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,s=e&&e._map;if(e&&s){e.remove();const o=[];this._layers.forEach((({feature:s,layer:i})=>{if(i){!t||t(lt({target:this,feature:s,layer:i},M(s)))?(e.addLayer(i),o.push(lt({target:this,feature:s,layer:i},M(s)))):e.removeLayer(i)}})),this._filteredLayers=o,e.addTo(s)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map((({layer:t,feature:e})=>lt({feature:e,layer:t,visible:t&&!!t._map,target:this},M(e))))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let s=this._layers.length;s--;){const o=this._layers[s];if(o){const{feature:i,layer:r}=o;if(i&&r){t(i)&&(e.removeLayer(r),this._layers.splice(s,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const e=this.options;let s;if(e){if(t){let o;if(e.type)o=e.type;else{const e=function(t){let e;e="FeatureCollection"===t.type?P(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?P(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);o=w[e]}if(this.type&&this.type!==o)return void console.warn("no other data type than layer can be added");this.type=o,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter((t=>x(t.geometry.type,e)));else if("Feature"===t.type){if(!x(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter((t=>x(t.type,e))));return t}(t,o),t&&(s=this._getGeoJsonOptions(e,o))}new o(t||void 0,s)}}openPopup(t,e){if(t){this._layers.filter(t).forEach((t=>{this._openPopup(t,e,"api")}))}}closePopup(t){(t?this._openedPopup.filter((e=>t(e[2]))):this._openedPopup).forEach((t=>{this._removePopup(t[0])}))}updateTooltip(t){t?this._updateTooltip(t):this.getLayers().forEach((t=>this._updateTooltip({feature:t.feature,layer:t.layer})))}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getBounds();if(t.isValid())return O(t)}}setOpacity(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)}setPaint(t){if(t){this.paint=t;for(const e of this._layers)this._paint.setPaint(e,t)}}setSelectedPaint(t){if(t){this.selectedPaint=t;for(const e of this._selectedLayers)this._paint.setPaint(e,t)}}updatePaint(t){this.paint=lt(lt({},this.paint),t);for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint=lt(lt({},this.selectedPaint),t);for(const e of this._selectedLayers)this._paint.setPaint(e,this.selectedPaint)}_getSelected(t){return this._selectedLayers.find((e=>e.layer===t))}_updateTooltip(t){const{feature:e,layer:s}=t,{label:o,labelField:i,labelOnHover:r}=this.options;if(s){let n;if(s.unbindTooltip(),e.properties&&i?n=e.properties[i]:o&&(n=o(lt(lt({target:this},t),M(e)))),n){const t=!r;s.bindTooltip(String(n),{permanent:t,sticky:!1})}}}_openPopup(t){return e=this,s=arguments,o=function*(t,e={},s,o){var i,r;const{feature:n,layer:a}=t,{minWidth:l,autoPan:p,maxWidth:c,closeButton:h}=lt({minWidth:300},e),u=null!=h?h:!this.options.selectOnHover;let d;const m=[],y=t=>{m.push(t)},v=()=>{d&&this._removePopup(d)};let b;if(b=e.createPopupContent?yield e.createPopupContent(lt({layer:a,feature:n,target:this,type:s,close:v,onClose:y},M(n))):e.popupContent,b&&a){const e={minWidth:l,autoPan:p,closeButton:u,closeOnClick:!1,autoClose:!1};if(f(c)&&(e.maxWidth=c),d=a.bindPopup(b,e),null==(r=null==(i=this.options.popupOptions)?void 0:i.unselectOnClose)||r){const t=a.getPopup();t&&t.once("remove",(()=>{v()}),this)}this._openedPopup.push([d,m,t]),d.openPopup(o)}},new Promise(((t,i)=>{var r=t=>{try{a(o.next(t))}catch(e){i(e)}},n=t=>{try{a(o.throw(t))}catch(e){i(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,n);a((o=o.apply(e,s)).next())}));var e,s,o}_removePopup(t){var e,s;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex((e=>e[0]===t));if(-1!==o){const t=null==(s=null==(e=this.options.popupOptions)?void 0:e.unselectOnClose)||s,[,i,r]=this._openedPopup[o];for(const e of i)e(r);i.length=0,t&&this._unSelectLayer(r),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const s=t.paint;let o={};return"function"==typeof s?"point"===e?o.pointToLayer=(t,e)=>{const o=s(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?lt(lt({},L),s(t)):pt(lt({},L),{type:"path"}))}:o=this._paint.createPaintOptions(s),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const s=this.layer;if(s){const o=lt({target:this,feature:t,layer:e},M(t));e.options.pane=this.pane,this._layers.push(o);let i=!0;if(this._filterFun&&(i=this._filterFun(o)),i){const{popup:i,popupOptions:r,selectable:n,interactive:a,selectOnHover:l}=this.options;e.options.interactive=!f(a)||a,s.addLayer(e),n&&(l?(e.on("mouseover",(()=>{this._selectLayer(o,"hover")})),e.on("mouseout",(()=>{this._unSelectLayer(o)}))):e.on("click",(t=>this._selectOnLayerClick(t)),this)),this._events.handleMouseEvents(e),setTimeout((()=>{i&&this._openPopup(lt({target:this,layer:e,feature:t},M(t)),r,"api"),this._updateTooltip({layer:e,feature:t})}))}}}_selectOnLayerClick(t){s.stopPropagation(t);const e=t.target,o=e.feature,i=lt({target:this,layer:e,feature:o},M(o)),r=this._getSelected(e);r?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(r):this._selectLayer(i,"click",t.latlng)}_selectLayer(t,e,s){const{multiselect:o}=this.options;o||(this.map._addUnselectCb((()=>{this._unSelectLayer(t)})),this._selectedLayers.forEach((t=>this._unSelectLayer(t)))),this._selectedLayers.push(t),this.selected=!0;const{selectedPaint:i,popupOnSelect:r,popupOptions:n}=this.options;if(i&&t.layer&&this._paint.setPaint(t,i),r&&this._openPopup(t,n,e,s),this.options.onSelect){const s=t.feature?[t.feature]:[];this.options.onSelect(lt({type:e,layer:this,features:s},M(s)))}}_unSelectLayer(t){const e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._paint.setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0}_addMapClickListener(){const t=this.map;if(t){const{unselectOnClick:e}=this.options;(null==e||e)&&t.on("click",this.$unselect)}}_removeMapClickListener(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)}_addMapListener(){const t=this.map;if(t){const{label:e,labelField:s,labelOnHover:o}=this.options;this._addMapClickListener(),!s&&!e||o||(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}}_removeMapListener(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)}},IMAGE:class extends T{constructor(){var t,e;super(...arguments),Pt(this,"symbol"!=typeof(t="layer")?t+"":t,e)}addLayer(t){const e=t&&t.url;if(e){const s=(t=wt({transparent:!0},t)).updateWmsParams;if(this.layer=new vt(e,wt(wt(wt({pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay},t),t.params),t.nativeOptions)),s){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=s(this.wmsParams)}}return this.layer}}},TILE:Bt,WMS:class extends T{addLayer(t){Object.assign(this.options,t);const e=t,{url:s}=e,o=((t,e)=>{var s={};for(var o in t)Ht.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&Gt)for(var o of Gt(t))e.indexOf(o)<0&&qt.call(t,o)&&(s[o]=t[o]);return s})(e,["url"]);if(s){const e=Xt({pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format,transparent:!0},t.nativeOptions);let r;return r=o.headers?new Rt(s,(i=Xt({},e),Vt(i,$t({headers:o.headers})))):new m.WMS(s,e),r}var i}},OSM:class extends Bt{addLayer(t){return super.addLayer((e=((t,e)=>{for(var s in e||(e={}))Wt.call(e,s)&&Ft(t,s,e[s]);if(Ut)for(var s of Ut(e))Dt.call(e,s)&&Ft(t,s,e[s]);return t})({name:"OpenStreetMap",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},t),It(e,At({url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))));var e}}}),ie(re,"controlAdapters",{ZOOM:e.Zoom,ATTRIBUTION:class extends e.Attribution{constructor(t){super(t);const e=t&&t.customAttribution;if(e){let t=[];Array.isArray(e)?t=e:e&&(t=[e]),t.forEach((t=>this.addAttribution(t)))}}}}),ie(re,"Map",y);let ne=re;export{ne as default};
|
|
2
2
|
//# sourceMappingURL=leaflet-map-adapter.esm-bundler.prod.js.map
|