@nextgis/ol-map-adapter
Advanced tools
Comparing version 2.2.3 to 2.3.0
@@ -1,2 +0,2 @@ | ||
/** Bundle of @nextgis/ol-map-adapter; version: 2.2.3; author: NextGIS */ | ||
/** Bundle of @nextgis/ol-map-adapter; version: 2.3.0; author: NextGIS */ | ||
import { EventEmitter } from 'events'; | ||
@@ -76,6 +76,3 @@ import Map from 'ol/Map'; | ||
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b)); | ||
var __publicField$6 = (obj, key, value) => { | ||
__defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
var __publicField$6 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
var __async$1 = (__this, __arguments, generator) => { | ||
@@ -478,6 +475,3 @@ return new Promise((resolve, reject) => { | ||
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __publicField$5 = (obj, key, value) => { | ||
__defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
var __publicField$5 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
class BaseAdapter { | ||
@@ -516,6 +510,3 @@ constructor(map, options) { | ||
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b)); | ||
var __publicField$4 = (obj, key, value) => { | ||
__defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
var __publicField$4 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
var __async = (__this, __arguments, generator) => { | ||
@@ -975,4 +966,3 @@ return new Promise((resolve, reject) => { | ||
const map = this.map; | ||
if (!map) | ||
return; | ||
if (!map) return; | ||
let popup; | ||
@@ -1126,6 +1116,3 @@ const _closeHandlers = []; | ||
}; | ||
var __publicField$3 = (obj, key, value) => { | ||
__defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
var __publicField$3 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
class ImageLayerExtended extends ImageLayer { | ||
@@ -1242,6 +1229,3 @@ constructor(options, ratio) { | ||
}; | ||
var __publicField$2 = (obj, key, value) => { | ||
__defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
var __publicField$2 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
class OsmAdapter extends BaseAdapter { | ||
@@ -1347,6 +1331,3 @@ constructor(map, options) { | ||
}; | ||
var __publicField$1 = (obj, key, value) => { | ||
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
class WmsAdapter extends BaseAdapter { | ||
@@ -1418,6 +1399,3 @@ constructor(map, options) { | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
const _OlMapAdapter = class _OlMapAdapter { | ||
@@ -1546,4 +1524,3 @@ constructor() { | ||
getBounds() { | ||
if (!this._olView) | ||
return void 0; | ||
if (!this._olView) return void 0; | ||
const mapExtent = this._olView.calculateExtent(); | ||
@@ -1564,4 +1541,3 @@ const extent = transformExtent( | ||
const map = this.map; | ||
if (!map) | ||
return; | ||
if (!map) return; | ||
if (Array.isArray(lngLatOrOpt)) { | ||
@@ -1760,4 +1736,3 @@ const lngLat = lngLatOrOpt; | ||
const map = this.map; | ||
if (!map) | ||
return; | ||
if (!map) return; | ||
const curView = map.getView(); | ||
@@ -1764,0 +1739,0 @@ if (extent !== void 0) { |
@@ -1,2 +0,2 @@ | ||
import{EventEmitter as t}from"events";import e from"ol/Map";import o from"ol/View";import{transform as i,transformExtent as s,fromLonLat as r}from"ol/proj";import n from"ol/control/Attribution";import a from"@nextgis/control-container";import l from"ol/control/Control";import c from"ol/control/Zoom";import{create as p}from"@nextgis/dom";import{getCoordinates as h,defined as u}from"@nextgis/utils";import m from"ol/Overlay";import d from"ol/format/GeoJSON";import f from"ol/layer/Vector";import y from"ol/source/Vector";import{getCenter as g}from"ol/extent";import b from"polylabel";import{isPaintCallback as v,isPaint as _}from"@nextgis/paint";import{asArray as P}from"ol/color";import{Fill as O,Stroke as w,Style as C,Text as j}from"ol/style";import x from"ol/style/Circle";import E from"ol/style/Icon";import L from"@nextgis/queue";import F from"ol/layer/Image";import S from"ol/renderer/canvas/ImageLayer";import V from"ol/source/ImageWMS";import A from"ol/layer/Tile";import I,{ATTRIBUTION as k}from"ol/source/OSM";import M from"ol/source/XYZ";import Z from"ol/source/TileWMS";var D=Object.defineProperty,T=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,H=(t,e,o)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,U=(t,e)=>{for(var o in e||(e={}))R.call(e,o)&&H(t,o,e[o]);if(T)for(var o of T(e))B.call(e,o)&&H(t,o,e[o]);return t};const G={collapsible:!1};var z=Object.defineProperty,N=Object.defineProperties,W=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,J=(t,e,o)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,$=(t,e)=>{for(var o in e||(e={}))X.call(e,o)&&J(t,o,e[o]);if(q)for(var o of q(e))Y.call(e,o)&&J(t,o,e[o]);return t};const K={collapsible:!1};class Q extends l{constructor(t){const e=new a,o=e.getContainer();var i,s,r;super((i=$($({},K),t),N(i,W({element:o})))),J(this,"symbol"!=typeof(s="panelContainer")?s+"":s,r),this.panelContainer=e}addControl(t,e){return o=this,i=null,s=function*(){const o=this.getMap();if(o){const i=this.panelContainer.newPositionContainer(e);if(i){const e=yield t,s=e.element;s&&s.classList.add("webmap-ctrl"),e.setTarget(i),o.addControl(e)}}},new Promise(((t,e)=>{var r=t=>{try{a(s.next(t))}catch(o){e(o)}},n=t=>{try{a(s.throw(t))}catch(o){e(o)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,n);a((s=s.apply(o,i)).next())}));var o,i,s}removeControl(t){const e=this.getMap();e&&e.removeControl(t)}getContainer(){return this.panelContainer.getContainer()}}function tt(t){const e=document.createElement("button");e.className="custom-button-control","string"==typeof t.html?e.innerHTML=t.html:t.html instanceof HTMLElement&&e.appendChild(t.html),"string"==typeof t.title&&(e.title=t.title);const o=document.createElement("div");return o.className=(t.addClass?t.addClass+" ":"")+"ol-unselectable webmap-ctrl-group",o.appendChild(e),o}function et(t,e="EPSG:3857",o="EPSG:4326"){const[s,r]=i(t.coordinate,e,o);return{latLng:{lat:r,lng:s},lngLat:[s,r],pixel:{left:t.pixel[0],top:t.pixel[1]},source:t}}function ot(t){const e=function({feature:t,dataProjection:e,featureProjection:o}){const i=(new d).readFeatures({type:"FeatureCollection",features:Array.isArray(t)?t:[t]},{dataProjection:e,featureProjection:o}),s=new y;return s.addFeatures(i),s}(t),o=e.getExtent(),i=s(o,t.featureProjection,t.dataProjection);return e.dispose(),i}function it(t){return{getBounds:()=>ot(t),getCenter:()=>function(t){const e=ot(t);return g(e)}(t)}}const st=90.71446714322,rt=39.37;function nt(t,e){const o={minZoom:e.minZoom,maxZoom:e.maxZoom};return e.maxScale&&(o.minResolution=at(t,e.maxScale)),e.minScale&&(o.maxResolution=at(t,e.minScale)),o}function at(t,e){if(e)return function(t,e){return t/(e*rt*st)}(e,t.getView().getProjection().getMetersPerUnit()||1)}function lt(t){return(new d).writeFeatureObject(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}function ct(t){const e=decodeURIComponent,o=t.split("&"),i={};let s,r;for(let n,a=0,l=o.length;a<l;++a)if(n=o[a],n.length){const t=n.indexOf("=");t<0?(s=e(n),r=""):(s=e(n.slice(0,t)),r=e(n.slice(t+1))),"string"==typeof i[s]&&(i[s]=[i[s]]),Array.isArray(i[s])?i[s].push(r):i[s]=r}return i}function pt(t,e){const o=[];let i;for(i in t){const s=e?e+"["+i+"]":i,r=t[i];o.push(null!==r&&"object"==typeof r?pt(r,s):encodeURIComponent(s)+"="+encodeURIComponent(r))}return o.join("&")}var ht=Object.defineProperty,ut=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,ft=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,gt=(t,e,o)=>e in t?ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,bt=(t,e)=>{for(var o in e||(e={}))ft.call(e,o)&>(t,o,e[o]);if(dt)for(var o of dt(e))yt.call(e,o)&>(t,o,e[o]);return t};const vt={Point:"point",MultiPoint:"point",LineString:"line",MultiLineString:"line",Polygon:"polygon",MultiPolygon:"polygon",Circle:"point"},_t={polygon:"path",line:"path",point:"circle"};function Pt(t,e){const o=P(t).slice();return o[3]=void 0!==e?e:1,o}function Ot(t,e={}){if(v(e)){return Ot(t,e(lt(t)))}if(_(e)){const o=t.getGeometry(),i=o&&o.getType()||"Point",s={};if(!e.type){const t=vt[i],o="polygon"===t||"line"===t?"path":"html"in e||"className"in e?"icon":_t[t];o&&(e.type=o)}if("path"===e.type||"circle"===e.type){const{radius:t,fill:o,fillColor:r,fillOpacity:n,strokeColor:a,stroke:l,strokeOpacity:c}=bt({},e);o&&r&&"string"==typeof r&&"number"==typeof n&&(s.fill=new O({color:Pt(r,n)})),a&&"string"==typeof a&&"number"==typeof c&&(l||-1!==["MultiLineString","LineString"].indexOf(i))&&(s.stroke=new w({width:e.weight,color:Pt(a,c)})),"circle"===e.type&&"number"==typeof t&&(s.image=new x(bt({radius:t},s)))}else if("icon"===e.type){const t=e.html;if(t){const o={src:"data:image/svg+xml,"+encodeURIComponent(t),anchorXUnits:"pixels",anchorYUnits:"pixels",anchor:e.iconAnchor,rotation:e.rotate};s.image=new E(o)}}return new C(s)}}function wt(t,e){let o={font:"12px Calibri,sans-serif",overflow:!0,fill:new O({color:"#000"}),stroke:new w({color:"#fff",width:3})};var i;return"point"===t&&(i=bt({},o),o=ut(i,mt({placement:"point",textBaseline:"bottom",offsetY:20}))),new C({text:new j(o)})}var Ct=Object.defineProperty,jt=(t,e,o)=>(((t,e,o)=>{e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o})(t,"symbol"!=typeof e?e+"":e,o),o);class xt{constructor(t,e){this.map=t,this.options=e,jt(this,"layer")}setOpacity(t){this.options.opacity=Number(t),this.layer&&this.layer.setOpacity&&this.layer.setOpacity(this.options.opacity)}}var Et=Object.defineProperty,Lt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,It=(t,e,o)=>e in t?Et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,kt=(t,e)=>{for(var o in e||(e={}))Vt.call(e,o)&&It(t,o,e[o]);if(St)for(var o of St(e))At.call(e,o)&&It(t,o,e[o]);return t},Mt=(t,e,o)=>(It(t,"symbol"!=typeof e?e+"":e,o),o);function Zt(t,e,o){let i=()=>{};const s=t.getImage();return[new Promise(((t,r)=>{const n=new XMLHttpRequest;n.open("GET",e),n.responseType="arraybuffer";for(const e in o)n.setRequestHeader(e,o[e]);n.onload=function(){const e=new Uint8Array(this.response),o=new Blob([e],{type:"image/png"}),i=(window.URL||window.webkitURL).createObjectURL(o);s.src=i,t()},n.onerror=()=>{r()},n.send(),i=()=>{n.abort(),t()}})),i]}var Dt=Object.defineProperty,Tt=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,Ht=(t,e,o)=>e in t?Dt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Ut=(t,e)=>{for(var o in e||(e={}))Rt.call(e,o)&&Ht(t,o,e[o]);if(Tt)for(var o of Tt(e))Bt.call(e,o)&&Ht(t,o,e[o]);return t},Gt=(t,e,o)=>(Ht(t,"symbol"!=typeof e?e+"":e,o),o);class zt extends F{constructor(t,e){super(t),this.ratio=e}createRenderer(){return new Wt(this,this.ratio)}}class Nt extends V{constructor(t,e){super(t),this.ratio=e}getImageInternal(t,e,o,i){return super.getImageInternal(t,e,this.ratio,i)}}class Wt extends S{constructor(t,e){super(t),this.ratio=e}renderFrame(t,e){return t.pixelRatio=this.ratio,super.renderFrame(t,e)}}const qt=class t extends xt{constructor(t,e){super(t,e),this.map=t,this.options=e,Gt(this,"layer")}addLayer(t){if(Object.assign(this.options,t),t.url){const e=void 0!==t.ratio?t.ratio:1,o={url:t.url,params:Ut({},t.params),projection:void 0,imageLoadFunction:this.constructImageLoadFunction(t)},i=Ut(Ut({opacity:t.opacity},nt(this.map,t)),t.nativeOptions);if(e>1){o.ratio=e,o.serverType="mapserver";const t=new Nt(o,e),s=new zt(Ut({source:t},i),e);this.layer=s}else{const t=new V(o),e=new F(Ut({source:t},i));this.layer=e}return this.layer}}constructImageLoadFunction(e){const o=e.updateWmsParams;return(i,s)=>{const r=s.split("?")[0],n=ct(s.split("?")[1]),{resource:a,BBOX:l,WIDTH:c,HEIGHT:p}=n,h=((t,e)=>{var o={};for(var i in t)Rt.call(t,i)&&e.indexOf(i)<0&&(o[i]=t[i]);if(null!=t&&Tt)for(var i of Tt(t))e.indexOf(i)<0&&Bt.call(t,i)&&(o[i]=t[i]);return o})(n,["resource","BBOX","WIDTH","HEIGHT"]),u=Ut({resource:a,bbox:l,width:c,height:p},h),m=pt(o?o(u):h),d=e.headers,f=r+"?"+m;t.queue.add((()=>Zt(i,f,d)))}}};Gt(qt,"queue",new L({concurrency:6,delay:200}));let Xt=qt;var Yt=Object.defineProperty,Jt=Object.getOwnPropertySymbols,$t=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable,Qt=(t,e,o)=>e in t?Yt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var te=Object.defineProperty,ee=Object.getOwnPropertySymbols,oe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,se=(t,e,o)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,re=(t,e)=>{for(var o in e||(e={}))oe.call(e,o)&&se(t,o,e[o]);if(ee)for(var o of ee(e))ie.call(e,o)&&se(t,o,e[o]);return t};var ne=Object.defineProperty,ae=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,pe=(t,e,o)=>e in t?ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,he=(t,e)=>{for(var o in e||(e={}))le.call(e,o)&&pe(t,o,e[o]);if(ae)for(var o of ae(e))ce.call(e,o)&&pe(t,o,e[o]);return t};var ue=Object.defineProperty,me=Object.defineProperties,de=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,be=(t,e,o)=>e in t?ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,ve=(t,e)=>{for(var o in e||(e={}))ye.call(e,o)&&be(t,o,e[o]);if(fe)for(var o of fe(e))ge.call(e,o)&&be(t,o,e[o]);return t},_e=(t,e,o)=>(be(t,"symbol"!=typeof e?e+"":e,o),o);const Pe=class n{constructor(){_e(this,"options",{target:"map"}),_e(this,"layerAdapters",n.layerAdapters),_e(this,"controlAdapters",n.controlAdapters),_e(this,"emitter",new t),_e(this,"map"),_e(this,"displayProjection","EPSG:3857"),_e(this,"lonlatProjection","EPSG:4326"),_e(this,"_mapClickEvents",[]),_e(this,"_forEachFeatureAtPixel",[]),_e(this,"_unselectCb",[]),_e(this,"_olView"),_e(this,"_panelControl"),_e(this,"_isLoaded",!1),_e(this,"_positionMem",{})}create(t){this.options=ve({},t);const i=this.getViewOptions(this.options),s={controls:[],view:new o(i),layers:[]};t.mapAdapterOptions&&Object.assign(s,t.mapAdapterOptions);const r=(n=ve({},s),me(n,de({target:this.options.target||"map"})));var n;this.map=this.options.map||new e(r),this._panelControl=new Q,this.map.addControl(this._panelControl),this.map.set("_mapClickEvents",this._mapClickEvents),this.map.set("_forEachFeatureAtPixel",this._forEachFeatureAtPixel),this.map.set("_addUnselectCb",(t=>this._addUnselectCb(t))),this.emitter.emit("create",this),this._olView=this.map.getView(),this._isLoaded=!0,this._addMapListeners(),this._addViewListeners()}destroy(){this.map&&this.map.dispose()}getContainer(){if(this.options.target){let t;return"string"==typeof this.options.target?t=document.getElementById(this.options.target):this.options.target instanceof HTMLElement&&(t=this.options.target),t}}getControlContainer(){if(this._panelControl)return this._panelControl.getContainer();throw new Error("The ol-map-adapter ControlPanel has not been initialized yet")}setCenter(t){this._olView&&this._olView.setCenter(r(t))}getCenter(){if(this._olView){const t=this._olView.getCenter();if(t){return i(t,this.displayProjection,this.lonlatProjection)}}}setZoom(t){this._olView&&this._olView.setZoom(t)}getZoom(){if(this._olView)return this._olView.getZoom()}fitBounds(t,e={}){if(this._olView){const{padding:o,maxZoom:i,offset:r}=e,n=this.getZoom(),a=s(t,this.lonlatProjection,this.displayProjection),l={};i&&(l.maxZoom=i),o&&(l.padding=[o,o]),r&&(l.padding=r),this._olView.fit(a,l),this._emitMoveEndEvents({zoom:n})}}getBounds(){if(!this._olView)return;const t=this._olView.calculateExtent();return s(t,this.displayProjection,this.lonlatProjection)}setRotation(t){this._olView&&this._olView.setRotation(t)}setView(t,e){if(this.map)if(Array.isArray(t)){this._setView({zoom:e,center:r(t)})}else{const{bounds:e}=t,o=this.getViewOptions(t);Object.values(o).some(Boolean)&&this._setView(o),e&&this.fitBounds(e)}}removeLayer(t){this.map&&this.map.removeLayer(t)}showLayer(t){if(this.map){const e=this.map.getLayers();for(const o of e.getArray())if(o===t)return void("production"!==process.env.NODE_ENV&&console.warn("DEV: OL layer already added"));this.map.addLayer(t)}}hideLayer(t){this.map&&this.map.removeLayer(t)}setLayerOpacity(t,e){t.setOpacity&&t.setOpacity(Number(e))}setLayerOrder(t,e){t&&t.setZIndex&&t.setZIndex(e)}createControl(t,e){return function(t,e={},o){return new class extends l{constructor(){const i=document.createElement("div");i.className=(e.addClass?e.addClass+" ":"")+"ol-unselectable"+(e.bar?" webmap-ctrl-group":"")+(e.margin?" ol-control-margin":"");const s=t.onAdd(o);s&&i.appendChild(s),super({element:i})}}}(t,e,this)}createButtonControl(t){return function(t){return new class extends l{constructor(){super({element:tt(t)}),t.onClick&&this.element.querySelector("button").addEventListener("click",t.onClick,!1)}handleRotateNorth(){var t;null==(t=this.getMap())||t.getView().setRotation(0)}}}(t)}addControl(t,e){if(this._panelControl)return this._panelControl.addControl(t,e),t}removeControl(t){this._panelControl&&this._panelControl.removeControl(t)}onMapClick(t,e="click"){const o=et(t);this.emitter.emit(`pre${e}`,o);this._callEachFeatureAtPixel(t,e)||"click"!==e||this._mapClickEvents.forEach((e=>{e(t)})),this.emitter.emit(e,o)}getViewOptions(t){const{zoom:e,center:o,maxBounds:i,minZoom:n,maxZoom:a}=t,l={zoom:e,minZoom:n,maxZoom:a,projection:this.displayProjection};if(o&&(l.center=r(o)),i){const t=s(i,this.lonlatProjection,this.displayProjection);l.extent=t}return l}_callEachFeatureAtPixel(t,e){if(t&&t.pixel&&this._forEachFeatureAtPixel.length&&this.map){const o=this._forEachFeatureAtPixel.sort(((t,e)=>e[0]-t[0]));for(const i of o){if(i[1](t.pixel,t,e))return!0}}return!1}_emitMoveEndEvents(t){if(this._isLoaded){const e=this.getZoom();t.zoom!==e&&this.emitter.emit("zoomend")}}_addMapListeners(){const t=this.map;if(t){const e=t.getViewport();t.on("click",(t=>{this.onMapClick(t)})),t.on("dblclick",(t=>{this.onMapClick(t,"dblclick")})),t.on("pointermove",(t=>{this.emitter.emit("mousemove",et(t)),this._callEachFeatureAtPixel(t,"hover")}));const o=e=>{const o=[e.x,e.y],i=t.getCoordinateFromPixel(o);if(i){return et(ve({pixel:o,coordinate:i},e))}};e.addEventListener("mouseout",(t=>{this.emitter.emit("mouseout",o(t))}),!1),e.addEventListener("mouseover",(t=>{this.emitter.emit("mouseover",o(t))}),!1);const i=this.getCenter(),s=this.getZoom(),r=["movestart","moveend"];for(const n of r)this._positionMem[n]={center:i,zoom:s},t.on(n,(()=>{this._emitPositionChangeEvent(n)}));t.once("movestart",(()=>{t.on("movestart",(()=>{Xt.queue.abort()}))}))}}_addViewListeners(){this._olView&&(this._olView.on("change:resolution",(()=>{this.emitter.emit("zoom",this)})),this._olView.on("change:center",(()=>{this.emitter.emit("move",this)})))}_setView(t){const{center:e,zoom:i,extent:s,minZoom:r,maxZoom:n}=t,a=this.map;if(!a)return;const l=a.getView();if(void 0!==s){l.dispose();const e=new o(t);this._olView=e,this._addViewListeners(),a.setView(e)}else e&&l.setCenter(e),void 0!==i&&l.setZoom(i),void 0!==r&&l.setMinZoom(r),void 0!==n&&l.setMaxZoom(n)}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_emitPositionChangeEvent(t){const e=this._positionMem[t];let o,i;e&&(o=e.center,i=e.zoom);const s=this.getCenter(),r=this.getZoom();if(i!==r){this.emitter.emit("movestart"===t?"zoomstart":"zoomend",this)}if(o&&s){const[e,i]=s,[r,n]=o;e===r&&i===n||this.emitter.emit(t,this)}else o!==s&&this.emitter.emit(t,this);this._positionMem[t]={center:s,zoom:r}}};_e(Pe,"layerAdapters",{IMAGE:Xt,TILE:class extends xt{constructor(t,e){super(t,e),this.map=t,this.options=e}addLayer(t){Object.assign(this.options,t);const e=function(t,e){const o=[],i="string"==typeof e?e.split(""):e;return(null==i?void 0:i.length)?i.forEach((e=>{o.push(t.replace(/{s}/,e))})):o.push(t),o}(t.url,t.subdomains),o={attributions:t.attribution?[t.attribution]:[],urls:e};t.crossOrigin&&(o.crossOrigin=t.crossOrigin);const i=new M(o),s=t.headers;s&&i.setTileLoadFunction(((t,e)=>{Zt(t,e,s)}));return new A(re(re({source:i,opacity:t.opacity},nt(this.map,t)),t.nativeOptions))}},WMS:class extends xt{constructor(t,e){var o,i;super(t,e),this.map=t,this.options=e,pe(this,"symbol"!=typeof(o="layer")?o+"":o,i)}addLayer(t){Object.assign(this.options,t);const e={url:t.url,params:{LAYERS:t.layers,VERSION:t.version},projection:void 0},o=t.updateWmsParams;o&&(e.tileLoadFunction=(e,i)=>{const s=i.split("?")[0],r=i.split("?")[1],{resource:n,BBOX:a,WIDTH:l,HEIGHT:c}=ct(r),p=pt(o({resource:n,bbox:a,width:l,height:c})),h=t.headers,u=s+"?"+p;h?Zt(e,u,h):e.getImage().src=u});const i=new Z(e),s=new A(he(he({source:i,opacity:t.opacity},nt(this.map,t)),t.nativeOptions));return this.layer=s,s}},OSM:class extends xt{constructor(t,e){var o;super(t,e),this.map=t,this.options=e,Qt(this,"symbol"!=typeof(o="name")?o+"":o,"OpenStreetMap")}addLayer(t){Object.assign(this.options,t),this.options.name=this.name;return new A(((t,e)=>{for(var o in e||(e={}))$t.call(e,o)&&Qt(t,o,e[o]);if(Jt)for(var o of Jt(e))Kt.call(e,o)&&Qt(t,o,e[o]);return t})({source:new I({attributions:[k]})},t.nativeOptions))}},GEOJSON:class extends xt{constructor(t,e){var o;super(t,e),this.map=t,this.options=e,Mt(this,"layer"),Mt(this,"paint"),Mt(this,"selectedPaint"),Mt(this,"selected",!1),Mt(this,"displayProjection","EPSG:3857"),Mt(this,"lonlatProjection","EPSG:4326"),Mt(this,"vectorSource",new y),Mt(this,"_features",[]),Mt(this,"_selectedFeatures",[]),Mt(this,"_filterFun"),Mt(this,"_mouseOver"),Mt(this,"_openedPopup",[]),Mt(this,"_forEachFeatureAtPixel",[]),Mt(this,"_mapClickEvents",[]),Mt(this,"_styleCache",{}),Mt(this,"_labelVisibility",!0),this._labelVisibility=null!=(o=e.labelVisibility)?o:this._labelVisibility,this.displayProjection=t.getView().getProjection().getCode()}get addUnselectCb(){return this.map.get("_addUnselectCb")}get mapClickEvents(){return this.map.get("_mapClickEvents")}get forEachFeatureAtPixel(){return this.map.get("_forEachFeatureAtPixel")}addLayer(t){var e;Object.assign(this.options,t),this.paint=t.paint,this.selectedPaint=t.selectedPaint;const o=t.data;o&&this.addData(o),this.layer=new f(kt(kt({source:this.vectorSource,style:e=>this._getFeatureStyle(e,t.paint||{},t.type)},nt(this.map,t)),t.nativeOptions));return(null==(e=t.interactive)||e)&&this._addEventListener(),this.layer}beforeRemove(){const t=this.forEachFeatureAtPixel;for(let o=t.length;o--;){const e=t[o][1];-1!==t.findIndex((t=>t[1]===e))&&t.splice(o,1)}this._forEachFeatureAtPixel.length=0;const e=this.mapClickEvents;for(let o=e.length;o--;){-1!==e.indexOf(e[o])&&e.splice(o,1)}this._mapClickEvents.length=0,this._removeAllPopup()}clearLayer(t){if(this.unselect(),t){const e=this.vectorSource.getFeatures().values();let o;for(;!(o=e.next()).done;){t(lt(o.value))&&this.vectorSource.removeFeature(o.value)}}else this.vectorSource.clear()}setData(t){this.clearLayer(),this.addData(t)}addData(t){const e=this.options.srs,o="EPSG:"+(null!=e?e:"4326"),i=(new d).readFeatures(t,{dataProjection:o,featureProjection:this.displayProjection});if(this._features=this._features.concat(i),this._filterFun)this.filter(this._filterFun);else if(this.vectorSource.addFeatures(i),this.options.popup)for(const s of this._features)this._openPopup({feature:s,type:"api",options:this.options.popupOptions})}select(t){if(this.unselect(),"function"==typeof t){const e=this._features.filter((e=>t(this._createLayerDefOpts(lt(e)))));for(const t of e)this._selectFeature(t)}else this.selected||(this.selected=!0,this.selectedPaint&&this._setPaintEachLayer(this.selectedPaint))}unselect(t){let e=this._selectedFeatures;"function"==typeof t?e=this._selectedFeatures.filter((e=>t(this._createLayerDefOpts(lt(e))))):this.selected&&(this.selected=!1);for(const o of e)this._unselectFeature(o);this._removeAllPopup()}getLayers(){return this._features.map((t=>this._createLayerDefOpts(lt(t))))}getSelected(){return this._selectedFeatures.map((t=>this._createLayerDefOpts(lt(t))))}filter(t){this._filterFun=t;const e=this._features,o=t?e.filter((e=>t(this._createLayerDefOpts(lt(e))))):e;this.vectorSource.clear();const i=o.length;for(let s=0;s<i;s++)this.vectorSource.addFeature(o[s]);return o.map((t=>this._createLayerDefOpts(lt(t))))}cleanFilter(){this.filter()}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getSource();if(t){const e=t.getExtent();return s(e,this.displayProjection,this.lonlatProjection)}}}setPaint(t){t&&(this.paint=t,this._setPaintEachLayer(this.paint))}setSelectedPaint(t){t&&(this.selectedPaint=t,this._setPaintEachLayer(this.selectedPaint))}updatePaint(t){this.paint=kt(kt({},this.paint),t),this._setPaintEachLayer(this.paint)}updateSelectedPaint(t){this.selectedPaint=kt(kt({},this.selectedPaint),t),this._setPaintEachLayer(this.selectedPaint)}isLabelVisible(){return this._labelVisibility}hideLabel(){this._toggleLabel(!1)}showLabel(){this._toggleLabel(!0)}_toggleLabel(t){this._labelVisibility=t,this.updatePaint({})}_createLayerDefOpts(t){return kt({target:this,feature:t},it({feature:t,dataProjection:this.lonlatProjection,featureProjection:this.displayProjection}))}_getFeatureStyle(t,e,o="polygon"){var i;const s=[],r=t.getId(),n=void 0!==r&&this._styleCache[r];if(n)return n;const a=Ot(t,e);if(a&&s.push(a),this._labelVisibility){const{labelField:e,label:r}=this.options;let n="";if("string"==typeof e?n=t.get(e):r&&(n=r(this._createLayerDefOpts(lt(t)))),n=String(n),n){const t=u(n)?n:"";if(t){const e=wt(o);null==(i=e.getText())||i.setText(t),s.push(e)}}}return void 0!==r&&(this._styleCache[r]=s),s}_setPaintEachLayer(t){if(this._styleCache={},this.layer){const e=this.layer.getSource();if(e){const o=e.getFeatures();for(const e of o){const o=this._getFeatureStyle(e,t,this.options.type);o&&e.setStyle(o)}}}}_addEventListener(){var t;const e=this.forEachFeatureAtPixel,o=[this.options.order||0,(t,e,o)=>this._onFeatureAtPixel(t,e,o)];this._forEachFeatureAtPixel.push(o),e.push(o);(null==(t=this.options.unselectOnClick)||t)&&(this._mapClickEvents.push((()=>this.unselect())),this.mapClickEvents.push((()=>this.unselect())))}_onFeatureAtPixel(t,e,o){const i=t&&this.map.getFeaturesAtPixel(t,{layerFilter:t=>t===this.layer})[0],s=(t=>({layer:this,event:et(t),source:t}))(e);if(i){const t=kt(kt({},s),this._createLayerDefOpts(lt(i)));let e=-1!==this._selectedFeatures.indexOf(i);return this.options.selectable&&("hover"===o&&this.options.selectOnHover||"click"===o)&&(e?this.options&&this.options.unselectOnSecondClick&&(this._unselectFeature(i),e=!1):(this._selectFeature(i,t.event.lngLat),e=!0)),"click"===o&&this.options.onClick&&this.options.onClick(kt({selected:e},t)),"dblclick"===o&&this.options.onDoubleClick&&this.options.onDoubleClick(kt({selected:e},t)),"hover"===o&&(this._mouseOver=!0,this.options.onMouseOver&&this.options.onMouseOver(t)),!0}return"hover"===o&&this._mouseOver&&(this._mouseOver=!1,this.options.onMouseOut&&this.options.onMouseOut(s),this.options.selectOnHover&&this.unselect()),!1}_selectFeature(t,e){const{multiselect:o,selectedPaint:i,popupOptions:s,popupOnSelect:r,onSelect:n}=this.options||{},a=e?"click":"api";if(!o){this.addUnselectCb((()=>this._unselectFeature(t)));for(const t of this._selectedFeatures)this._unselectFeature(t)}if(this._selectedFeatures.push(t),this.selected=!0,i){const e=Ot(t,i);e&&t.setStyle(e)}if(r&&this._openPopup({coordinates:e,feature:t,options:s,type:"click"}),n){const e=lt(t);n(kt({layer:this,features:[],type:a},it({feature:e,dataProjection:this.lonlatProjection,featureProjection:this.displayProjection})))}}_unselectFeature(t){const e=this._selectedFeatures.indexOf(t);if(-1!==e){this._selectedFeatures.splice(e,1);const o=this._openedPopup.find((e=>e[0]===t));o&&this._removePopup(o[1])}if(this.selected=this._selectedFeatures.length>0,this.options&&this.options.paint){const e=Ot(t,this.options.paint);e&&t.setStyle(e)}}_openPopup(t){return e=this,o=arguments,s=function*({coordinates:t,feature:e,options:o={},type:s}){const r=this.map;if(!r)return;let n;const a=[],l=()=>{n&&this._removePopup(n)},{createPopupContent:c,popupContent:p}=o,u=lt(e),d=c?yield c(kt({close:l,onClose:t=>{a.push(t)},type:s},this._createLayerDefOpts(u))):p;if(t=t||u&&function(t){return"Polygon"===t.geometry.type?b(t.geometry.coordinates):"Point"===t.geometry.type?t.geometry.coordinates:(e=h(t)).reduce(((t,o)=>[t[0]+o[0]/e.length,t[1]+o[1]/e.length]),[0,0]);var e}(u),d&&t){const s="string"==typeof d?function(t){const e=document.createElement("div");return e.innerHTML=t,e}(d):d,c=this._createPopupElement((f=kt({},o),Lt(f,Ft({popupContent:s,close:l}))));n=new m({element:c}),n.setPosition(i(t,this.lonlatProjection,this.displayProjection)),r.addOverlay(n),this._openedPopup.push([e,n,a])}var f},new Promise(((t,i)=>{var r=t=>{try{a(s.next(t))}catch(e){i(e)}},n=t=>{try{a(s.throw(t))}catch(e){i(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,n);a((s=s.apply(e,o)).next())}));var e,o,s}_createPopupElement({closeButton:t,popupContent:e,maxWidth:o,minWidth:i,close:s}){t=null!=t?t:!this.options.selectOnHover;const r=p("div","ol-popup");if(o&&(r.style.maxWidth=o+"px"),i&&(r.style.minWidth=i+"px"),t){const t=p("a","ol-popup-closer",r);t.setAttribute("href","#"),t.addEventListener("click",s)}return p("div","popup-content",r).appendChild(e),r}_removeAllPopup(){const t=[...this._openedPopup];this._openedPopup=[];for(const e of t)this._removePopup(e[1])}_removePopup(t){var e,o;const i=this.map;if(i){i.removeOverlay(t);const s=this._openedPopup.findIndex((e=>e[1]===t));if(-1!==s){const[t,,i]=this._openedPopup[s],r=null==(o=null==(e=this.options.popupOptions)?void 0:e.unselectOnClose)||o;for(const e of i)e(this._createLayerDefOpts(lt(t)));i.length=0,r&&this._unselectFeature(t),this._openedPopup.splice(s,1)}}}}}),_e(Pe,"controlAdapters",{ZOOM:class extends c{constructor(...t){super(...t),this.element.classList.remove("ol-control"),this.element.classList.add("webmap-ctrl-group")}},ATTRIBUTION:class extends n{constructor(t){super(U(U({},G),t))}}});let Oe=Pe;export{Oe as default}; | ||
import{EventEmitter as t}from"events";import e from"ol/Map";import o from"ol/View";import{transform as i,transformExtent as s,fromLonLat as r}from"ol/proj";import n from"ol/control/Attribution";import a from"@nextgis/control-container";import l from"ol/control/Control";import c from"ol/control/Zoom";import{create as p}from"@nextgis/dom";import{getCoordinates as h,defined as u}from"@nextgis/utils";import m from"ol/Overlay";import d from"ol/format/GeoJSON";import f from"ol/layer/Vector";import y from"ol/source/Vector";import{getCenter as g}from"ol/extent";import b from"polylabel";import{isPaintCallback as v,isPaint as _}from"@nextgis/paint";import{asArray as P}from"ol/color";import{Fill as O,Stroke as w,Style as C,Text as j}from"ol/style";import x from"ol/style/Circle";import E from"ol/style/Icon";import L from"@nextgis/queue";import F from"ol/layer/Image";import S from"ol/renderer/canvas/ImageLayer";import V from"ol/source/ImageWMS";import A from"ol/layer/Tile";import I,{ATTRIBUTION as k}from"ol/source/OSM";import M from"ol/source/XYZ";import Z from"ol/source/TileWMS";var D=Object.defineProperty,T=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,H=(t,e,o)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,U=(t,e)=>{for(var o in e||(e={}))R.call(e,o)&&H(t,o,e[o]);if(T)for(var o of T(e))B.call(e,o)&&H(t,o,e[o]);return t};const G={collapsible:!1};var z=Object.defineProperty,N=Object.defineProperties,W=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,J=(t,e,o)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,$=(t,e)=>{for(var o in e||(e={}))X.call(e,o)&&J(t,o,e[o]);if(q)for(var o of q(e))Y.call(e,o)&&J(t,o,e[o]);return t};const K={collapsible:!1};class Q extends l{constructor(t){const e=new a,o=e.getContainer();var i,s,r;super((i=$($({},K),t),N(i,W({element:o})))),J(this,"symbol"!=typeof(s="panelContainer")?s+"":s,r),this.panelContainer=e}addControl(t,e){return o=this,i=null,s=function*(){const o=this.getMap();if(o){const i=this.panelContainer.newPositionContainer(e);if(i){const e=yield t,s=e.element;s&&s.classList.add("webmap-ctrl"),e.setTarget(i),o.addControl(e)}}},new Promise(((t,e)=>{var r=t=>{try{a(s.next(t))}catch(o){e(o)}},n=t=>{try{a(s.throw(t))}catch(o){e(o)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,n);a((s=s.apply(o,i)).next())}));var o,i,s}removeControl(t){const e=this.getMap();e&&e.removeControl(t)}getContainer(){return this.panelContainer.getContainer()}}function tt(t){const e=document.createElement("button");e.className="custom-button-control","string"==typeof t.html?e.innerHTML=t.html:t.html instanceof HTMLElement&&e.appendChild(t.html),"string"==typeof t.title&&(e.title=t.title);const o=document.createElement("div");return o.className=(t.addClass?t.addClass+" ":"")+"ol-unselectable webmap-ctrl-group",o.appendChild(e),o}function et(t,e="EPSG:3857",o="EPSG:4326"){const[s,r]=i(t.coordinate,e,o);return{latLng:{lat:r,lng:s},lngLat:[s,r],pixel:{left:t.pixel[0],top:t.pixel[1]},source:t}}function ot(t){const e=function({feature:t,dataProjection:e,featureProjection:o}){const i=(new d).readFeatures({type:"FeatureCollection",features:Array.isArray(t)?t:[t]},{dataProjection:e,featureProjection:o}),s=new y;return s.addFeatures(i),s}(t),o=e.getExtent(),i=s(o,t.featureProjection,t.dataProjection);return e.dispose(),i}function it(t){return{getBounds:()=>ot(t),getCenter:()=>function(t){const e=ot(t);return g(e)}(t)}}const st=90.71446714322,rt=39.37;function nt(t,e){const o={minZoom:e.minZoom,maxZoom:e.maxZoom};return e.maxScale&&(o.minResolution=at(t,e.maxScale)),e.minScale&&(o.maxResolution=at(t,e.minScale)),o}function at(t,e){if(e)return function(t,e){return t/(e*rt*st)}(e,t.getView().getProjection().getMetersPerUnit()||1)}function lt(t){return(new d).writeFeatureObject(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}function ct(t){const e=decodeURIComponent,o=t.split("&"),i={};let s,r;for(let n,a=0,l=o.length;a<l;++a)if(n=o[a],n.length){const t=n.indexOf("=");t<0?(s=e(n),r=""):(s=e(n.slice(0,t)),r=e(n.slice(t+1))),"string"==typeof i[s]&&(i[s]=[i[s]]),Array.isArray(i[s])?i[s].push(r):i[s]=r}return i}function pt(t,e){const o=[];let i;for(i in t){const s=e?e+"["+i+"]":i,r=t[i];o.push(null!==r&&"object"==typeof r?pt(r,s):encodeURIComponent(s)+"="+encodeURIComponent(r))}return o.join("&")}var ht=Object.defineProperty,ut=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,ft=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,gt=(t,e,o)=>e in t?ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,bt=(t,e)=>{for(var o in e||(e={}))ft.call(e,o)&>(t,o,e[o]);if(dt)for(var o of dt(e))yt.call(e,o)&>(t,o,e[o]);return t};const vt={Point:"point",MultiPoint:"point",LineString:"line",MultiLineString:"line",Polygon:"polygon",MultiPolygon:"polygon",Circle:"point"},_t={polygon:"path",line:"path",point:"circle"};function Pt(t,e){const o=P(t).slice();return o[3]=void 0!==e?e:1,o}function Ot(t,e={}){if(v(e)){return Ot(t,e(lt(t)))}if(_(e)){const o=t.getGeometry(),i=o&&o.getType()||"Point",s={};if(!e.type){const t=vt[i],o="polygon"===t||"line"===t?"path":"html"in e||"className"in e?"icon":_t[t];o&&(e.type=o)}if("path"===e.type||"circle"===e.type){const{radius:t,fill:o,fillColor:r,fillOpacity:n,strokeColor:a,stroke:l,strokeOpacity:c}=bt({},e);o&&r&&"string"==typeof r&&"number"==typeof n&&(s.fill=new O({color:Pt(r,n)})),a&&"string"==typeof a&&"number"==typeof c&&(l||-1!==["MultiLineString","LineString"].indexOf(i))&&(s.stroke=new w({width:e.weight,color:Pt(a,c)})),"circle"===e.type&&"number"==typeof t&&(s.image=new x(bt({radius:t},s)))}else if("icon"===e.type){const t=e.html;if(t){const o={src:"data:image/svg+xml,"+encodeURIComponent(t),anchorXUnits:"pixels",anchorYUnits:"pixels",anchor:e.iconAnchor,rotation:e.rotate};s.image=new E(o)}}return new C(s)}}function wt(t,e){let o={font:"12px Calibri,sans-serif",overflow:!0,fill:new O({color:"#000"}),stroke:new w({color:"#fff",width:3})};var i;return"point"===t&&(i=bt({},o),o=ut(i,mt({placement:"point",textBaseline:"bottom",offsetY:20}))),new C({text:new j(o)})}var Ct=Object.defineProperty,jt=(t,e,o)=>((t,e,o)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o)(t,"symbol"!=typeof e?e+"":e,o);class xt{constructor(t,e){this.map=t,this.options=e,jt(this,"layer")}setOpacity(t){this.options.opacity=Number(t),this.layer&&this.layer.setOpacity&&this.layer.setOpacity(this.options.opacity)}}var Et=Object.defineProperty,Lt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,It=(t,e,o)=>e in t?Et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,kt=(t,e)=>{for(var o in e||(e={}))Vt.call(e,o)&&It(t,o,e[o]);if(St)for(var o of St(e))At.call(e,o)&&It(t,o,e[o]);return t},Mt=(t,e,o)=>It(t,"symbol"!=typeof e?e+"":e,o);function Zt(t,e,o){let i=()=>{};const s=t.getImage();return[new Promise(((t,r)=>{const n=new XMLHttpRequest;n.open("GET",e),n.responseType="arraybuffer";for(const e in o)n.setRequestHeader(e,o[e]);n.onload=function(){const e=new Uint8Array(this.response),o=new Blob([e],{type:"image/png"}),i=(window.URL||window.webkitURL).createObjectURL(o);s.src=i,t()},n.onerror=()=>{r()},n.send(),i=()=>{n.abort(),t()}})),i]}var Dt=Object.defineProperty,Tt=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,Ht=(t,e,o)=>e in t?Dt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Ut=(t,e)=>{for(var o in e||(e={}))Rt.call(e,o)&&Ht(t,o,e[o]);if(Tt)for(var o of Tt(e))Bt.call(e,o)&&Ht(t,o,e[o]);return t},Gt=(t,e,o)=>Ht(t,"symbol"!=typeof e?e+"":e,o);class zt extends F{constructor(t,e){super(t),this.ratio=e}createRenderer(){return new Wt(this,this.ratio)}}class Nt extends V{constructor(t,e){super(t),this.ratio=e}getImageInternal(t,e,o,i){return super.getImageInternal(t,e,this.ratio,i)}}class Wt extends S{constructor(t,e){super(t),this.ratio=e}renderFrame(t,e){return t.pixelRatio=this.ratio,super.renderFrame(t,e)}}const qt=class t extends xt{constructor(t,e){super(t,e),this.map=t,this.options=e,Gt(this,"layer")}addLayer(t){if(Object.assign(this.options,t),t.url){const e=void 0!==t.ratio?t.ratio:1,o={url:t.url,params:Ut({},t.params),projection:void 0,imageLoadFunction:this.constructImageLoadFunction(t)},i=Ut(Ut({opacity:t.opacity},nt(this.map,t)),t.nativeOptions);if(e>1){o.ratio=e,o.serverType="mapserver";const t=new Nt(o,e),s=new zt(Ut({source:t},i),e);this.layer=s}else{const t=new V(o),e=new F(Ut({source:t},i));this.layer=e}return this.layer}}constructImageLoadFunction(e){const o=e.updateWmsParams;return(i,s)=>{const r=s.split("?")[0],n=ct(s.split("?")[1]),{resource:a,BBOX:l,WIDTH:c,HEIGHT:p}=n,h=((t,e)=>{var o={};for(var i in t)Rt.call(t,i)&&e.indexOf(i)<0&&(o[i]=t[i]);if(null!=t&&Tt)for(var i of Tt(t))e.indexOf(i)<0&&Bt.call(t,i)&&(o[i]=t[i]);return o})(n,["resource","BBOX","WIDTH","HEIGHT"]),u=Ut({resource:a,bbox:l,width:c,height:p},h),m=pt(o?o(u):h),d=e.headers,f=r+"?"+m;t.queue.add((()=>Zt(i,f,d)))}}};Gt(qt,"queue",new L({concurrency:6,delay:200}));let Xt=qt;var Yt=Object.defineProperty,Jt=Object.getOwnPropertySymbols,$t=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable,Qt=(t,e,o)=>e in t?Yt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var te=Object.defineProperty,ee=Object.getOwnPropertySymbols,oe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,se=(t,e,o)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,re=(t,e)=>{for(var o in e||(e={}))oe.call(e,o)&&se(t,o,e[o]);if(ee)for(var o of ee(e))ie.call(e,o)&&se(t,o,e[o]);return t};var ne=Object.defineProperty,ae=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,pe=(t,e,o)=>e in t?ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,he=(t,e)=>{for(var o in e||(e={}))le.call(e,o)&&pe(t,o,e[o]);if(ae)for(var o of ae(e))ce.call(e,o)&&pe(t,o,e[o]);return t};var ue=Object.defineProperty,me=Object.defineProperties,de=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,be=(t,e,o)=>e in t?ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,ve=(t,e)=>{for(var o in e||(e={}))ye.call(e,o)&&be(t,o,e[o]);if(fe)for(var o of fe(e))ge.call(e,o)&&be(t,o,e[o]);return t},_e=(t,e,o)=>be(t,"symbol"!=typeof e?e+"":e,o);const Pe=class n{constructor(){_e(this,"options",{target:"map"}),_e(this,"layerAdapters",n.layerAdapters),_e(this,"controlAdapters",n.controlAdapters),_e(this,"emitter",new t),_e(this,"map"),_e(this,"displayProjection","EPSG:3857"),_e(this,"lonlatProjection","EPSG:4326"),_e(this,"_mapClickEvents",[]),_e(this,"_forEachFeatureAtPixel",[]),_e(this,"_unselectCb",[]),_e(this,"_olView"),_e(this,"_panelControl"),_e(this,"_isLoaded",!1),_e(this,"_positionMem",{})}create(t){this.options=ve({},t);const i=this.getViewOptions(this.options),s={controls:[],view:new o(i),layers:[]};t.mapAdapterOptions&&Object.assign(s,t.mapAdapterOptions);const r=(n=ve({},s),me(n,de({target:this.options.target||"map"})));var n;this.map=this.options.map||new e(r),this._panelControl=new Q,this.map.addControl(this._panelControl),this.map.set("_mapClickEvents",this._mapClickEvents),this.map.set("_forEachFeatureAtPixel",this._forEachFeatureAtPixel),this.map.set("_addUnselectCb",(t=>this._addUnselectCb(t))),this.emitter.emit("create",this),this._olView=this.map.getView(),this._isLoaded=!0,this._addMapListeners(),this._addViewListeners()}destroy(){this.map&&this.map.dispose()}getContainer(){if(this.options.target){let t;return"string"==typeof this.options.target?t=document.getElementById(this.options.target):this.options.target instanceof HTMLElement&&(t=this.options.target),t}}getControlContainer(){if(this._panelControl)return this._panelControl.getContainer();throw new Error("The ol-map-adapter ControlPanel has not been initialized yet")}setCenter(t){this._olView&&this._olView.setCenter(r(t))}getCenter(){if(this._olView){const t=this._olView.getCenter();if(t){return i(t,this.displayProjection,this.lonlatProjection)}}}setZoom(t){this._olView&&this._olView.setZoom(t)}getZoom(){if(this._olView)return this._olView.getZoom()}fitBounds(t,e={}){if(this._olView){const{padding:o,maxZoom:i,offset:r}=e,n=this.getZoom(),a=s(t,this.lonlatProjection,this.displayProjection),l={};i&&(l.maxZoom=i),o&&(l.padding=[o,o]),r&&(l.padding=r),this._olView.fit(a,l),this._emitMoveEndEvents({zoom:n})}}getBounds(){if(!this._olView)return;const t=this._olView.calculateExtent();return s(t,this.displayProjection,this.lonlatProjection)}setRotation(t){this._olView&&this._olView.setRotation(t)}setView(t,e){if(this.map)if(Array.isArray(t)){this._setView({zoom:e,center:r(t)})}else{const{bounds:e}=t,o=this.getViewOptions(t);Object.values(o).some(Boolean)&&this._setView(o),e&&this.fitBounds(e)}}removeLayer(t){this.map&&this.map.removeLayer(t)}showLayer(t){if(this.map){const e=this.map.getLayers();for(const o of e.getArray())if(o===t)return void("production"!==process.env.NODE_ENV&&console.warn("DEV: OL layer already added"));this.map.addLayer(t)}}hideLayer(t){this.map&&this.map.removeLayer(t)}setLayerOpacity(t,e){t.setOpacity&&t.setOpacity(Number(e))}setLayerOrder(t,e){t&&t.setZIndex&&t.setZIndex(e)}createControl(t,e){return function(t,e={},o){return new class extends l{constructor(){const i=document.createElement("div");i.className=(e.addClass?e.addClass+" ":"")+"ol-unselectable"+(e.bar?" webmap-ctrl-group":"")+(e.margin?" ol-control-margin":"");const s=t.onAdd(o);s&&i.appendChild(s),super({element:i})}}}(t,e,this)}createButtonControl(t){return function(t){return new class extends l{constructor(){super({element:tt(t)}),t.onClick&&this.element.querySelector("button").addEventListener("click",t.onClick,!1)}handleRotateNorth(){var t;null==(t=this.getMap())||t.getView().setRotation(0)}}}(t)}addControl(t,e){if(this._panelControl)return this._panelControl.addControl(t,e),t}removeControl(t){this._panelControl&&this._panelControl.removeControl(t)}onMapClick(t,e="click"){const o=et(t);this.emitter.emit(`pre${e}`,o);this._callEachFeatureAtPixel(t,e)||"click"!==e||this._mapClickEvents.forEach((e=>{e(t)})),this.emitter.emit(e,o)}getViewOptions(t){const{zoom:e,center:o,maxBounds:i,minZoom:n,maxZoom:a}=t,l={zoom:e,minZoom:n,maxZoom:a,projection:this.displayProjection};if(o&&(l.center=r(o)),i){const t=s(i,this.lonlatProjection,this.displayProjection);l.extent=t}return l}_callEachFeatureAtPixel(t,e){if(t&&t.pixel&&this._forEachFeatureAtPixel.length&&this.map){const o=this._forEachFeatureAtPixel.sort(((t,e)=>e[0]-t[0]));for(const i of o){if(i[1](t.pixel,t,e))return!0}}return!1}_emitMoveEndEvents(t){if(this._isLoaded){const e=this.getZoom();t.zoom!==e&&this.emitter.emit("zoomend")}}_addMapListeners(){const t=this.map;if(t){const e=t.getViewport();t.on("click",(t=>{this.onMapClick(t)})),t.on("dblclick",(t=>{this.onMapClick(t,"dblclick")})),t.on("pointermove",(t=>{this.emitter.emit("mousemove",et(t)),this._callEachFeatureAtPixel(t,"hover")}));const o=e=>{const o=[e.x,e.y],i=t.getCoordinateFromPixel(o);if(i){return et(ve({pixel:o,coordinate:i},e))}};e.addEventListener("mouseout",(t=>{this.emitter.emit("mouseout",o(t))}),!1),e.addEventListener("mouseover",(t=>{this.emitter.emit("mouseover",o(t))}),!1);const i=this.getCenter(),s=this.getZoom(),r=["movestart","moveend"];for(const n of r)this._positionMem[n]={center:i,zoom:s},t.on(n,(()=>{this._emitPositionChangeEvent(n)}));t.once("movestart",(()=>{t.on("movestart",(()=>{Xt.queue.abort()}))}))}}_addViewListeners(){this._olView&&(this._olView.on("change:resolution",(()=>{this.emitter.emit("zoom",this)})),this._olView.on("change:center",(()=>{this.emitter.emit("move",this)})))}_setView(t){const{center:e,zoom:i,extent:s,minZoom:r,maxZoom:n}=t,a=this.map;if(!a)return;const l=a.getView();if(void 0!==s){l.dispose();const e=new o(t);this._olView=e,this._addViewListeners(),a.setView(e)}else e&&l.setCenter(e),void 0!==i&&l.setZoom(i),void 0!==r&&l.setMinZoom(r),void 0!==n&&l.setMaxZoom(n)}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_emitPositionChangeEvent(t){const e=this._positionMem[t];let o,i;e&&(o=e.center,i=e.zoom);const s=this.getCenter(),r=this.getZoom();if(i!==r){this.emitter.emit("movestart"===t?"zoomstart":"zoomend",this)}if(o&&s){const[e,i]=s,[r,n]=o;e===r&&i===n||this.emitter.emit(t,this)}else o!==s&&this.emitter.emit(t,this);this._positionMem[t]={center:s,zoom:r}}};_e(Pe,"layerAdapters",{IMAGE:Xt,TILE:class extends xt{constructor(t,e){super(t,e),this.map=t,this.options=e}addLayer(t){Object.assign(this.options,t);const e=function(t,e){const o=[],i="string"==typeof e?e.split(""):e;return(null==i?void 0:i.length)?i.forEach((e=>{o.push(t.replace(/{s}/,e))})):o.push(t),o}(t.url,t.subdomains),o={attributions:t.attribution?[t.attribution]:[],urls:e};t.crossOrigin&&(o.crossOrigin=t.crossOrigin);const i=new M(o),s=t.headers;s&&i.setTileLoadFunction(((t,e)=>{Zt(t,e,s)}));return new A(re(re({source:i,opacity:t.opacity},nt(this.map,t)),t.nativeOptions))}},WMS:class extends xt{constructor(t,e){var o,i;super(t,e),this.map=t,this.options=e,pe(this,"symbol"!=typeof(o="layer")?o+"":o,i)}addLayer(t){Object.assign(this.options,t);const e={url:t.url,params:{LAYERS:t.layers,VERSION:t.version},projection:void 0},o=t.updateWmsParams;o&&(e.tileLoadFunction=(e,i)=>{const s=i.split("?")[0],r=i.split("?")[1],{resource:n,BBOX:a,WIDTH:l,HEIGHT:c}=ct(r),p=pt(o({resource:n,bbox:a,width:l,height:c})),h=t.headers,u=s+"?"+p;h?Zt(e,u,h):e.getImage().src=u});const i=new Z(e),s=new A(he(he({source:i,opacity:t.opacity},nt(this.map,t)),t.nativeOptions));return this.layer=s,s}},OSM:class extends xt{constructor(t,e){var o;super(t,e),this.map=t,this.options=e,Qt(this,"symbol"!=typeof(o="name")?o+"":o,"OpenStreetMap")}addLayer(t){Object.assign(this.options,t),this.options.name=this.name;return new A(((t,e)=>{for(var o in e||(e={}))$t.call(e,o)&&Qt(t,o,e[o]);if(Jt)for(var o of Jt(e))Kt.call(e,o)&&Qt(t,o,e[o]);return t})({source:new I({attributions:[k]})},t.nativeOptions))}},GEOJSON:class extends xt{constructor(t,e){var o;super(t,e),this.map=t,this.options=e,Mt(this,"layer"),Mt(this,"paint"),Mt(this,"selectedPaint"),Mt(this,"selected",!1),Mt(this,"displayProjection","EPSG:3857"),Mt(this,"lonlatProjection","EPSG:4326"),Mt(this,"vectorSource",new y),Mt(this,"_features",[]),Mt(this,"_selectedFeatures",[]),Mt(this,"_filterFun"),Mt(this,"_mouseOver"),Mt(this,"_openedPopup",[]),Mt(this,"_forEachFeatureAtPixel",[]),Mt(this,"_mapClickEvents",[]),Mt(this,"_styleCache",{}),Mt(this,"_labelVisibility",!0),this._labelVisibility=null!=(o=e.labelVisibility)?o:this._labelVisibility,this.displayProjection=t.getView().getProjection().getCode()}get addUnselectCb(){return this.map.get("_addUnselectCb")}get mapClickEvents(){return this.map.get("_mapClickEvents")}get forEachFeatureAtPixel(){return this.map.get("_forEachFeatureAtPixel")}addLayer(t){var e;Object.assign(this.options,t),this.paint=t.paint,this.selectedPaint=t.selectedPaint;const o=t.data;o&&this.addData(o),this.layer=new f(kt(kt({source:this.vectorSource,style:e=>this._getFeatureStyle(e,t.paint||{},t.type)},nt(this.map,t)),t.nativeOptions));return(null==(e=t.interactive)||e)&&this._addEventListener(),this.layer}beforeRemove(){const t=this.forEachFeatureAtPixel;for(let o=t.length;o--;){const e=t[o][1];-1!==t.findIndex((t=>t[1]===e))&&t.splice(o,1)}this._forEachFeatureAtPixel.length=0;const e=this.mapClickEvents;for(let o=e.length;o--;){-1!==e.indexOf(e[o])&&e.splice(o,1)}this._mapClickEvents.length=0,this._removeAllPopup()}clearLayer(t){if(this.unselect(),t){const e=this.vectorSource.getFeatures().values();let o;for(;!(o=e.next()).done;){t(lt(o.value))&&this.vectorSource.removeFeature(o.value)}}else this.vectorSource.clear()}setData(t){this.clearLayer(),this.addData(t)}addData(t){const e=this.options.srs,o="EPSG:"+(null!=e?e:"4326"),i=(new d).readFeatures(t,{dataProjection:o,featureProjection:this.displayProjection});if(this._features=this._features.concat(i),this._filterFun)this.filter(this._filterFun);else if(this.vectorSource.addFeatures(i),this.options.popup)for(const s of this._features)this._openPopup({feature:s,type:"api",options:this.options.popupOptions})}select(t){if(this.unselect(),"function"==typeof t){const e=this._features.filter((e=>t(this._createLayerDefOpts(lt(e)))));for(const t of e)this._selectFeature(t)}else this.selected||(this.selected=!0,this.selectedPaint&&this._setPaintEachLayer(this.selectedPaint))}unselect(t){let e=this._selectedFeatures;"function"==typeof t?e=this._selectedFeatures.filter((e=>t(this._createLayerDefOpts(lt(e))))):this.selected&&(this.selected=!1);for(const o of e)this._unselectFeature(o);this._removeAllPopup()}getLayers(){return this._features.map((t=>this._createLayerDefOpts(lt(t))))}getSelected(){return this._selectedFeatures.map((t=>this._createLayerDefOpts(lt(t))))}filter(t){this._filterFun=t;const e=this._features,o=t?e.filter((e=>t(this._createLayerDefOpts(lt(e))))):e;this.vectorSource.clear();const i=o.length;for(let s=0;s<i;s++)this.vectorSource.addFeature(o[s]);return o.map((t=>this._createLayerDefOpts(lt(t))))}cleanFilter(){this.filter()}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getSource();if(t){const e=t.getExtent();return s(e,this.displayProjection,this.lonlatProjection)}}}setPaint(t){t&&(this.paint=t,this._setPaintEachLayer(this.paint))}setSelectedPaint(t){t&&(this.selectedPaint=t,this._setPaintEachLayer(this.selectedPaint))}updatePaint(t){this.paint=kt(kt({},this.paint),t),this._setPaintEachLayer(this.paint)}updateSelectedPaint(t){this.selectedPaint=kt(kt({},this.selectedPaint),t),this._setPaintEachLayer(this.selectedPaint)}isLabelVisible(){return this._labelVisibility}hideLabel(){this._toggleLabel(!1)}showLabel(){this._toggleLabel(!0)}_toggleLabel(t){this._labelVisibility=t,this.updatePaint({})}_createLayerDefOpts(t){return kt({target:this,feature:t},it({feature:t,dataProjection:this.lonlatProjection,featureProjection:this.displayProjection}))}_getFeatureStyle(t,e,o="polygon"){var i;const s=[],r=t.getId(),n=void 0!==r&&this._styleCache[r];if(n)return n;const a=Ot(t,e);if(a&&s.push(a),this._labelVisibility){const{labelField:e,label:r}=this.options;let n="";if("string"==typeof e?n=t.get(e):r&&(n=r(this._createLayerDefOpts(lt(t)))),n=String(n),n){const t=u(n)?n:"";if(t){const e=wt(o);null==(i=e.getText())||i.setText(t),s.push(e)}}}return void 0!==r&&(this._styleCache[r]=s),s}_setPaintEachLayer(t){if(this._styleCache={},this.layer){const e=this.layer.getSource();if(e){const o=e.getFeatures();for(const e of o){const o=this._getFeatureStyle(e,t,this.options.type);o&&e.setStyle(o)}}}}_addEventListener(){var t;const e=this.forEachFeatureAtPixel,o=[this.options.order||0,(t,e,o)=>this._onFeatureAtPixel(t,e,o)];this._forEachFeatureAtPixel.push(o),e.push(o);(null==(t=this.options.unselectOnClick)||t)&&(this._mapClickEvents.push((()=>this.unselect())),this.mapClickEvents.push((()=>this.unselect())))}_onFeatureAtPixel(t,e,o){const i=t&&this.map.getFeaturesAtPixel(t,{layerFilter:t=>t===this.layer})[0],s=(t=>({layer:this,event:et(t),source:t}))(e);if(i){const t=kt(kt({},s),this._createLayerDefOpts(lt(i)));let e=-1!==this._selectedFeatures.indexOf(i);return this.options.selectable&&("hover"===o&&this.options.selectOnHover||"click"===o)&&(e?this.options&&this.options.unselectOnSecondClick&&(this._unselectFeature(i),e=!1):(this._selectFeature(i,t.event.lngLat),e=!0)),"click"===o&&this.options.onClick&&this.options.onClick(kt({selected:e},t)),"dblclick"===o&&this.options.onDoubleClick&&this.options.onDoubleClick(kt({selected:e},t)),"hover"===o&&(this._mouseOver=!0,this.options.onMouseOver&&this.options.onMouseOver(t)),!0}return"hover"===o&&this._mouseOver&&(this._mouseOver=!1,this.options.onMouseOut&&this.options.onMouseOut(s),this.options.selectOnHover&&this.unselect()),!1}_selectFeature(t,e){const{multiselect:o,selectedPaint:i,popupOptions:s,popupOnSelect:r,onSelect:n}=this.options||{},a=e?"click":"api";if(!o){this.addUnselectCb((()=>this._unselectFeature(t)));for(const t of this._selectedFeatures)this._unselectFeature(t)}if(this._selectedFeatures.push(t),this.selected=!0,i){const e=Ot(t,i);e&&t.setStyle(e)}if(r&&this._openPopup({coordinates:e,feature:t,options:s,type:"click"}),n){const e=lt(t);n(kt({layer:this,features:[],type:a},it({feature:e,dataProjection:this.lonlatProjection,featureProjection:this.displayProjection})))}}_unselectFeature(t){const e=this._selectedFeatures.indexOf(t);if(-1!==e){this._selectedFeatures.splice(e,1);const o=this._openedPopup.find((e=>e[0]===t));o&&this._removePopup(o[1])}if(this.selected=this._selectedFeatures.length>0,this.options&&this.options.paint){const e=Ot(t,this.options.paint);e&&t.setStyle(e)}}_openPopup(t){return e=this,o=arguments,s=function*({coordinates:t,feature:e,options:o={},type:s}){const r=this.map;if(!r)return;let n;const a=[],l=()=>{n&&this._removePopup(n)},{createPopupContent:c,popupContent:p}=o,u=lt(e),d=c?yield c(kt({close:l,onClose:t=>{a.push(t)},type:s},this._createLayerDefOpts(u))):p;if(t=t||u&&function(t){return"Polygon"===t.geometry.type?b(t.geometry.coordinates):"Point"===t.geometry.type?t.geometry.coordinates:(e=h(t)).reduce(((t,o)=>[t[0]+o[0]/e.length,t[1]+o[1]/e.length]),[0,0]);var e}(u),d&&t){const s="string"==typeof d?function(t){const e=document.createElement("div");return e.innerHTML=t,e}(d):d,c=this._createPopupElement((f=kt({},o),Lt(f,Ft({popupContent:s,close:l}))));n=new m({element:c}),n.setPosition(i(t,this.lonlatProjection,this.displayProjection)),r.addOverlay(n),this._openedPopup.push([e,n,a])}var f},new Promise(((t,i)=>{var r=t=>{try{a(s.next(t))}catch(e){i(e)}},n=t=>{try{a(s.throw(t))}catch(e){i(e)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,n);a((s=s.apply(e,o)).next())}));var e,o,s}_createPopupElement({closeButton:t,popupContent:e,maxWidth:o,minWidth:i,close:s}){t=null!=t?t:!this.options.selectOnHover;const r=p("div","ol-popup");if(o&&(r.style.maxWidth=o+"px"),i&&(r.style.minWidth=i+"px"),t){const t=p("a","ol-popup-closer",r);t.setAttribute("href","#"),t.addEventListener("click",s)}return p("div","popup-content",r).appendChild(e),r}_removeAllPopup(){const t=[...this._openedPopup];this._openedPopup=[];for(const e of t)this._removePopup(e[1])}_removePopup(t){var e,o;const i=this.map;if(i){i.removeOverlay(t);const s=this._openedPopup.findIndex((e=>e[1]===t));if(-1!==s){const[t,,i]=this._openedPopup[s],r=null==(o=null==(e=this.options.popupOptions)?void 0:e.unselectOnClose)||o;for(const e of i)e(this._createLayerDefOpts(lt(t)));i.length=0,r&&this._unselectFeature(t),this._openedPopup.splice(s,1)}}}}}),_e(Pe,"controlAdapters",{ZOOM:class extends c{constructor(...t){super(...t),this.element.classList.remove("ol-control"),this.element.classList.add("webmap-ctrl-group")}},ATTRIBUTION:class extends n{constructor(t){super(U(U({},G),t))}}});let Oe=Pe;export{Oe as default}; | ||
//# sourceMappingURL=ol-map-adapter.esm-bundler.prod.js.map |
{ | ||
"name": "@nextgis/ol-map-adapter", | ||
"version": "2.2.3", | ||
"version": "2.3.0", | ||
"_priority": 16, | ||
@@ -12,8 +12,8 @@ "description": "", | ||
"dependencies": { | ||
"@nextgis/control-container": "^2.2.3", | ||
"@nextgis/dom": "^2.0.2", | ||
"@nextgis/paint": "^2.2.3", | ||
"@nextgis/properties-filter": "^2.2.3", | ||
"@nextgis/queue": "^2.2.1", | ||
"@nextgis/webmap": "^2.2.3", | ||
"@nextgis/control-container": "^2.3.0", | ||
"@nextgis/dom": "^2.3.0", | ||
"@nextgis/paint": "^2.3.0", | ||
"@nextgis/properties-filter": "^2.3.0", | ||
"@nextgis/queue": "^2.3.0", | ||
"@nextgis/webmap": "^2.3.0", | ||
"@types/events": "^3.0.0", | ||
@@ -29,3 +29,3 @@ "@types/geojson": "^7946.0.14", | ||
"devDependencies": { | ||
"@nextgis/build-tools": "^2.0.2", | ||
"@nextgis/build-tools": "^2.3.0", | ||
"ol": "^9.1.0" | ||
@@ -66,3 +66,3 @@ }, | ||
}, | ||
"gitHead": "3f367cf4bf7dfc602c12a409da5647bd3d1181ce" | ||
"gitHead": "e25d812d39f6c704adb2884ffbf20e84ef7cb1dc" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14092296
99335
Updated@nextgis/dom@^2.3.0
Updated@nextgis/paint@^2.3.0
Updated@nextgis/queue@^2.3.0
Updated@nextgis/webmap@^2.3.0