@nextgis/ngw-leaflet 1.19.1 → 1.19.4

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.
@@ -4,5 +4,5 @@ function t(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof do
4
4
  * A collection of Leaflet utilities for working with Web Mapping services.
5
5
  * (c) 2014-2016, Houston Engineering, Inc.
6
6
  * MIT License
7
- */class bi extends e.exports.Layer{constructor(t,i){super(i),this.defaultWmsParams={service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},this.options={crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,viewPortBuffer:0,setViewDelay:100},this._url=t;const o={},n={};let s;for(s in i)s in this.options?n[s]=i[s]:o[s]=i[s];e.exports.Util.setOptions(this,n),this.wmsParams=e.exports.Util.extend({},this.defaultWmsParams,o)}setParams(t){e.exports.Util.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:E(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,i=this._map.getBounds().pad(e),o=new vi(t,i,{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:n,maxZoom:s}=this.options;(n&&this._map.getZoom()<n||s&&this._map.getZoom()>s)&&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 i=this.options.viewPortBuffer||0,o=t.getBounds().pad(i),n=t.getSize();if(0!==this.options.viewPortBuffer){const t=i+1;n.x=Math.ceil(n.x*t),n.y=Math.ceil(n.y*t)}const s=parseFloat(this.wmsParams.version),r=this.options.crs||t.options.crs,a=s>=1.3?"crs":"srs";if(r){const t=r.project(o.getNorthWest()),i=r.project(o.getSouthEast()),h={width:n.x,height:n.y};h[a]=r.code,h.bbox=(s>=1.3&&r===e.exports.CRS.EPSG4326?[i.y,t.x,t.y,i.x]:[t.x,i.y,i.x,t.y]).join(","),e.exports.Util.extend(this.wmsParams,h)}}getImageUrl(){const t=e.exports.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}function wi(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=E(((...t)=>{e.exports.GridLayer.prototype._update.call(this,...t)}),this.options.setViewDelay))}createTile(t,e){const i=this.getTileUrl(t),o=document.createElement("img");return o.abort=yi(i,(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,i=this._tileZoom;for(const o in t)if(t[o].coords.z!==i){const i=t[o].el;i.onload=e.exports.Util.falseFn,i.onerror=e.exports.Util.falseFn,i.complete||(i.abort&&i.abort(),i.src=e.exports.Util.emptyImageUrl,e.exports.DomUtil.remove(i),delete t[o])}}}}const xi=wi(class extends e.exports.TileLayer{constructor(t,e){super(t,e),Object.assign(this.options,e)}});class Li extends fi{addLayer(t){if(this.options=Object.assign(this.options,t),t){const{url:i,...o}=t;if(i){const t={pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,...o.nativeOptions};let n;return o.subdomains&&(t.subdomains=o.subdomains),n=o.headers?new xi(i,{...t,headers:o.headers,setViewDelay:o.setViewDelay}):new e.exports.TileLayer(i,t),n}}}}const Pi=wi(class extends e.exports.TileLayer.WMS{constructor(t,e){super(t,e)}});function Mi(t){return[[t[3],t[0]],[t[1],t[2]]]}class Ci{constructor(){this.options={target:"map"},this.layerAdapters=Ci.layerAdapters,this.controlAdapters=Ci.controlAdapters,this.emitter=new o.exports.EventEmitter,this._unselectCb=[],this._universalEvents=["move","zoom","zoomend","zoomstart","moveend","movestart"],this._positionEvents=["mousemove","mouseout","mouseover"]}create(t){if(this.options={...t},this.options.target){const{zoom:t,center:i,maxZoom:o,minZoom:n,maxBounds:s,mapAdapterOptions:r}=this.options;this.map=this.options.map||new e.exports.Map(this.options.target,{attributionControl:!1,zoomControl:!1,maxBounds:s?Mi(s):void 0,maxZoom:o,minZoom:n,center:i&&[i[1],i[0]],zoom:t,...r});const a=this.map.createPane("order-0");this.map._addUnselectCb=t=>{this._addUnselectCb(t)},a.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 i=this.map;if(i)if(Array.isArray(t)){const i=t,[o,n]=i;this.map&&("number"==typeof e?this.map.setView([n,o],e,{animate:!1}):this.setCenter([o,n]))}else{const{zoom:e,center:o,maxBounds:n,bounds:s,minZoom:r,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),s&&this.fitBounds(s),void 0!==n)if(n){const t=Mi(n);i.setMaxBounds(t),i.setMinZoom(i.getBoundsZoom(t)),this._watchSizeChangeToUpdateMinZoom(t)}else i.setMaxBounds(null),this._stopWatchSizeChangeToUpdateMinZoom();void 0!==a&&i.setMaxZoom(a),void 0!==r&&(this._stopWatchSizeChangeToUpdateMinZoom(),i.setMinZoom(r))}}setCenter(t){const[e,i]=t;this.map&&this.map.panTo([i,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())&&void 0!==t?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:i,offset:o,padding:n}=e,s={};i&&(s.maxZoom=i),n&&(s.padding=[n,n]),o&&(s.padding=o),this.map.fitBounds(Mi(t),s)}}getLayerAdapter(t){return Ci.layerAdapters[t]}createControl(t,e){return si(t,e,this)}createButtonControl(t){return function(t,i){const o=document.createElement("a"),n=t.title||"";o.href="#",o.title=n,o.setAttribute("role","button"),o.setAttribute("aria-label",n),t.addClass&&o.classList.add(t.addClass),e.exports.DomEvent.disableClickPropagation(o),e.exports.DomEvent.on(o,"click",e.exports.DomEvent.stop),t.html instanceof HTMLElement?o.appendChild(t.html):"string"==typeof t.html&&(o.innerHTML=t.html);const s=e=>{e.stopPropagation(),t.onClick()};return si({onAdd:()=>(void 0!==t.onClick&&o.addEventListener("click",s),o),onRemove(){const e=o.parentNode;e&&e.removeChild(o),void 0!==t.onClick&&o.removeEventListener("click",s)}},{bar:!0},i)}(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,i){}onMapClick(t){const e=mi(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const i=this.map;if(i&&(i.locate(t),e)){const{locationfound:t,locationerror:o}=e,n=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&i.on("locationfound",n,this),o&&i.on("locationerror",o,this);return{stop:()=>{void 0!==t&&i.off("locationfound",n),o&&i.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(),i=this.map;e&&i&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((()=>{i.setMinZoom(i.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,mi(t))),t)}}}Ci.layerAdapters={GEOJSON:class extends fi{constructor(t,e){super(t,e),this.selected=!1,this._layers=[],this._selectedLayers=[],this._filteredLayers=[],this._openedPopup=[],this.$updateTooltip=E((()=>{this.updateTooltip()}),300),this.$unselect=()=>{this.unselect()},this._events=new _i(this),this._paint=new gi(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new e.exports.FeatureGroup([],{...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=>({target:this,feature:t.feature,layer:t,...di(t.feature)})))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,i=e&&e._map;if(e&&i){e.remove();const o=[];this._layers.forEach((({feature:i,layer:n})=>{if(n){!t||t({target:this,feature:i,layer:n,...di(i)})?(e.addLayer(n),o.push({target:this,feature:i,layer:n,...di(i)})):e.removeLayer(n)}})),this._filteredLayers=o,e.addTo(i)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map((({layer:t,feature:e})=>({feature:e,layer:t,visible:t&&!!t._map,target:this,...di(e)})))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let i=this._layers.length;i--;){const o=this._layers[i];if(o){const{feature:n,layer:s}=o;if(n&&s){t(n)&&(e.removeLayer(s),this._layers.splice(i,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const i=this.options;let o;if(i){if(t){let e;if(i.type)e=i.type;else{const i=function(t){let e;e="FeatureCollection"===t.type?ai(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?ai(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);e=hi[i]}if(this.type&&this.type!==e)return void console.warn("no other data type than layer can be added");this.type=e,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter((t=>ui(t.geometry.type,e)));else if("Feature"===t.type){if(!ui(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter((t=>ui(t.type,e))));return t}(t,e),t&&(o=this._getGeoJsonOptions(i,e))}new e.exports.GeoJSON(t||void 0,o)}}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 ri(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={...this.paint,...t};for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint={...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:i}=t;if(e&&i&&e.properties&&this.options.labelField){i.unbindTooltip();const t=e.properties[this.options.labelField];if(void 0!==t){const e=!this.options.labelOnHover;i.bindTooltip(String(t),{permanent:e,sticky:!1})}}}async _openPopup(t,e={},i,o){var n,s;const{feature:r,layer:a}=t,{minWidth:h,autoPan:l,maxWidth:c,closeButton:u}={minWidth:300,...e},p=null!=u?u:!this.options.selectOnHover;let d;const f=[],m=t=>{f.push(t)},_=()=>{d&&this._removePopup(d)};let g;if(g=e.createPopupContent?await e.createPopupContent({layer:a,feature:r,target:this,type:i,close:_,onClose:m,...di(r)}):e.popupContent,g&&a){const e={minWidth:h,autoPan:l,closeButton:p,closeOnClick:!1,autoClose:!1};C(c)&&(e.maxWidth=c),d=a.bindPopup(g,e);if(null===(s=null===(n=this.options.popupOptions)||void 0===n?void 0:n.unselectOnClose)||void 0===s||s){const t=a.getPopup();t&&t.once("remove",(()=>{_()}),this)}this._openedPopup.push([d,f,t]),d.openPopup(o)}}_removePopup(t){var e,i;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex((e=>e[0]===t));if(-1!==o){const t=null===(i=null===(e=this.options.popupOptions)||void 0===e?void 0:e.unselectOnClose)||void 0===i||i,[,n,s]=this._openedPopup[o];for(const e of n)e(s);n.length=0,t&&this._unSelectLayer(s),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const i=t.paint;let o={};return"function"==typeof i?"point"===e?o.pointToLayer=(t,e)=>{const o=i(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?{...li,...i(t)}:{...li,type:"path"})}:o=this._paint.createPaintOptions(i),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const i=this.layer;if(i){const o={target:this,feature:t,layer:e,...di(t)};e.options.pane=this.pane,this._layers.push(o);let n=!0;if(this._filterFun&&(n=this._filterFun(o)),n){const{popup:n,popupOptions:s,selectable:r,interactive:a,selectOnHover:h}=this.options;e.options.interactive=!C(a)||a,i.addLayer(e),r&&(h?(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((()=>{n&&this._openPopup({target:this,layer:e,feature:t,...di(t)},s,"api"),this._updateTooltip({layer:e,feature:t})}))}}}_selectOnLayerClick(t){e.exports.DomEvent.stopPropagation(t);const i=t.target,o=i.feature,n={target:this,layer:i,feature:o,...di(o)},s=this._getSelected(i);s?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(s):this._selectLayer(n,"click",t.latlng)}_selectLayer(t,e,i){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:n,popupOnSelect:s,popupOptions:r}=this.options;if(n&&t.layer&&this._paint.setPaint(t,n),s&&this._openPopup(t,r,e,i),this.options.onSelect){const i=t.feature?[t.feature]:[];this.options.onSelect({type:e,layer:this,features:i,...di(i)})}}_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{labelField:e,labelOnHover:i}=this.options;this._addMapClickListener(),e&&!i&&(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 fi{addLayer(t){const e=t&&t.url;if(e){const i=(t={transparent:!0,...t}).updateWmsParams;if(this.layer=new bi(e,{pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay,...t,...t.params,...t.nativeOptions}),i){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=i(this.wmsParams)}}return this.layer}}},TILE:Li,WMS:class extends fi{addLayer(t){Object.assign(this.options,t);const{url:i,...o}=t;if(i){const n={pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format,...t.nativeOptions};let s;return s=o.headers?new Pi(i,{...n,headers:o.headers}):new e.exports.TileLayer.WMS(i,n),s}}},OSM:class extends Li{addLayer(t){return super.addLayer({name:"OpenStreetMap",attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',...t,url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"})}}},Ci.controlAdapters={ZOOM:e.exports.Control.Zoom,ATTRIBUTION:class extends e.exports.Control.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)))}}}},Ci.Map=e.exports.Map;delete e.exports.Icon.Default.prototype._getIconUrl,e.exports.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEj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10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class ki extends ni{constructor(t){super(t={...t,mapAdapter:new Ci})}static async create(t){return new ki(t).onLoad()}}window&&!window.NgwMap&&(window.NgwMap=ki);export{ki as default};
7
+ */class bi extends e.exports.Layer{constructor(t,i){super(i),this.defaultWmsParams={service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},this.options={crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,viewPortBuffer:0,setViewDelay:100},this._url=t;const o={},n={};let s;for(s in i)s in this.options?n[s]=i[s]:o[s]=i[s];e.exports.Util.setOptions(this,n),this.wmsParams=e.exports.Util.extend({},this.defaultWmsParams,o)}setParams(t){e.exports.Util.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:E(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,i=this._map.getBounds().pad(e),o=new vi(t,i,{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:n,maxZoom:s}=this.options;(n&&this._map.getZoom()<n||s&&this._map.getZoom()>s)&&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 i=this.options.viewPortBuffer||0,o=t.getBounds().pad(i),n=t.getSize();if(0!==this.options.viewPortBuffer){const t=i+1;n.x=Math.ceil(n.x*t),n.y=Math.ceil(n.y*t)}const s=parseFloat(this.wmsParams.version),r=this.options.crs||t.options.crs,a=s>=1.3?"crs":"srs";if(r){const t=r.project(o.getNorthWest()),i=r.project(o.getSouthEast()),h={width:n.x,height:n.y};h[a]=r.code,h.bbox=(s>=1.3&&r===e.exports.CRS.EPSG4326?[i.y,t.x,t.y,i.x]:[t.x,i.y,i.x,t.y]).join(","),e.exports.Util.extend(this.wmsParams,h)}}getImageUrl(){const t=e.exports.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}function wi(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=E(((...t)=>{e.exports.GridLayer.prototype._update.call(this,...t)}),this.options.setViewDelay))}createTile(t,e){const i=this.getTileUrl(t),o=document.createElement("img");return o.abort=yi(i,(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,i=this._tileZoom;for(const o in t)if(t[o].coords.z!==i){const i=t[o].el;i.onload=e.exports.Util.falseFn,i.onerror=e.exports.Util.falseFn,i.complete||(i.abort&&i.abort(),i.src=e.exports.Util.emptyImageUrl,e.exports.DomUtil.remove(i),delete t[o])}}}}const xi=wi(class extends e.exports.TileLayer{constructor(t,e){super(t,e),Object.assign(this.options,e)}});class Li extends fi{addLayer(t){if(this.options=Object.assign(this.options,t),t){const{url:i,...o}=t;if(i){const t={pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,...o.nativeOptions};let n;return o.subdomains&&(t.subdomains=o.subdomains),n=o.headers?new xi(i,{...t,headers:o.headers,setViewDelay:o.setViewDelay}):new e.exports.TileLayer(i,t),n}}}}const Pi=wi(class extends e.exports.TileLayer.WMS{constructor(t,e){super(t,e)}});function Mi(t){return[[t[3],t[0]],[t[1],t[2]]]}class Ci{constructor(){this.options={target:"map"},this.layerAdapters=Ci.layerAdapters,this.controlAdapters=Ci.controlAdapters,this.emitter=new o.exports.EventEmitter,this._unselectCb=[],this._universalEvents=["move","zoom","zoomend","zoomstart","moveend","movestart"],this._positionEvents=["mousemove","mouseout","mouseover"]}create(t){if(this.options={...t},this.options.target){const{zoom:t,center:i,maxZoom:o,minZoom:n,maxBounds:s,mapAdapterOptions:r}=this.options;this.map=this.options.map||new e.exports.Map(this.options.target,{attributionControl:!1,zoomControl:!1,maxBounds:s?Mi(s):void 0,maxZoom:o,minZoom:n,center:i&&[i[1],i[0]],zoom:t,...r});const a=this.map.createPane("order-0");this.map._addUnselectCb=t=>{this._addUnselectCb(t)},a.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 i=this.map;if(i)if(Array.isArray(t)){const i=t,[o,n]=i;this.map&&("number"==typeof e?this.map.setView([n,o],e,{animate:!1}):this.setCenter([o,n]))}else{const{zoom:e,center:o,maxBounds:n,bounds:s,minZoom:r,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),s&&this.fitBounds(s),void 0!==n)if(n){const t=Mi(n);i.setMaxBounds(t),i.setMinZoom(i.getBoundsZoom(t)),this._watchSizeChangeToUpdateMinZoom(t)}else i.setMaxBounds(null),this._stopWatchSizeChangeToUpdateMinZoom();void 0!==a&&i.setMaxZoom(a),void 0!==r&&(this._stopWatchSizeChangeToUpdateMinZoom(),i.setMinZoom(r))}}setCenter(t){const[e,i]=t;this.map&&this.map.panTo([i,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())&&void 0!==t?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:i,offset:o,padding:n}=e,s={};i&&(s.maxZoom=i),n&&(s.padding=[n,n]),o&&(s.padding=o),this.map.fitBounds(Mi(t),s)}}getLayerAdapter(t){return Ci.layerAdapters[t]}createControl(t,e){return si(t,e,this)}createButtonControl(t){return function(t,i){const o=document.createElement("a"),n=t.title||"";o.href="#",o.title=n,o.setAttribute("role","button"),o.setAttribute("aria-label",n),t.addClass&&o.classList.add(t.addClass),e.exports.DomEvent.disableClickPropagation(o),e.exports.DomEvent.on(o,"click",e.exports.DomEvent.stop),t.html instanceof HTMLElement?o.appendChild(t.html):"string"==typeof t.html&&(o.innerHTML=t.html);const s=e=>{e.stopPropagation(),t.onClick()};return si({onAdd:()=>(void 0!==t.onClick&&o.addEventListener("click",s),o),onRemove(){const e=o.parentNode;e&&e.removeChild(o),void 0!==t.onClick&&o.removeEventListener("click",s)}},{bar:!0},i)}(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,i){}onMapClick(t){const e=mi(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const i=this.map;if(i&&(i.locate(t),e)){const{locationfound:t,locationerror:o}=e,n=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&i.on("locationfound",n,this),o&&i.on("locationerror",o,this);return{stop:()=>{void 0!==t&&i.off("locationfound",n),o&&i.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(),i=this.map;e&&i&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((()=>{i.setMinZoom(i.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,mi(t))),t)}}}Ci.layerAdapters={GEOJSON:class extends fi{constructor(t,e){super(t,e),this.selected=!1,this._layers=[],this._selectedLayers=[],this._filteredLayers=[],this._openedPopup=[],this.$updateTooltip=E((()=>{this.updateTooltip()}),300),this.$unselect=()=>{this.unselect()},this._events=new _i(this),this._paint=new gi(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new e.exports.FeatureGroup([],{...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=>({target:this,feature:t.feature,layer:t,...di(t.feature)})))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,i=e&&e._map;if(e&&i){e.remove();const o=[];this._layers.forEach((({feature:i,layer:n})=>{if(n){!t||t({target:this,feature:i,layer:n,...di(i)})?(e.addLayer(n),o.push({target:this,feature:i,layer:n,...di(i)})):e.removeLayer(n)}})),this._filteredLayers=o,e.addTo(i)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map((({layer:t,feature:e})=>({feature:e,layer:t,visible:t&&!!t._map,target:this,...di(e)})))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let i=this._layers.length;i--;){const o=this._layers[i];if(o){const{feature:n,layer:s}=o;if(n&&s){t(n)&&(e.removeLayer(s),this._layers.splice(i,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const i=this.options;let o;if(i){if(t){let e;if(i.type)e=i.type;else{const i=function(t){let e;e="FeatureCollection"===t.type?ai(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?ai(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);e=hi[i]}if(this.type&&this.type!==e)return void console.warn("no other data type than layer can be added");this.type=e,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter((t=>ui(t.geometry.type,e)));else if("Feature"===t.type){if(!ui(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter((t=>ui(t.type,e))));return t}(t,e),t&&(o=this._getGeoJsonOptions(i,e))}new e.exports.GeoJSON(t||void 0,o)}}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 ri(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={...this.paint,...t};for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint={...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:i}=t,{label:o,labelField:n,labelOnHover:s}=this.options;if(i){let r;if(i.unbindTooltip(),e.properties&&n?r=e.properties[n]:o&&(r=o({target:this,...t,...di(e)})),r){const t=!s;i.bindTooltip(String(r),{permanent:t,sticky:!1})}}}async _openPopup(t,e={},i,o){var n,s;const{feature:r,layer:a}=t,{minWidth:h,autoPan:l,maxWidth:c,closeButton:u}={minWidth:300,...e},p=null!=u?u:!this.options.selectOnHover;let d;const f=[],m=t=>{f.push(t)},_=()=>{d&&this._removePopup(d)};let g;if(g=e.createPopupContent?await e.createPopupContent({layer:a,feature:r,target:this,type:i,close:_,onClose:m,...di(r)}):e.popupContent,g&&a){const e={minWidth:h,autoPan:l,closeButton:p,closeOnClick:!1,autoClose:!1};C(c)&&(e.maxWidth=c),d=a.bindPopup(g,e);if(null===(s=null===(n=this.options.popupOptions)||void 0===n?void 0:n.unselectOnClose)||void 0===s||s){const t=a.getPopup();t&&t.once("remove",(()=>{_()}),this)}this._openedPopup.push([d,f,t]),d.openPopup(o)}}_removePopup(t){var e,i;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex((e=>e[0]===t));if(-1!==o){const t=null===(i=null===(e=this.options.popupOptions)||void 0===e?void 0:e.unselectOnClose)||void 0===i||i,[,n,s]=this._openedPopup[o];for(const e of n)e(s);n.length=0,t&&this._unSelectLayer(s),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const i=t.paint;let o={};return"function"==typeof i?"point"===e?o.pointToLayer=(t,e)=>{const o=i(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?{...li,...i(t)}:{...li,type:"path"})}:o=this._paint.createPaintOptions(i),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const i=this.layer;if(i){const o={target:this,feature:t,layer:e,...di(t)};e.options.pane=this.pane,this._layers.push(o);let n=!0;if(this._filterFun&&(n=this._filterFun(o)),n){const{popup:n,popupOptions:s,selectable:r,interactive:a,selectOnHover:h}=this.options;e.options.interactive=!C(a)||a,i.addLayer(e),r&&(h?(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((()=>{n&&this._openPopup({target:this,layer:e,feature:t,...di(t)},s,"api"),this._updateTooltip({layer:e,feature:t})}))}}}_selectOnLayerClick(t){e.exports.DomEvent.stopPropagation(t);const i=t.target,o=i.feature,n={target:this,layer:i,feature:o,...di(o)},s=this._getSelected(i);s?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(s):this._selectLayer(n,"click",t.latlng)}_selectLayer(t,e,i){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:n,popupOnSelect:s,popupOptions:r}=this.options;if(n&&t.layer&&this._paint.setPaint(t,n),s&&this._openPopup(t,r,e,i),this.options.onSelect){const i=t.feature?[t.feature]:[];this.options.onSelect({type:e,layer:this,features:i,...di(i)})}}_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:i,labelOnHover:o}=this.options;this._addMapClickListener(),!i&&!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 fi{addLayer(t){const e=t&&t.url;if(e){const i=(t={transparent:!0,...t}).updateWmsParams;if(this.layer=new bi(e,{pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay,...t,...t.params,...t.nativeOptions}),i){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=i(this.wmsParams)}}return this.layer}}},TILE:Li,WMS:class extends fi{addLayer(t){Object.assign(this.options,t);const{url:i,...o}=t;if(i){const n={pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format,...t.nativeOptions};let s;return s=o.headers?new Pi(i,{...n,headers:o.headers}):new e.exports.TileLayer.WMS(i,n),s}}},OSM:class extends Li{addLayer(t){return super.addLayer({name:"OpenStreetMap",attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',...t,url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"})}}},Ci.controlAdapters={ZOOM:e.exports.Control.Zoom,ATTRIBUTION:class extends e.exports.Control.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)))}}}},Ci.Map=e.exports.Map;delete e.exports.Icon.Default.prototype._getIconUrl,e.exports.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4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MFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class ki extends ni{constructor(t){super(t={...t,mapAdapter:new Ci})}static async create(t){return new ki(t).onLoad()}}window&&!window.NgwMap&&(window.NgwMap=ki);export{ki as default};
8
8
  //# sourceMappingURL=ngw-leaflet.esm-browser.prod.js.map