From 2bd07b74992198288ac00c40b2520c230d8c5472 Mon Sep 17 00:00:00 2001 From: Traineratwot Date: Mon, 17 Jun 2024 13:04:18 +0300 Subject: [PATCH] geocoder languages --- resources/dist/filament-openstreetmap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/dist/filament-openstreetmap.js b/resources/dist/filament-openstreetmap.js index d98710b..3053b2f 100644 --- a/resources/dist/filament-openstreetmap.js +++ b/resources/dist/filament-openstreetmap.js @@ -23,7 +23,7 @@ var Qg=Object.create;var ys=Object.defineProperty;var tm=Object.getOwnPropertyDe `;class Ue{constructor(){this.settings={url:"https://photon.komoot.io/api/",params:{q:"",limit:10,lang:"en"},langs:["de","it","fr","en"]}}getParameters(x){return x.lang=x.lang.toLowerCase(),{url:this.settings.url,params:{q:x.query,limit:x.limit||this.settings.params.limit,lang:this.settings.langs.includes(x.lang)?x.lang:this.settings.params.lang}}}handleResponse(x){return x.features.length===0?[]:x.features.map(E=>({lon:E.geometry.coordinates[0],lat:E.geometry.coordinates[1],address:{name:E.properties.name,postcode:E.properties.postcode,city:E.properties.city,state:E.properties.state,country:E.properties.country},original:{formatted:E.properties.name,details:E.properties}}))}}class bn{constructor(x){this.settings={url:"https://nominatim.openstreetmap.org/search",...x,params:{q:"",format:"json",addressdetails:1,limit:10,countrycodes:"",viewbox:"","accept-language":"en-US"}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,format:this.settings.params.format,addressdetails:this.settings.params.addressdetails,limit:x.limit||this.settings.params.limit,countrycodes:x.countrycodes||this.settings.params.countrycodes,viewbox:x.viewbox||this.settings.params.viewbox,"accept-language":x.lang||this.settings.params["accept-language"]}}}handleResponse(x){return x.length===0?[]:x.map(E=>({lon:E.lon,lat:E.lat,bbox:E.boundingbox,address:{name:E.display_name,road:E.address.road||"",houseNumber:E.address.house_number||"",postcode:E.address.postcode,city:E.address.city||E.address.town,state:E.address.state,country:E.address.country},original:{formatted:E.display_name,details:E.address}}))}}class An{constructor(){this.settings={url:"https://open.mapquestapi.com/nominatim/v1/search.php",params:{q:"",key:"",format:"json",addressdetails:1,limit:10,countrycodes:"","accept-language":"en-US"}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,key:x.key,format:"json",addressdetails:1,limit:x.limit||this.settings.params.limit,countrycodes:x.countrycodes||this.settings.params.countrycodes,"accept-language":x.lang||this.settings.params["accept-language"]}}}handleResponse(x){return x.length===0?[]:x.map(E=>({lon:E.lon,lat:E.lat,address:{name:E.address.neighbourhood||"",road:E.address.road||"",postcode:E.address.postcode,city:E.address.city||E.address.town,state:E.address.state,country:E.address.country},original:{formatted:E.display_name,details:E.address}}))}}class Mn{constructor(){this.settings={url:"https://dev.virtualearth.net/REST/v1/Locations",callbackName:"jsonp",params:{query:"",key:"",includeNeighborhood:0,maxResults:10}}}getParameters(x){return{url:this.settings.url,callbackName:this.settings.callbackName,params:{query:x.query,key:x.key,includeNeighborhood:x.includeNeighborhood||this.settings.params.includeNeighborhood,maxResults:x.maxResults||this.settings.params.maxResults}}}handleResponse(x){let{resources:E}=x.resourceSets[0];return E.length===0?[]:E.map(M=>({lon:M.point.coordinates[1],lat:M.point.coordinates[0],address:{name:M.name},original:{formatted:M.address.formattedAddress,details:M.address}}))}}class Oi{constructor(){this.settings={url:"https://api.opencagedata.com/geocode/v1/json?",params:{q:"",key:"",limit:10,countrycode:"",pretty:1,no_annotations:1}}}getParameters(x){return{url:this.settings.url,params:{q:x.query,key:x.key,limit:x.limit||this.settings.params.limit,countrycode:x.countrycodes||this.settings.params.countrycodes}}}handleResponse(x){return x.results.length===0?[]:x.results.map(E=>({lon:E.geometry.lng,lat:E.geometry.lat,address:{name:E.components.house_number||"",road:E.components.road||"",postcode:E.components.postcode,city:E.components.city||E.components.town,state:E.components.state,country:E.components.country},original:{formatted:E.formatted,details:E.components}}))}}let Mt=O.cssClasses;class Bt{constructor(x,E){this.Base=x,this.layerName=I("geocoder-layer-"),this.layer=new f.default({name:this.layerName,source:new g.default,displayInLayerSwitcher:!1}),this.options=x.options,this.options.provider=typeof this.options.provider=="string"?this.options.provider.toLowerCase():this.options.provider,this.provider=this.newProvider(),this.els=E,this.lastQuery="",this.container=this.els.container,this.registeredListeners={mapClick:!1},this.setListeners()}setListeners(){let x=E=>{E.stopPropagation(),pe(this.els.control,Mt.glass.expanded)?this.collapse():this.expand()};this.els.input.addEventListener("keypress",E=>{let M=E.target.value.trim();(E.key?E.key==="Enter":E.which?E.which===13:E.keyCode&&E.keyCode===13)&&(E.preventDefault(),this.query(M))},!1),this.els.input.addEventListener("click",E=>E.stopPropagation(),!1),this.els.input.addEventListener("input",E=>{E.target.value.trim().length!==0?st(this.els.search,Mt.hidden):q(this.els.search,Mt.hidden)},!1),this.els.search.addEventListener("click",()=>{this.els.input.focus(),this.query(this.els.input.value)},!1),this.options.targetType===j&&this.els.button.addEventListener("click",x,!1)}query(x){this.provider||(this.provider=this.newProvider());let E=this.provider.getParameters({query:x,key:this.options.key,lang:this.options.lang,countrycodes:this.options.countrycodes,viewbox:this.options.viewbox,limit:this.options.limit});if(this.lastQuery===x&&this.els.result.firstChild)return;this.lastQuery=x,this.clearResults(),q(this.els.search,Mt.spin);let M={url:E.url,data:E.params};E.callbackName&&(M.jsonp=!0,M.callbackName=E.callbackName),Ye(M).then(B=>{this.options.debug&&console.info(B),st(this.els.search,Mt.spin);let Q=this.provider.handleResponse(B);Q&&(this.createList(Q),this.listenMapClick())}).catch(()=>{st(this.els.search,Mt.spin);let B=ee("li","
Error! No internet connection?
");this.els.result.append(B)})}createList(x){let E=this.els.result;x.forEach(M=>{let B;if(this.options.provider===Y?B=`${M.address.name}`:B=this.addressTemplate(M.address),x.length==1)this.chosen(M,B,M.address,M.original);else{let Q=ee("li",`${B}`);Q.addEventListener("click",Wt=>{Wt.preventDefault(),this.chosen(M,B,M.address,M.original)},!1),E.append(Q)}})}chosen(x,E,M,B){let Q=this.Base.getMap(),Wt=[Number.parseFloat(x.lon),Number.parseFloat(x.lat)],Rt=Q.getView().getProjection(),be=_.transform(Wt,"EPSG:4326",Rt),{bbox:Kt}=x;Kt&&(Kt=_.transformExtent([parseFloat(Kt[2]),parseFloat(Kt[0]),parseFloat(Kt[3]),parseFloat(Kt[1])],"EPSG:4326",Rt));let si={formatted:E,details:M,original:B};if(this.options.keepOpen===!1&&this.clearResults(!0),this.options.preventDefault===!0||this.options.preventMarker===!0)this.Base.dispatchEvent({type:W,address:si,coordinate:be,bbox:Kt,place:x});else{let Pn=this.createFeature(be,si);this.Base.dispatchEvent({type:W,address:si,feature:Pn,coordinate:be,bbox:Kt,place:x})}this.options.preventDefault!==!0&&this.options.preventPanning!==!0&&(Kt?Q.getView().fit(Kt,{duration:500}):Q.getView().animate({center:be,resolution:this.options.defaultFlyResolution,duration:500}))}createFeature(x){let E=new p.default(new m.default(x));return this.addLayer(),E.setStyle(this.options.featureStyle),E.setId(I("geocoder-ft-")),this.getSource().addFeature(E),E}addressTemplate(x){let E=[];return x.name&&E.push(['{name}'].join("")),(x.road||x.building||x.house_number)&&E.push(['{building} {road} {house_number}'].join("")),(x.city||x.town||x.village)&&E.push(['{postcode} {city} {town} {village}'].join("")),(x.state||x.country)&&E.push(['{state} {country}'].join("")),Gt(E.join("
"),x)}newProvider(){switch(this.options.provider){case Y:return new bn(this.options);case F:return new An;case P:return new Ue;case N:return new Mn;case nt:return new Oi;default:return this.options.provider}}expand(){st(this.els.input,Mt.spin),q(this.els.control,Mt.glass.expanded),window.setTimeout(()=>this.els.input.focus(),100),this.listenMapClick()}collapse(){this.els.input.value="",this.els.input.blur(),q(this.els.search,Mt.hidden),st(this.els.control,Mt.glass.expanded),this.clearResults()}listenMapClick(){if(this.registeredListeners.mapClick)return;let x=this,E=this.Base.getMap().getTargetElement();this.registeredListeners.mapClick=!0,E.addEventListener("click",{handleEvent(M){x.clearResults(!0),E.removeEventListener(M.type,this,!1),x.registeredListeners.mapClick=!1}},!1)}clearResults(x){x&&this.options.targetType===j?this.collapse():function(E){for(;E.firstChild;)E.firstChild.remove()}(this.els.result)}getSource(){return this.layer.getSource()}addLayer(){let x=!1,E=this.Base.getMap();E.getLayers().forEach(M=>{M===this.layer&&(x=!0)}),x||E.addLayer(this.layer)}}class Xt extends c.default{constructor(x=Z,E){At(typeof x=="string","@param `type` should be string!"),At(x===Z||x===it,`@param 'type' should be '${Z}' or '${it}'!`);let M={...at,featureStyle:[new u.default({image:new d.default({scale:.7,src:"//cdn.rawgit.com/jonataswalker/map-utils/master/images/marker.png"})})],...E},B,Q,Wt=new Le(M);if(x===Z&&(B=Wt.els.container),super({element:B,...M}),!(this instanceof Xt))return new Xt;this.options=M,this.container=B,x===Z&&(Q=new Bt(this,Wt.els),this.layer=Q.layer)}getLayer(){return this.layer}getSource(){return this.getLayer().getSource()}setProvider(x){this.options.provider=x}setProviderKey(x){this.options.key=x}}return Xt})});Fe();zn();br();xs();Ht();wt();De();rt();oa();lr();_i();var Ja=class extends Dn{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){H()}calculateMatrices2D(t){let e=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;zt(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Un(r,i)}forEachFeatureAtCoordinate(t,e,i,r,s,o,a,l){let h,c=e.viewState;function u(w,T,R,A){return s.call(o,T,w?R:null,A)}let d=c.projection,f=er(t.slice(),d),g=[[0,0]];if(d.canWrapX()&&r){let w=d.getExtent(),T=$(w);g.push([-T,0],[T,0])}let m=e.layerStatesArray,p=m.length,_=[],y=[];for(let w=0;w=0;--T){let R=m[T],A=R.layer;if(A.hasRenderer()&&Ur(R,c)&&a.call(l,A)){let b=A.getRenderer(),O=A.getSource();if(b&&O){let W=O.getWrapX()?f:t,Z=u.bind(null,R.managed);y[0]=W[0]+g[w][0],y[1]=W[1]+g[w][1],h=b.forEachFeatureAtCoordinate(y,e,i,Z,_)}if(h)return h}}if(_.length===0)return;let C=1/_.length;return _.forEach((w,T)=>w.distanceSq+=T*C),_.sort((w,T)=>w.distanceSq-T.distanceSq),_.some(w=>h=w.callback(w.feature,w.layer,w.geometry)),h}hasFeatureAtCoordinate(t,e,i,r,s,o){return this.forEachFeatureAtCoordinate(t,e,i,r,li,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(t){H()}flushDeclutterItems(t){}scheduleExpireIconCache(t){Hn.canExpireCache()&&t.postRenderFunctions.push(Fm)}};function Fm(n,t){Hn.expire()}var gd=Ja;Fn();tl();$n();cr();Ti();lr();fe();te();var al=class extends gd{constructor(t){super(t),this.fontChangeListenerKey_=U(Ze,Ae.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");let e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=Zi+" ol-layers";let i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0,this.declutterLayers_=[]}dispatchRenderEvent(t,e){let i=this.getMap();if(i.hasListener(t)){let r=new ro(t,void 0,e);i.dispatchEvent(r)}}disposeInternal(){et(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Jt.PRECOMPOSE,t);let e=t.layerStatesArray.sort(function(o,a){return o.zIndex-a.zIndex}),i=t.viewState;this.children_.length=0;let r=this.declutterLayers_;r.length=0;let s=null;for(let o=0,a=e.length;o=0;--i)e[i].renderDeclutter(t);e.length=0}},wd=al;pt();lr();ha();zn();br();je();pt();Fn();Zt();Oe();rt();wt();fe();var Ne=class extends Ft{constructor(t,e){super(t),this.layer=e}},ll={LAYERS:"layers"},hl=class n extends Gs{constructor(t){t=t||{};let e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(ll.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new $t(i.slice(),{unique:!0}):z(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new $t(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(et),this.layersListenerKeys_.length=0;let t=this.getLayers();this.layersListenerKeys_.push(U(t,Dt.ADD,this.handleLayersAdd_,this),U(t,Dt.REMOVE,this.handleLayersRemove_,this));for(let i in this.listenerKeys_)this.listenerKeys_[i].forEach(et);Be(this.listenerKeys_);let e=t.getArray();for(let i=0,r=e.length;i{this.clickTimeoutId_=void 0;let i=new $e(dt.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){let e=t,i=e.pointerId;if(e.type==dt.POINTERUP||e.type==dt.POINTERCANCEL){delete this.trackedTouches_[i];for(let r in this.trackedTouches_)if(this.trackedTouches_[r].target!==e.target){delete this.trackedTouches_[r];break}}else(e.type==dt.POINTERDOWN||e.type==dt.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);let e=new $e(dt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);let e=new $e(dt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){let i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(U(i,dt.POINTERMOVE,this.handlePointerMove_,this),U(i,dt.POINTERUP,this.handlePointerUp_,this),U(this.element_,dt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(U(this.element_.getRootNode(),dt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;let e=new $e(dt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;let e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new $e(dt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){let e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(et(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(D.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(et(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},Td=dl;fl();var Ut={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};Fn();$n();pt();Zt();Oe();var Vr=1/0,gl=class{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Be(this.queuedElements_)}dequeue(){let t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));let r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(t){z(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let e=this.priorityFunction_(t);return e!=Vr?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){let e=this.elements_,i=this.priorities_,r=e.length,s=e[t],o=i[t],a=t;for(;t>1;){let l=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),c=ht;){let a=this.getParentIndex_(e);if(r[a]>o)i[e]=i[a],r[e]=r[a],e=a;else break}i[e]=s,r[e]=o}reprioritize(){let t=this.priorityFunction_,e=this.elements_,i=this.priorities_,r=0,s=e.length,o,a,l;for(a=0;a0;)s=this.dequeue()[0],o=s.getKey(),r=s.getState(),r===k.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++i,s.load())}},Rd=ml;function Sd(n,t,e,i,r){if(!n||!(e in n.wantedTiles))return Vr;if(!n.wantedTiles[e][t.getKey()])return Vr;let s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}no();Xs();ci();Ht();De();Zt();rt();dr();pt();cr();Ct();te();var _l=class extends vi{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1);let e=t.className!==void 0?t.className:"ol-attribution",i=t.tipLabel!==void 0?t.tipLabel:"Attributions",r=t.expandClassName!==void 0?t.expandClassName:e+"-expand",s=t.collapseLabel!==void 0?t.collapseLabel:"\u203A",o=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=o):this.collapseLabel_=s;let a=t.label!==void 0?t.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=r):this.label_=a;let l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(D.CLICK,this.handleClick_.bind(this),!1);let h=e+" "+Zi+" "+hr+(this.collapsed_&&this.collapsible_?" "+el:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=h,c.appendChild(this.toggleButton_),c.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){let e=Array.from(new Set(this.getMap().getAllLayers().flatMap(r=>r.getAttributions(t)))),i=!this.getMap().getAllLayers().some(r=>r.getSource()&&r.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(i),e}updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}let e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Vt(e,this.renderedAttributions_)){pd(this.ulElement_);for(let r=0,s=e.length;r0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:Re}):e.setRotation(0))}render(t){let e=t.frameState;if(!e)return;let i=e.viewState.rotation;if(i!=this.rotation_){let r="rotate("+i+"rad)";if(this.autoHide_){let s=this.element.classList.contains(jr);!s&&i===0?this.element.classList.add(jr):s&&i!==0&&this.element.classList.remove(jr)}this.label_.style.transform=r}this.rotation_=i}},bd=yl;dr();pt();cr();Ui();var xl=class extends vi{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});let e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,r=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",s=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"\u2013",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",h=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=r,c.setAttribute("type","button"),c.title=l,c.appendChild(typeof o=="string"?document.createTextNode(o):o),c.addEventListener(D.CLICK,this.handleClick_.bind(this,i),!1);let u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=h,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(D.CLICK,this.handleClick_.bind(this,-i),!1);let d=e+" "+Zi+" "+hr,f=this.element;f.className=d,f.appendChild(c),f.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){let i=this.getMap().getView();if(!i)return;let r=i.getZoom();if(r!==void 0){let s=i.getConstrainedZoom(r+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Re})):i.setZoom(s)}}},Ad=xl;function Zr(n){n=n||{};let t=new $t;return(n.zoom!==void 0?n.zoom:!0)&&t.push(new Ad(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&t.push(new bd(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&t.push(new Ld(n.attributionOptions)),t}zn();Fe();var El={ACTIVE:"active"};Ui();var Cl=class extends St{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(El.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(El.ACTIVE,t)}setMap(t){this.map_=t}};function Md(n,t,e){let i=n.getCenterInternal();if(i){let r=[i[0]+t[0],i[1]+t[1]];n.animateInternal({duration:e!==void 0?e:250,easing:Xu,center:n.getConstrainedCenter(r)})}}function fr(n,t,e,i){let r=n.getZoom();if(r===void 0)return;let s=n.getConstrainedZoom(r+t),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:e,duration:i!==void 0?i:250,easing:Re})}var Qe=Cl;var wl=class extends Qe{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==dt.DBLCLICK){let i=t.originalEvent,r=t.map,s=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();fr(a,o,s,this.duration_),i.preventDefault(),e=!0}return!e}},Pd=wl;var Tl=class extends Qe{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==dt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==dt.POINTERUP){let i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==dt.POINTERDOWN){let i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==dt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}};function gr(n){let t=n.length,e=0,i=0;for(let r=0;r0&&this.condition_(t)){let i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},Gd=vl;Ht();Vs();var Rl=class extends ti{constructor(t){t=t||{},super({stopDown:hi}),this.condition_=t.condition?t.condition:Od,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!uo(t))return;let e=t.map,i=e.getView();if(i.getConstraints().rotation===rr)return;let r=e.getSize(),s=t.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){let a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return uo(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return uo(t)&&lo(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}},Xd=Rl;je();xs();Va();var Sl=class extends Dn{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){let t=this.startPixel_,e=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(t[0],e[0])+i,r.top=Math.min(t[1],e[1])+i,r.width=Math.abs(e[0]-t[0])+i,r.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){let t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new dd([r])}getGeometry(){return this.geometry_}},Wd=Sl;var fo={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},Hr=class extends Ft{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}},Il=class extends ti{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new Wd(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:lo,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){let r=i[0]-e[0],s=i[1]-e[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Hr(fo.BOXDRAG,t.coordinate,t))}handleUpEvent(t){this.box_.setMap(null);let e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Hr(e?fo.BOXEND:fo.BOXCANCEL,t.coordinate,t)),!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Hr(fo.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}},zd=Il;Ui();var Ll=class extends zd{constructor(t){t=t||{};let e=t.condition?t.condition:kd;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){let i=this.getMap().getView(),r=this.getGeometry();if(this.out_){let s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:Re})}},Yd=Ll;pt();var Ji={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};_i();var bl=class extends Qe{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return ho(e)&&co(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==D.KEYDOWN){let i=t.originalEvent,r=i.key;if(this.condition_(t)&&(r==Ji.DOWN||r==Ji.LEFT||r==Ji.RIGHT||r==Ji.UP)){let o=t.map.getView(),a=o.getResolution()*this.pixelDelta_,l=0,h=0;r==Ji.DOWN?h=-a:r==Ji.LEFT?l=-a:r==Ji.RIGHT?l=a:h=a;let c=[l,h];tr(c,o.getRotation()),Md(o,c,this.duration_),i.preventDefault(),e=!0}}return!e}},Ud=bl;pt();var Al=class extends Qe{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Dd(e)&&co(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==D.KEYDOWN||t.type==D.KEYPRESS){let i=t.originalEvent,r=i.key;if(this.condition_(t)&&(r==="+"||r==="-")){let s=t.map,o=r==="+"?this.delta_:-this.delta_,a=s.getView();fr(a,o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}},jd=Al;var Ml=class{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;let t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;let r=this.points_[e+2]-this.points_[i+2];if(r<1e3/60)return!1;let s=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},Bd=Ml;pt();ci();xt();var Pl=class extends Qe{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;let e=t.condition?t.condition:Fd;this.condition_=t.onFocusOnly?qr(ao,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;let t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t)||t.type!==D.WHEEL)return!0;let i=t.map,r=t.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);let s;if(t.type==D.WHEEL&&(s=r.deltaY,Pc&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=Ts),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;let o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");let a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=s;let l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(t){let e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-ot(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),fr(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}},Kd=Pl;Ht();Vs();var Ol=class extends ti{constructor(t){t=t||{};let e=t;e.stopDown||(e.stopDown=hi),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0,i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){let l=s-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=l}this.lastAngle_=s;let o=t.map,a=o.getView();a.getConstraints().rotation!==rr&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(gr(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},Vd=Ol;Ht();var Fl=class extends ti{constructor(t){t=t||{};let e=t;e.stopDown||(e.stopDown=hi),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1,i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(e=this.lastDistance_/a),this.lastDistance_=a;let l=t.map,h=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(gr(this.targetPointers))),l.render(),h.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){let i=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},Zd=Fl;function qd(n){n=n||{};let t=new $t,e=new Bd(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&t.push(new Xd),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&t.push(new Pd({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&t.push(new Gd({onFocusOnly:n.onFocusOnly,kinetic:e})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&t.push(new Vd),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&t.push(new Zd({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(t.push(new Ud),t.push(new jd({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&t.push(new Kd({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&t.push(new Yd({duration:n.zoomDuration})),t}Ct();Yt();wt();Ri();fe();te();pa();function $d(n){if(n instanceof xn){n.setMapInternal(null);return}n instanceof Kr&&n.getLayers().forEach($d)}function Jd(n,t){if(n instanceof xn){n.setMapInternal(t);return}if(n instanceof Kr){let e=n.getLayers().getArray();for(let i=0,r=e.length;ithis.updateSize()),this.controls=e.controls||Zr(),this.interactions=e.interactions||qd({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Rd(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Ut.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Ut.VIEW,this.handleViewChanged_),this.addChangeListener(Ut.SIZE,this.handleSizeChanged_),this.addChangeListener(Ut.TARGET,this.handleTargetChanged_),this.setProperties(e.values);let i=this;t.view&&!(t.view instanceof me)&&t.view.then(function(r){i.setView(new me(r))}),this.controls.addEventListener(Dt.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(Dt.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(Dt.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(Dt.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(Dt.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(Dt.REMOVE,r=>{let s=r.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],r.element.setMap(null)}),this.controls.forEach(r=>{r.setMap(this)}),this.interactions.forEach(r=>{r.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){Jd(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){let e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};let s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:li,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,e,null,o,null)}getFeaturesAtPixel(t,e){let i=[];return this.forEachFeatureAtPixel(t,function(r){i.push(r)},e),i}getAllLayers(){let t=[];function e(i){i.forEach(function(r){r instanceof Kr?e(r.getLayers()):t.push(r)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;let i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};let r=e.layerFilter!==void 0?e.layerFilter:li,s=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){let i=this.viewport_.getBoundingClientRect(),r=this.getSize(),s=i.width/r[0],o=i.height/r[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-i.left)/s,(a.clientY-i.top)/o]}getTarget(){return this.get(Ut.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return nr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){let e=this.frameState_;return e?_t(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){let e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Ut.LAYERGROUP)}setLayers(t){let e=this.getLayerGroup();if(t instanceof $t){e.setLayers(t);return}let i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e=0;s--){let o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){let t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let r=this.maxTilesLoading_,s=r;if(t){let o=t.viewHints;if(o[Pt.ANIMATING]||o[Pt.INTERACTING]){let a=Date.now()-t.time>8;r=a?0:8,s=a?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){let e=this.getLayerGroup();e&&this.handleLayerRemove_(new Ne("removelayer",e)),this.set(Ut.LAYERGROUP,t)}setSize(t){this.set(Ut.SIZE,t)}setTarget(t){this.set(Ut.TARGET,t)}setView(t){if(!t||t instanceof me){this.set(Ut.VIEW,t);return}this.set(Ut.VIEW,new me);let e=this;t.then(function(i){e.setView(new me(i))})}updateSize(){let t=this.getTargetElement(),e;if(t){let r=getComputedStyle(t),s=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),o=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);!isNaN(s)&&!isNaN(o)&&(e=[s,o],!Dl(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Us("No map visible because the map container's width or height are 0."))}let i=this.getSize();e&&(!i||!Vt(e,i))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){let e=this.getView();e&&e.setViewportSize(t)}};function Xm(n){let t=null;n.keyboardEventTarget!==void 0&&(t=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);let e={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Kr({layers:n.layers});e[Ut.LAYERGROUP]=i,e[Ut.TARGET]=n.target,e[Ut.VIEW]=n.view instanceof me?n.view:new me;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new $t(n.controls.slice()):(z(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new $t(n.interactions.slice()):(z(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new $t(n.overlays.slice()):(z(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new $t,{controls:r,interactions:s,keyboardEventTarget:t,overlays:o,values:e}}var Qd=kl;dr();Yt();fe();_i();var Nl="projection",tf="coordinateFormat",Gl=class extends vi{constructor(t){t=t||{};let e=document.createElement("div");e.className=t.className!==void 0?t.className:"ol-mouse-position",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un,this.addChangeListener(Nl,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection),this.renderOnMouseOut_=t.placeholder!==void 0,this.placeholder_=this.renderOnMouseOut_?t.placeholder:" ",this.renderedHTML_=e.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=t.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(tf)}getProjection(){return this.get(Nl)}handleMouseMove(t){let e=this.getMap();this.updateHTML_(e.getEventPixel(t))}handleMouseOut(t){this.updateHTML_(null)}setMap(t){if(super.setMap(t),t){let e=t.getViewport();this.listenerKeys.push(U(e,$i.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(U(e,$i.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(t){this.set(tf,t)}setProjection(t){this.set(Nl,ft(t))}updateHTML_(t){let e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){let s=this.getProjection();s?this.transform_=Ve(this.mapProjection_,s):this.transform_=Nr}let r=this.getMap().getCoordinateFromPixelInternal(t);if(r){let s=_n();if(s&&(this.transform_=Ve(this.mapProjection_,s)),this.transform_(r,r),this.wrapX_){let a=s||this.getProjection()||this.mapProjection_;er(r,a)}let o=this.getCoordinateFormat();o?e=o(r):e=r.toString()}}(!this.renderedHTML_||e!==this.renderedHTML_)&&(this.element.innerHTML=e,this.renderedHTML_=e)}render(t){let e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}},ef=Gl;pt();Lr();pt();wt();Ui();var Xl=class extends ki{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(D.CHANGE)}release(){this.state===k.ERROR&&this.setState(k.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){let t=this.interimTile;if(!t)return this;do{if(t.getState()==k.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){let t=this.interimTile;if(!t)return;let e=this;do{if(t.getState()==k.LOADED){t.interimTile=null;break}t.getState()==k.LOADING?e=t:t.getState()==k.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==k.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){H()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;let r=e-i+1e3/60;return r>=this.transition_?1:Ia(r/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}},go=Xl;te();Wl();var zl=class extends go{constructor(t,e,i,r,s,o){super(t,e,o),this.crossOrigin_=r,this.src_=i,this.key=i,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=k.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=k.ERROR,this.unlistenImage_(),this.image_=zm(),this.changed()}handleImageLoad_(){let t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=k.LOADED:this.state=k.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==k.ERROR&&(this.state=k.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==k.IDLE&&(this.state=k.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=nf(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}};function zm(){let n=gt(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}var mo=zl;pt();rt();Yt();xt();var Ym=10,sf=.25,Yl=class{constructor(t,e,i,r,s,o){this.sourceProj_=t,this.targetProj_=e;let a={},l=Yi(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){let C=y[0]+"/"+y[1];return a[C]||(a[C]=l(y)),a[C]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&$(r)>=$(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?$(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?$(this.targetProj_.getExtent()):null;let h=Ce(i),c=Zn(i),u=Vn(i),d=Kn(i),f=this.transformInv_(h),g=this.transformInv_(c),m=this.transformInv_(u),p=this.transformInv_(d),_=Ym+(o?Math.max(0,Math.ceil(Math.log2(Ar(i)/(o*o*256*256)))):0);if(this.addQuad_(h,c,u,d,f,g,m,p,_),this.wrapsXInSource_){let y=1/0;this.triangles_.forEach(function(C,w,T){y=Math.min(y,C.source[0][0],C.source[1][0],C.source[2][0])}),this.triangles_.forEach(C=>{if(Math.max(C.source[0][0],C.source[1][0],C.source[2][0])-y>this.sourceWorldWidth_/2){let w=[[C.source[0][0],C.source[0][1]],[C.source[1][0],C.source[1][1]],[C.source[2][0],C.source[2][1]]];w[0][0]-y>this.sourceWorldWidth_/2&&(w[0][0]-=this.sourceWorldWidth_),w[1][0]-y>this.sourceWorldWidth_/2&&(w[1][0]-=this.sourceWorldWidth_),w[2][0]-y>this.sourceWorldWidth_/2&&(w[2][0]-=this.sourceWorldWidth_);let T=Math.min(w[0][0],w[1][0],w[2][0]);Math.max(w[0][0],w[1][0],w[2][0])-T.5&&u<1,g=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){let p=qo([t,e,i,r]);g=$(p)/this.targetWorldWidth_>sf||g}!f&&this.sourceProj_.isGlobal()&&u&&(g=u>sf||g)}if(!g&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!yt(c,this.maxSourceExtent_))return;let m=0;if(!g&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)g=!0;else if(m=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(h>0){if(!g){let p=[(t[0]+i[0])/2,(t[1]+i[1])/2],_=this.transformInv_(p),y;f?y=(ke(s[0],d)+ke(a[0],d))/2-ke(_[0],d):y=(s[0]+a[0])/2-_[0];let C=(s[1]+a[1])/2-_[1];g=y*y+C*C>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){let p=[(e[0]+i[0])/2,(e[1]+i[1])/2],_=this.transformInv_(p),y=[(r[0]+t[0])/2,(r[1]+t[1])/2],C=this.transformInv_(y);this.addQuad_(t,e,p,y,s,o,_,C,h-1),this.addQuad_(y,p,i,r,C,_,a,l,h-1)}else{let p=[(t[0]+e[0])/2,(t[1]+e[1])/2],_=this.transformInv_(p),y=[(i[0]+r[0])/2,(i[1]+r[1])/2],C=this.transformInv_(y);this.addQuad_(t,p,y,r,s,_,C,l,h-1),this.addQuad_(p,e,i,y,_,o,a,C,h-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(t,i,r,s,a,l),m&14||this.addTriangle_(t,i,e,s,a,o),m&&(m&13||this.addTriangle_(e,r,t,o,l,s),m&7||this.addTriangle_(e,r,i,o,l,a))}calculateSourceExtent(){let t=Tt();return this.triangles_.forEach(function(e,i,r){let s=e.source;cn(t,s[0]),cn(t,s[1]),cn(t,s[2])}),t}getTriangles(){return this.triangles_}},of=Yl;rt();te();Yt();xt();var Ul,wn=[];function af(n,t,e,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(t,e),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(t,i)+1,Math.max(e,r)),n.restore()}function jl(n,t){return Math.abs(n[t*4]-210)>2||Math.abs(n[t*4+3]-.75*255)>2}function Um(){if(Ul===void 0){let n=gt(6,6,wn);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",af(n,4,5,4,0),af(n,4,5,0,5);let t=n.getImageData(0,0,3,3).data;Ul=jl(t,0)||jl(t,4)||jl(t,8),En(n),wn.push(n.canvas)}return Ul}function lf(n,t,e,i){let r=pn(e,t,n),s=Ks(t,i,e),o=t.getMetersPerUnit();o!==void 0&&(s*=o);let a=n.getMetersPerUnit();a!==void 0&&(s/=a);let l=n.getExtent();if(!l||Gi(l,r)){let h=Ks(n,s,r)/s;isFinite(h)&&h>0&&(s/=h)}return s}function hf(n,t,e,i){let r=Ee(e),s=lf(n,t,r,i);return(!isFinite(s)||s<=0)&&As(e,function(o){return s=lf(n,t,o,i),isFinite(s)&&s>0}),s}function cf(n,t,e,i,r,s,o,a,l,h,c,u,d){let f=gt(Math.round(e*n),Math.round(e*t),wn);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(e,e);function g(y){return Math.round(y*e)/e}f.globalCompositeOperation="lighter";let m=Tt();l.forEach(function(y,C,w){Nc(m,y.extent)});let p;if(!d||l.length!==1||h!==0){let y=$(m),C=Lt(m);p=gt(Math.round(e*y/i),Math.round(e*C/i),wn),u||(p.imageSmoothingEnabled=!1);let w=e/i;l.forEach(function(T,R,A){let b=T.extent[0]-m[0],O=-(T.extent[3]-m[3]),W=$(T.extent),Z=Lt(T.extent);T.image.width>0&&T.image.height>0&&p.drawImage(T.image,h,h,T.image.width-2*h,T.image.height-2*h,b*w,O*w,W*w,Z*w)})}let _=Ce(o);return a.getTriangles().forEach(function(y,C,w){let T=y.source,R=y.target,A=T[0][0],b=T[0][1],O=T[1][0],W=T[1][1],Z=T[2][0],it=T[2][1],j=g((R[0][0]-_[0])/s),mt=g(-(R[0][1]-_[1])/s),Y=g((R[1][0]-_[0])/s),F=g(-(R[1][1]-_[1])/s),P=g((R[2][0]-_[0])/s),N=g(-(R[2][1]-_[1])/s),nt=A,at=b;A=0,b=0,O-=nt,W-=at,Z-=nt,it-=at;let At=[[O,W,0,0,Y-j],[Z,it,0,0,P-j],[0,0,O,W,F-mt],[0,0,Z,it,N-mt]],I=eu(At);if(!I)return;if(f.save(),f.beginPath(),Um()||!u){f.moveTo(Y,F);let q=4,st=j-Y,pe=mt-F;for(let Gt=0;Gt{e&&e.getState()==k.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}),this.sourceTiles_.length=0,t.length===0)this.state=k.ERROR;else{let e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=cf(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=k.LOADED}this.changed()}load(){if(this.state==k.IDLE){this.state=k.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(e=>{let i=e.getState();if(i==k.IDLE||i==k.LOADING){t++;let r=U(e,D.CHANGE,function(s){let o=e.getState();(o==k.LOADED||o==k.ERROR||o==k.EMPTY)&&(et(r),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(r)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,i,r){e.getState()==k.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(et),this.sourcesListenerKeys_=null}release(){this.canvas_&&(En(this.canvas_.getContext("2d")),wn.push(this.canvas_),this.canvas_=null),super.release()}},$r=Bl;Zt();var Kl=class{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){let i=this.entries_[t];return z(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){let e=this.entries_[t];return z(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){let t=new Array(this.count_),e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){let t=new Array(this.count_),e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){let t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){z(!(t in this.entries_),"Tried to set a value for a key that is used already");let i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}},uf=Kl;function Vl(n,t,e,i){return i!==void 0?(i[0]=n,i[1]=t,i[2]=e,i):[n,t,e]}function Tn(n,t,e){return n+"/"+t+"/"+e}function po(n){return Tn(n[0],n[1],n[2])}function df(n){return n.split("/").map(Number)}function ff(n){return(n[1]<e||e>t.getMaxZoom())return!1;let s=t.getFullTileRange(e);return s?s.containsXY(i,r):!0}var Zl=class extends uf{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;let t=this.peekFirstKey(),i=df(t)[0];this.forEach(r=>{r.tileCoord[0]!==i&&(this.remove(po(r.tileCoord)),r.release())})}},_o=Zl;var yo={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};je();Hl();wt();Zt();Yt();var Eo=class{constructor(t,e,i,r){this.minX=t,this.maxX=e,this.minY=i,this.maxY=r}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}};function vn(n,t,e,i,r){return r!==void 0?(r.minX=n,r.maxX=t,r.minY=e,r.maxY=i,r):new Eo(n,t,e,i)}var Co=Eo;Zt();xt();rt();Ya();Ct();Ri();var pr=[0,0,0],Qi=5,$l=class{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,z(Ac(this.resolutions_,(r,s)=>s-r,!0),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let r=0,s=this.resolutions_.length-1;r{let o=new Co(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){let a=this.getTileRangeForExtentAndZ(i,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){let r=this.getTileRangeForExtentAndZ(t,e);for(let s=r.minX,o=r.maxX;s<=o;++s)for(let a=r.minY,l=r.maxY;a<=l;++a)i([e,s,a])}forEachTileCoordParentTileRange(t,e,i,r){let s,o,a,l=null,h=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,r);h>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=vn(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(l,h,i),e(h,s))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]this.maxZoom||e0?i:Math.max(s/e[0],r/e[1]);let o=t+1,a=new Array(o);for(let l=0;li.highWaterMark&&(i.highWaterMark=t)}useTile(t,e,i,r){}},vo=class extends Ft{constructor(t,e){super(t),this.tile=e}},xf=Ql;xt();function Km(n,t){let e=/\{z\}/g,i=/\{x\}/g,r=/\{y\}/g,s=/\{-y\}/g;return function(o,a,l){if(o)return n.replace(e,o[0].toString()).replace(i,o[1].toString()).replace(r,o[2].toString()).replace(s,function(){let h=o[0],c=t.getFullTileRange(h);if(!c)throw new Error("The {-y} placeholder requires a tile grid with extent");return(c.getHeight()-o[2]-1).toString()})}}function Ef(n,t){let e=n.length,i=new Array(e);for(let r=0;rthis.getTileInternal(p,_,y,C,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return m.key=u,h?(m.interimTile=h,m.refreshInterimChain(),a.replace(c,m)):a.set(c,m),m}getTileInternal(t,e,i,r,s){let o=null,a=Tn(t,e,i),l=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(t,e,i,r,s,l),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=l){let h=o;o=this.createTile_(t,e,i,r,s,l),h.getState()==k.IDLE?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(let e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){let i=ft(t);if(i){let r=K(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}}clear(){super.clear();for(let t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}};function Zm(n,t){n.getImage().src=t}var Tf=eh;var ih=class extends Tf{constructor(t){t=t||{};let e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:_f({extent:To(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}},vf=ih;var qm='© OpenStreetMap contributors.',nh=class extends vf{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[qm];let i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",r=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:r,wrapX:t.wrapX,zDirection:t.zDirection})}},Rf=nh;lr();var Jr={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var rh=class extends xn{constructor(t){t=t||{};let e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(Jr.PRELOAD)}setPreload(t){this.set(Jr.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Jr.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Jr.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}},Sf=rh;lh();De();Ct();rt();Yt();wt();Ri();var hh=class extends Ro{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=Tt(),this.tmpTileRange_=new Co(0,0,0,0)}isDrawableTile(t){let e=this.getLayer(),i=t.getState(),r=e.getUseInterimTilesOnError();return i==k.LOADED||i==k.EMPTY||i==k.ERROR&&!r}getTile(t,e,i,r){let s=r.pixelRatio,o=r.viewState.projection,a=this.getLayer(),h=a.getSource().getTile(t,e,i,s,o);return h.getState()==k.ERROR&&a.getUseInterimTilesOnError()&&a.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(h)||(h=h.getInterimTile()),h}getData(t){let e=this.frameState;if(!e)return null;let i=this.getLayer(),r=_t(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!Gi(s,r))return null;let o=e.pixelRatio,a=e.viewState.projection,l=e.viewState,h=i.getRenderSource(),c=h.getTileGridForProjection(l.projection),u=h.getTilePixelRatio(e.pixelRatio);for(let d=c.getZForResolution(l.resolution);d>=c.getMinZoom();--d){let f=c.getTileCoordForCoordAndZ(r,d),g=h.getTile(d,f[1],f[2],o,a);if(!(g instanceof mo||g instanceof $r)||g instanceof $r&&g.getState()===k.EMPTY)return null;if(g.getState()!==k.LOADED)continue;let m=c.getOrigin(d),p=bt(c.getTileSize(d)),_=c.getResolution(d),y=Math.floor(u*((r[0]-m[0])/_-f[1]*p[0])),C=Math.floor(u*((m[1]-r[1])/_-f[2]*p[1])),w=Math.round(u*h.getGutterForProjection(l.projection));return this.getImageData(g.getImage(),y+w,C+w)}return null}loadedTileCallback(t,e,i){return this.isDrawableTile(i)?super.loadedTileCallback(t,e,i):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){let i=t.layerStatesArray[t.layerIndex],r=t.viewState,s=r.projection,o=r.resolution,a=r.center,l=r.rotation,h=t.pixelRatio,c=this.getLayer(),u=c.getSource(),d=u.getRevision(),f=u.getTileGridForProjection(s),g=f.getZForResolution(o,u.zDirection),m=f.getResolution(g),p=t.extent,_=t.viewState.resolution,y=u.getTilePixelRatio(h),C=Math.round($(p)/_*h),w=Math.round(Lt(p)/_*h),T=i.extent&&ve(i.extent,s);T&&(p=Xi(p,ve(i.extent,s)));let R=m*C/2/y,A=m*w/2/y,b=[a[0]-R,a[1]-A,a[0]+R,a[1]+A],O=f.getTileRangeForExtentAndZ(p,g),W={};W[g]={};let Z=this.createLoadedTileFinder(u,s,W),it=this.tmpExtent,j=this.tmpTileRange_;this.newTiles_=!1;let mt=l?Ms(r.center,_,l,t.size):void 0;for(let vt=O.minX;vt<=O.maxX;++vt)for(let q=O.minY;q<=O.maxY;++q){if(l&&!f.tileCoordIntersectsViewport([g,vt,q],mt))continue;let st=this.getTile(g,vt,q,t);if(this.isDrawableTile(st)){let ee=K(this);if(st.getState()==k.LOADED){W[g][st.tileCoord.toString()]=st;let _e=st.inTransition(ee);_e&&i.opacity!==1&&(st.endTransition(ee),_e=!1),!this.newTiles_&&(_e||!this.renderedTiles.includes(st))&&(this.newTiles_=!0)}if(st.getAlpha(ee,t.time)===1)continue}let pe=f.getTileCoordChildTileRange(st.tileCoord,j,it),Gt=!1;pe&&(Gt=Z(g+1,pe)),Gt||f.forEachTileCoordParentTileRange(st.tileCoord,Z,j,it)}let Y=m/o*h/y;zt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,l,-C/2,-w/2);let F=Rs(this.pixelTransform);this.useContainer(e,F,this.getBackground(t));let P=this.context,N=P.canvas;Un(this.inversePixelTransform,this.pixelTransform),zt(this.tempTransform,C/2,w/2,Y,Y,0,-C/2,-w/2),N.width!=C||N.height!=w?(N.width=C,N.height=w):this.containerReused||P.clearRect(0,0,C,w),T&&this.clipUnrotated(P,t,T),u.getInterpolate()||(P.imageSmoothingEnabled=!1),this.preRender(P,t),this.renderedTiles.length=0;let nt=Object.keys(W).map(Number);nt.sort(de);let at,At,I;i.opacity===1&&(!this.containerReused||u.getOpaque(t.viewState.projection))?nt=nt.reverse():(at=[],At=[]);for(let vt=nt.length-1;vt>=0;--vt){let q=nt[vt],st=u.getTilePixelSize(q,h,s),Gt=f.getResolution(q)/m,ee=st[0]*Gt*Y,_e=st[1]*Gt*Y,ri=f.getTileCoordForCoordAndZ(Ce(b),q),ln=f.getTileCoordExtent(ri),tt=_t(this.tempTransform,[y*(ln[0]-b[0])/m,y*(b[3]-ln[3])/m]),Le=y*u.getGutterForProjection(s),Ye=W[q];for(let Pi in Ye){let Ue=Ye[Pi],bn=Ue.tileCoord,An=ri[1]-bn[1],Mn=Math.round(tt[0]-(An-1)*ee),Oi=ri[2]-bn[2],Mt=Math.round(tt[1]-(Oi-1)*_e),Bt=Math.round(tt[0]-An*ee),Xt=Math.round(tt[1]-Oi*_e),L=Mn-Bt,x=Mt-Xt,E=g===q,M=E&&Ue.getAlpha(K(this),t.time)!==1,B=!1;if(!M)if(at){I=[Bt,Xt,Bt+L,Xt,Bt+L,Xt+x,Bt,Xt+x];for(let Q=0,Wt=at.length;Q{let[e,i]=this.getCoordinates();t(e,i)})}getCoordinates(){return this.view.getCenter()}setCoordinates(t,e){this.view.setCenter(ir([t,e],this.projection))}};function e_(n, t = 0, e = 0, i = 10, s1){let r="EPSG:4326",s=new ef({coordinateFormat:Eu(4),projection:r,className:`mouse-position-${n}`,target:document.getElementById(`OSMap-${n}`)}),o=new So({projection:r,geometry:new ar(ir([t,e],r))}),a=new pc({features:[o]}),l=new cc({source:a}),h=new Af({source:new Rf}),c=document.getElementById(`OSMap-${n}`),u=new me({projection:r,center:ir([t,e],r),zoom:i}),d=new Qd({controls:Zr().extend([s]),layers:[h,l],target:c,view:u}),f=new $g.default("nominatim",{provider:"osm",lang:"ru-RU",placeholder:"\u041F\u043E\u0438\u0441\u043A...",limit:5,keepOpen:!0});d.addControl(f),f.on("addresschosen",function(m){console.log(m);let p=m.feature,_=m.coordinate;p.setStyle(new ei({image:new nn({color:"rgba(0, 0, 0, 0)",crossOrigin:"anonymous",src:"https://openlayers.org/en/latest/examples/data/dot.png",scale:.01})})),u.setCenter(ir([_[0],_[1]],r))});function g(){let[m,p]=d.getView().getCenter();o.getGeometry().setCoordinates([m,p])}return d.on("movestart",g),d.on("moveend",g),c.classList.add("map-done"),new Ec(u,r)}window.traineratwot={};window.traineratwot.GetPointMap=e_; +`);this.generateTileUrlFunction_?this.setTileUrlFunction(Ef(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}useTile(t,e,i){let r=Tn(t,e,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)}},wf=th;Yt();wt();var eh=class extends wf{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Zm,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,this.tileClass=t.tileClass!==void 0?t.tileClass:mo,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(let t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){let i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?e:{});for(let r in this.tileCacheForProjection){let s=this.tileCacheForProjection[r];s.expireCache(s==i?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!yi(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getOpaque(t){return this.getProjection()&&t&&!yi(this.getProjection(),t)?!1:super.getOpaque(t)}getTileGridForProjection(t){let e=this.getProjection();if(this.tileGrid&&(!e||yi(e,t)))return this.tileGrid;let i=K(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=wo(t)),this.tileGridForProjection[i]}getTileCacheForProjection(t){let e=this.getProjection();if(!e||yi(e,t))return this.tileCache;let i=K(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new _o(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}createTile_(t,e,i,r,s,o){let a=[t,e,i],l=this.getTileCoordForTileUrlFunction(a,s),h=l?this.tileUrlFunction(l,r,s):void 0,c=new this.tileClass(a,h!==void 0?k.IDLE:k.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(D.CHANGE,this.handleTileChange.bind(this)),c}getTile(t,e,i,r,s){let o=this.getProjection();if(!o||!s||yi(o,s))return this.getTileInternal(t,e,i,r,o||s);let a=this.getTileCacheForProjection(s),l=[t,e,i],h,c=po(l);a.containsKey(c)&&(h=a.get(c));let u=this.getKey();if(h&&h.key==u)return h;let d=this.getTileGridForProjection(o),f=this.getTileGridForProjection(s),g=this.getTileCoordForTileUrlFunction(l,s),m=new $r(o,d,s,f,l,g,this.getTilePixelRatio(r),this.getGutter(),(p,_,y,C)=>this.getTileInternal(p,_,y,C,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return m.key=u,h?(m.interimTile=h,m.refreshInterimChain(),a.replace(c,m)):a.set(c,m),m}getTileInternal(t,e,i,r,s){let o=null,a=Tn(t,e,i),l=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(t,e,i,r,s,l),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=l){let h=o;o=this.createTile_(t,e,i,r,s,l),h.getState()==k.IDLE?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(let e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){let i=ft(t);if(i){let r=K(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}}clear(){super.clear();for(let t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}};function Zm(n,t){n.getImage().src=t}var Tf=eh;var ih=class extends Tf{constructor(t){t=t||{};let e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:_f({extent:To(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}},vf=ih;var qm='© OpenStreetMap contributors.',nh=class extends vf{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[qm];let i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",r=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:r,wrapX:t.wrapX,zDirection:t.zDirection})}},Rf=nh;lr();var Jr={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var rh=class extends xn{constructor(t){t=t||{};let e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(Jr.PRELOAD)}setPreload(t){this.set(Jr.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Jr.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Jr.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}},Sf=rh;lh();De();Ct();rt();Yt();wt();Ri();var hh=class extends Ro{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=Tt(),this.tmpTileRange_=new Co(0,0,0,0)}isDrawableTile(t){let e=this.getLayer(),i=t.getState(),r=e.getUseInterimTilesOnError();return i==k.LOADED||i==k.EMPTY||i==k.ERROR&&!r}getTile(t,e,i,r){let s=r.pixelRatio,o=r.viewState.projection,a=this.getLayer(),h=a.getSource().getTile(t,e,i,s,o);return h.getState()==k.ERROR&&a.getUseInterimTilesOnError()&&a.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(h)||(h=h.getInterimTile()),h}getData(t){let e=this.frameState;if(!e)return null;let i=this.getLayer(),r=_t(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!Gi(s,r))return null;let o=e.pixelRatio,a=e.viewState.projection,l=e.viewState,h=i.getRenderSource(),c=h.getTileGridForProjection(l.projection),u=h.getTilePixelRatio(e.pixelRatio);for(let d=c.getZForResolution(l.resolution);d>=c.getMinZoom();--d){let f=c.getTileCoordForCoordAndZ(r,d),g=h.getTile(d,f[1],f[2],o,a);if(!(g instanceof mo||g instanceof $r)||g instanceof $r&&g.getState()===k.EMPTY)return null;if(g.getState()!==k.LOADED)continue;let m=c.getOrigin(d),p=bt(c.getTileSize(d)),_=c.getResolution(d),y=Math.floor(u*((r[0]-m[0])/_-f[1]*p[0])),C=Math.floor(u*((m[1]-r[1])/_-f[2]*p[1])),w=Math.round(u*h.getGutterForProjection(l.projection));return this.getImageData(g.getImage(),y+w,C+w)}return null}loadedTileCallback(t,e,i){return this.isDrawableTile(i)?super.loadedTileCallback(t,e,i):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){let i=t.layerStatesArray[t.layerIndex],r=t.viewState,s=r.projection,o=r.resolution,a=r.center,l=r.rotation,h=t.pixelRatio,c=this.getLayer(),u=c.getSource(),d=u.getRevision(),f=u.getTileGridForProjection(s),g=f.getZForResolution(o,u.zDirection),m=f.getResolution(g),p=t.extent,_=t.viewState.resolution,y=u.getTilePixelRatio(h),C=Math.round($(p)/_*h),w=Math.round(Lt(p)/_*h),T=i.extent&&ve(i.extent,s);T&&(p=Xi(p,ve(i.extent,s)));let R=m*C/2/y,A=m*w/2/y,b=[a[0]-R,a[1]-A,a[0]+R,a[1]+A],O=f.getTileRangeForExtentAndZ(p,g),W={};W[g]={};let Z=this.createLoadedTileFinder(u,s,W),it=this.tmpExtent,j=this.tmpTileRange_;this.newTiles_=!1;let mt=l?Ms(r.center,_,l,t.size):void 0;for(let vt=O.minX;vt<=O.maxX;++vt)for(let q=O.minY;q<=O.maxY;++q){if(l&&!f.tileCoordIntersectsViewport([g,vt,q],mt))continue;let st=this.getTile(g,vt,q,t);if(this.isDrawableTile(st)){let ee=K(this);if(st.getState()==k.LOADED){W[g][st.tileCoord.toString()]=st;let _e=st.inTransition(ee);_e&&i.opacity!==1&&(st.endTransition(ee),_e=!1),!this.newTiles_&&(_e||!this.renderedTiles.includes(st))&&(this.newTiles_=!0)}if(st.getAlpha(ee,t.time)===1)continue}let pe=f.getTileCoordChildTileRange(st.tileCoord,j,it),Gt=!1;pe&&(Gt=Z(g+1,pe)),Gt||f.forEachTileCoordParentTileRange(st.tileCoord,Z,j,it)}let Y=m/o*h/y;zt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,l,-C/2,-w/2);let F=Rs(this.pixelTransform);this.useContainer(e,F,this.getBackground(t));let P=this.context,N=P.canvas;Un(this.inversePixelTransform,this.pixelTransform),zt(this.tempTransform,C/2,w/2,Y,Y,0,-C/2,-w/2),N.width!=C||N.height!=w?(N.width=C,N.height=w):this.containerReused||P.clearRect(0,0,C,w),T&&this.clipUnrotated(P,t,T),u.getInterpolate()||(P.imageSmoothingEnabled=!1),this.preRender(P,t),this.renderedTiles.length=0;let nt=Object.keys(W).map(Number);nt.sort(de);let at,At,I;i.opacity===1&&(!this.containerReused||u.getOpaque(t.viewState.projection))?nt=nt.reverse():(at=[],At=[]);for(let vt=nt.length-1;vt>=0;--vt){let q=nt[vt],st=u.getTilePixelSize(q,h,s),Gt=f.getResolution(q)/m,ee=st[0]*Gt*Y,_e=st[1]*Gt*Y,ri=f.getTileCoordForCoordAndZ(Ce(b),q),ln=f.getTileCoordExtent(ri),tt=_t(this.tempTransform,[y*(ln[0]-b[0])/m,y*(b[3]-ln[3])/m]),Le=y*u.getGutterForProjection(s),Ye=W[q];for(let Pi in Ye){let Ue=Ye[Pi],bn=Ue.tileCoord,An=ri[1]-bn[1],Mn=Math.round(tt[0]-(An-1)*ee),Oi=ri[2]-bn[2],Mt=Math.round(tt[1]-(Oi-1)*_e),Bt=Math.round(tt[0]-An*ee),Xt=Math.round(tt[1]-Oi*_e),L=Mn-Bt,x=Mt-Xt,E=g===q,M=E&&Ue.getAlpha(K(this),t.time)!==1,B=!1;if(!M)if(at){I=[Bt,Xt,Bt+L,Xt,Bt+L,Xt+x,Bt,Xt+x];for(let Q=0,Wt=at.length;Q{let[e,i]=this.getCoordinates();t(e,i)})}getCoordinates(){return this.view.getCenter()}setCoordinates(t,e){this.view.setCenter(ir([t,e],this.projection))}};function e_(n,t=0,e=0,i=10,r="en-US"){let s="EPSG:4326",o=new ef({coordinateFormat:Eu(4),projection:s,className:`mouse-position-${n}`,target:document.getElementById(`OSMap-${n}`)}),a=new So({projection:s,geometry:new ar(ir([t,e],s))}),l=new pc({features:[a]}),h=new cc({source:l}),c=new Af({source:new Rf}),u=document.getElementById(`OSMap-${n}`),d=new me({projection:s,center:ir([t,e],s),zoom:i}),f=new Qd({controls:Zr().extend([o]),layers:[c,h],target:u,view:d}),g=new $g.default("nominatim",{provider:"osm",lang:r,placeholder:"\u041F\u043E\u0438\u0441\u043A...",limit:5,keepOpen:!0});f.addControl(g),g.on("addresschosen",function(p){console.log(p);let _=p.feature,y=p.coordinate;_.setStyle(new ei({image:new nn({color:"rgba(0, 0, 0, 0)",crossOrigin:"anonymous",src:"https://openlayers.org/en/latest/examples/data/dot.png",scale:.01})})),d.setCenter(ir([y[0],y[1]],s))});function m(){let[p,_]=f.getView().getCenter();a.getGeometry().setCoordinates([p,_])}return f.on("movestart",m),f.on("moveend",m),u.classList.add("map-done"),new Ec(d,s)}window.traineratwot.GetPointMap=e_; /*! Bundled license information: ol-geocoder/dist/ol-geocoder.js: