StartseiteEuropa

Deutschland

Bundesrepublik Deutschland

Bund

")}return a.push(this.createStepText(r,t,!0,e,i)),(this.scaleBarText_?`
`+s+"
":"")+a.join("")}createMarker(t){return`
`}createStepText(t,e,i,n,s){const r=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+s);return`
`+r+"
"}getScaleForResolution(){return re(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m")*(1e3/25.4)*(this.dpi_||ih)}render(t){const e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}},sh="projection",rh="coordinateFormat",oh=class extends Pr{constructor(t){t=t||{};const e=document.createElement("div");e.className=void 0!==t.className?t.className:"ol-mouse-position",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un,this.addChangeListener(sh,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection),this.renderOnMouseOut_=void 0!==t.placeholder,this.placeholder_=this.renderOnMouseOut_?t.placeholder:" ",this.renderedHTML_=e.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=!1!==t.wrapX}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(rh)}getProjection(){return this.get(sh)}handleMouseMove(t){const e=this.getMap();this.updateHTML_(e.getEventPixel(t))}handleMouseOut(t){this.updateHTML_(null)}setMap(t){if(super.setMap(t),t){const e=t.getViewport();this.listenerKeys.push(Ii(e,yr,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(Ii(e,"pointerout",this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(t){this.set(rh,t)}setProjection(t){this.set(sh,se(t))}updateHTML_(t){let e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){const t=this.getProjection();this.transform_=t?he(this.mapProjection_,t):ie}const i=this.getMap().getCoordinateFromPixelInternal(t);if(i){const t=fe();t&&(this.transform_=he(this.mapProjection_,t)),this.transform_(i,i),this.wrapX_&<(i,t||this.getProjection()||this.mapProjection_);const n=this.getCoordinateFormat();e=n?n(i):i.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)}render(t){const e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}};n().log("cp.maps.Map: version 2022-07-09"),n().maps.Map=function(t,e,i,s,r,o,a,l){r||(r=n().maps.WGS84),s&&(s=r!=n().maps.WGS84?ge(s,n().maps.WGS84,r):s);var h=s,c={logo:!1,target:t,controls:[new Ar({collapsible:!0,collapseLabel:"«",tipLabel:n().getLangText("Quellenhinweise","Sources")}),new nh({units:n().data.getMeasure()==n().data.IMPERIAL?"imperial":"metric"})],view:new hr({minZoom:e,maxZoom:i,constrainOnlyCenter:!0,extent:s,projection:r}),keyboardEventTarget:document.body,loadTilesWhileAnimating:!0,interactions:[new zr,new Jr,new go,new lo,new ho,new co,new so]},u=[256,192,160,128,96,64,48,32,24,20,16,12,10,8,6,5,4,3,2.5,2,1.5,1.25,1,.85,.75,.65,.5,.35,.25,.2,.15,.125,.1,.075,.0625],d=new Ql(c);function g(){return o}function p(){return d.getView().getProjection().getCode()}function f(t){d.getView().setCenter(t)}function m(){return d.getView().getZoom()}function _(){return Math.exp((m()-9)*-Math.LN2)}function y(){return d.getView().getMinZoom()}function x(){return d.getView().getMaxZoom()}function v(t,e){w(void 0,t,e)}function S(t,e){v(9-Math.log(t)/Math.LN2,e)}function w(t,e,i){d.getView().cancelAnimations(),d.getView().animate({center:t,zoom:e,duration:i})}function C(t,e,i){d.getView().cancelAnimations(),e||(e=0),i||(i=[5,40,5,40]),d.getView().fit(t,{duration:e,padding:i})}function E(t,e){if(e&&e.shiftKey){let e=_()-1e-5;for(let i=0;i=0;i--)if(u[i]>e)return void S(u[i],t)}v(m()-1,t)}function T(t){h?w([(h[0]+h[2])/2,(h[1]+h[3])/2],y(),t):v(y(),t)}o=null==o?n().maps.POPSYMB_MODE:o;var b=.8;function M(t,e){var i=Zn()("#"+t);if(Zn()(i).hasClass("opened"))Zn()(i).removeClass("opened");else{if(e)return;Zn()(i).addClass("opened")}}function L(t,e,i,s,r){var o=document.getElementById(s);o||((o=document.createElement("div")).id=s,d.getTargetElement().appendChild(o));var a=document.createElement("div");a.id="cb_"+t,a.className="item"+(r?" "+r:""),a.innerHTML='
'+e+"
",o.appendChild(a),"menu"!=t&&"menu_r"!=t&&Zn()("#"+a.id).click(function(){M(s,!0)}),Zn()("#"+a.id).click(i)}if(L("menu",n().getLoc("Toggle_Menu"),function(){M(n().maps.LEFT_CB_COL)},n().maps.LEFT_CB_COL),L("zoom_in",n().getLoc("Zoom_In"),function(t){E(500,t)},n().maps.LEFT_CB_COL),L("zoom_out",n().getLoc("Zoom_Out"),function(t){R(500,t)},n().maps.LEFT_CB_COL),L("zoom_all",n().getLoc("Full View"),function(){T(500)},n().maps.LEFT_CB_COL),"edit"==n().getParam("mode")){Zn()("#"+n().maps.coordDivID).html("");var I=new oh({coordinateFormat:function(t){var e,i,n=m();return((e=t)?rt("NS",e[1],i)+" "+rt("EW",e[0],i):"")+" - zoom: "+n.toPrecision(3)+" - scale: "+_().toPrecision(5)},projection:n().maps.WGS84,className:"custom-mouse-position",target:document.getElementById(n().maps.coordDivID)});d.addControl(I)}var P=null,A=null;function F(){P&&(P.style.display="none",A=null)}a=null!=a?a:0;var O=null;function D(t){Y(),t&&t.setSelected(!0),O=t}function k(){return null}function G(){return O?O.lat&&O.lng?{lat:O.lat,lng:O.lng}:{lat:O.r1,lng:O.r0}:null}var N,z=k;function Y(){O&&(O.setSelected(!1),O=null)}function j(t){return t.cpLayer&&t.cpLayer.isSelectable()}function W(t,e,i,s){var r,o,a=null;try{a=d.forEachFeatureAtPixel(t,function(t,e){if(t.isSelectable())return t},{hitTolerance:n().maps.hitTolerance,layerFilter:j})}catch(t){}if(!a||s)return F(),void("singleclick"==e&&(Y(),l&&l(null)));if("pointermove"==e)a.getLayer().getToolTipFunction()&&(a!=A&&function(t){P?F():(P=document.createElement("div"),Zn()("#"+n().maps.tooltipDivID).append(P));var e=t.getLayer().getToolTipFunction();e&&(P.className="tooltip "+t.getLayer().getName(),P.innerHTML=e(t.getAttributes(),t.getLayer()),A=t)}(a),r=i.pageX+10,o=i.pageY-10,P&&(P.style.left=r+"px",P.style.top=o+"px",P.style.display="block"));else if("singleclick"==e){D(a);var h=a.getPopup();h&&(a.isSelected()?h.show():h.hide()),l&&l(a)}}d.on("pointermove",function(t){W(d.getEventPixel(t.originalEvent),"pointermove",t.originalEvent,t.dragging)}),d.on("singleclick",function(t){W(t.pixel,"singleclick",t)}),d.getView().on("change:resolution",function(t){let e=m();e>x()?v(x()):et&&v(t,0)},moveTo:w,zoomTo:v,zoomByScale:S,zoomToExtent:C,zoomToExtentLatLng:function(t,e,i,s,r){var o=p(),a=n().maps.Coord.byLatLng(t,e,o),l=n().maps.Coord.byLatLng(i,s,o);C([Math.min(a[0],l[0]),Math.min(a[1],l[1]),Math.max(a[0],l[0]),Math.max(a[1],l[1])],r)},zoomIn:E,zoomOut:R,zoomWorld:T,getResolution:function(){return d.getView().getResolution()},getFillOpacity:function(){return b},setFillOpacity:function(t){b=t},addControlButton:L,toggleMenu:M,getLegendText:function(t,e){var i=n().getLoc("undefined"),s=g(),r='';if(r+="";for(var o=new Array(0,.1,1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4,25e3,5e4,75e3),a=0;a";r+='"}else if(s==n().maps.CHANGE_MODE){r+=n().getLoc("Change")+"",o=new Array(-5,-2,-1.5,-1,-.5,0,1,1.5,2,2.5,3,4,5,10,15,20,30);var l="% / "+n().getLoc("year");for(a=0;a";r+='"}else if(s==n().maps.POPSYMB_MODE){for(r+=n().getLoc("Population")+"",o=null!=t?new Array(1e6,5e6):new Array(1,1e3,5e3,1e4,2e4,5e4,1e5,25e4,5e5,1e6,5e6),l=" "+n().getLoc("inh"),a=0;a";null==t&&(r+='")}else if(s==n().maps.POP_MODE){for(r+=n().getLoc("Population")+"",o=new Array(1,1e3,5e3,1e4,2e4,5e4,1e5,25e4,5e5,1e6,5e6,25e6),l=" "+n().getLoc("inh"),a=0;a";r+='"}else if(s==n().maps.GENDER_MODE){for(r+=n().getLoc("Males")+" (%)",o=new Array(0,15,30,40,45,48,49,50,51,52,55,60,70,85,100),l="%",a=0;a";r+='"}else if(s==n().maps.LITERACY_MODE){for(r+=n().getLoc("Literacy")+" (%)",o=new Array(0,30,40,50,60,70,80,90,100),l="%",a=0;a";r+='"}else if(s==n().maps.URBAN_MODE){for(r+=n().getLoc("Urbanization")+" (%)",o=new Array(0,10,20,30,40,50,60,70,80,90,100),l="%",a=0;a";r+='"}else if(s==n().maps.CITIZENSHIP_MODE||s==n().maps.BIRTHCOUNTRY_MODE){for(r+=(s==n().maps.CITIZENSHIP_MODE?n().getLoc("Foreign_Citizenship"):n().getLoc("Foreign_Born"))+" (%)",o=new Array(0,1,2,5,10,20,30,40,50,100),l="%",a=0;a";r+='"}else if(s==n().maps.OLDAGE_MODE){for(r+=n().getLoc("Old_Age")+" (%)",o=new Array(0,5,10,15,20,25,30,35,40,50,60),l="%",a=0;a";r+='"}else if(s==n().maps.USER_MODE){for(r+=n().getLoc("Value")+" (%)",o=new Array(0,2,5,10,20,30,40,50,60,80,100),l="%",a=0;a";r+='"}else{for(r+=t+"",a=0;a";r+='"}return r+"
"+(s==n().maps.POPSYMB_MODE?n().getLoc("Symbol"):n().getLoc("Color"))+"",s==n().maps.DENSITY_MODE){r+=n().getLoc("Density")+"
'+n().data.getDensityString(o[a],2)+"
'+i+"
'+n().data.formatNum(o[a])+l+"
'+i+"
'+n().maps.Symbol.getPopSymbSVG(o[a],11,n().maps.Symbol.getSizeOfSymbol(o[a])).svg+'≥ '+n().data.formatNum(o[a])+l+"
'+n().maps.Symbol.getPopSymbSVG(-1,11,n().maps.Symbol.getSizeOfSymbol(-1)).svg+''+i+"
'+n().data.formatNum(o[a],"i")+l+"
'+i+"
'+n().data.formatNum(o[a],"i")+l+"
'+i+"
'+n().data.formatNum(o[a],"i")+l+"
'+i+"
'+n().data.formatNum(o[a],"i")+l+"
'+i+"
'+n().data.formatNum(o[a],"i")+l+"
'+i+"
'+n().data.formatNum(o[a],"i")+l+"
'+i+"
'+n().data.formatNum(o[a],"i")+l+"
'+i+"
'+e[a]+"
'+i+"
"},showLegend:function(t,e,i){N=t;var s='

'+n().getLoc("Legend")+"

";s+="
"+V.getLegendText(e,i)+"
",s+="

"+n().getLangText("Kartennutzung","Map Usage")+"

",n().getLang()==n().LANG_DE?(s+="

Maßstabsänderung: durch linksseitige Kartenknöpfe, Doppelklick (ohne und mit gedrückter Umschalttaste), Drag mit gedrückter Umschalttaste, Mausrad, die Tasten [+] und [-] oder (bei einem Touchscreen) durch Abstandsveränderung von zwei Fingern.

",s+="

Verschieben: durch Drag, Pfeiltasten oder (auf Touchscreens) durch Verschieben mit einem Finger.

",s+="

Auswahl: durch Einzelklick auf Flächen oder Beschriftungen oder (auf Touchscreens) durch Antippen.

"):(s+="

Zoom: by map buttons on the left, by double click (without and with pressed [shift] key), by dragging with pressed [shift] key, by mouse wheel, by [+] and [-] keys, or (on touch screens) by zooming or pinching two fingers.

",s+="

Pan: by dragging, by keyboard arrows, or (on touch screens) by panning one finger.

",s+="

Select: by single click on area or label, or (on touch screens) by tapping.

"),s+="
",Zn()(N).html(s),Zn()(N).css("visibility","visible"),Zn()("#helptab").css("visibility","visible");var r=Zn()("#cb_legend").parent().attr("id");Zn()(N).is(":data(dialog)")?Zn()(N).dialog("open"):(Zn()(N).dialog({dialogClass:"legendDialog",width:270,height:590,title:n().getLoc("Legend"),position:"mapconrl"==r?{my:"right top",at:"left-10 top-1",of:"#cb_legend"}:{my:"left top",at:"right+10 top-1",of:"#cb_legend"},open:function(){Zn()("#acc").accordion({heightStyle:"content"})}}),n().isTouchDevice()&&Zn()(".legendDialog .ui-dialog-titlebar-close").mousedown(function(){Zn()(N).dialog("close")}))},hideLegend:function(){N&&Zn()(N).dialog("close")},selectFeature:D,getSelectedFeatureProps:function(t){if(!O)return null;if(t){z=G;var e=O.getGeometry().getExtent();if(e){var i=de([(e[0]+e[2])/2,(e[1]+e[3])/2],V.getProjCode(),n().maps.WGS84);O.r0=Math.round(1e3*i[0])/1e3,O.r1=Math.round(1e3*i[1])/1e3,O.attributes.r0=i[0]-O.r0,O.attributes.r1=i[1]-O.r1}}return O.getAttributes()},getSelectedFeaturePos:function(){var t=z();return z=k,t},unselectFeatures:Y,redraw:function(){d.getLayers().forEach(function(t){t.redraw&&t.redraw()})},onViewChange:function(t){d.on("change:size",t),d.getView().on("change",t)},onMapRendered:function(t,e){e?d.once("postrender",t):d.on("postrender",t)},unMapRendered:function(t){d.un("postrender",t)},onViewChangeEnd:function(t){d.on("moveend",t)},getZoomOffset:function(){return a},getRestrictedExtent:function(){return h},addLayer:function(t){d.addLayer(t)},getSize:function(){return d.getSize()},updateSize:function(){d.updateSize()},addOverlay:function(t){d.addOverlay(t)},removeOverlay:function(t){d.removeOverlay(t)},getPixelFromCoordinate:function(t){return d.getPixelFromCoordinate(t)},setVisibleLayer:function(){}};return d.cpMap=V,V},n().maps.Map;const ah="http://www.w3.org/2001/XMLSchema-instance";function lh(t,e){return Mh().createElementNS(t,e)}function hh(t,e){return ch(t,e,[]).join("")}function ch(t,e,i){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?i.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(t.nodeValue);else{let n;for(n=t.firstChild;n;n=n.nextSibling)ch(n,e,i)}return i}function uh(t){return"documentElement"in t}function dh(t){return(new DOMParser).parseFromString(t,"application/xml")}function gh(t,e){return function(i,n){const s=t.call(e??this,i,n);void 0!==s&&vi(n[n.length-1],s)}}function ph(t,e){return function(i,n){const s=t.call(e??this,i,n);void 0!==s&&n[n.length-1].push(s)}}function fh(t,e){return function(i,n){const s=t.call(e??this,i,n);void 0!==s&&(n[n.length-1]=s)}}function mh(t,e,i){return function(n,s){const r=t.call(i??this,n,s);if(void 0!==r){const t=s[s.length-1],i=void 0!==e?e:n.localName;let o;i in t?o=t[i]:(o=[],t[i]=o),o.push(r)}}}function _h(t,e,i){return function(n,s){const r=t.call(i??this,n,s);void 0!==r&&(s[s.length-1][void 0!==e?e:n.localName]=r)}}function yh(t,e){return function(i,n,s){t.call(e??this,i,n,s),s[s.length-1].node.appendChild(i)}}function xh(t,e){return function(i,n,s){const r=n[n.length-1].node;let o=t;return void 0===o&&(o=s),lh(void 0!==e?e:r.namespaceURI,o)}}const vh=xh();function Sh(t,e){const i=e.length,n=new Array(i);for(let s=0;s").forEach((e,i,n)=>{i0&&(e=">"+e),function(t,e){t.appendChild(Mh().createCDATASection(e))}(t,e)}):t.appendChild(Mh().createTextNode(e))}const jh=[null,"http://www.opengis.net/ows/1.1"],Wh=wh(jh,{ServiceIdentification:_h(function(t,e){return Eh({},tc,t,e)}),ServiceProvider:_h(function(t,e){return Eh({},ec,t,e)}),OperationsMetadata:_h(function(t,e){return Eh({},qh,t,e)})}),Vh=wh(jh,{DeliveryPoint:_h(Oh),City:_h(Oh),AdministrativeArea:_h(Oh),PostalCode:_h(Oh),Country:_h(Oh),ElectronicMailAddress:_h(Oh)}),Bh=wh(jh,{Value:mh(function(t,e){return Oh(t)})}),Zh=wh(jh,{AllowedValues:_h(function(t,e){return Eh({},Bh,t,e)})}),Xh=wh(jh,{Phone:_h(function(t,e){return Eh({},$h,t,e)}),Address:_h(function(t,e){return Eh({},Vh,t,e)})}),Uh=wh(jh,{HTTP:_h(function(t,e){return Eh({},Kh,t,e)})}),Kh=wh(jh,{Get:mh(function(t,e){const i=Ih(t);if(i)return Eh({href:i},Jh,t,e)}),Post:void 0}),Hh=wh(jh,{DCP:_h(function(t,e){return Eh({},Uh,t,e)})}),qh=wh(jh,{Operation:function(t,e){const i=t.getAttribute("name"),n=Eh({},Hh,t,e);n&&(e[e.length-1][i]=n)}}),$h=wh(jh,{Voice:_h(Oh),Facsimile:_h(Oh)}),Jh=wh(jh,{Constraint:mh(function(t,e){const i=t.getAttribute("name");if(i)return Eh({name:i},Zh,t,e)})}),Qh=wh(jh,{IndividualName:_h(Oh),PositionName:_h(Oh),ContactInfo:_h(function(t,e){return Eh({},Xh,t,e)})}),tc=wh(jh,{Abstract:_h(Oh),AccessConstraints:_h(Oh),Fees:_h(Oh),Title:_h(Oh),ServiceTypeVersion:_h(Oh),ServiceType:_h(Oh)}),ec=wh(jh,{ProviderName:_h(Oh),ProviderSite:_h(Ih),ServiceContact:_h(function(t,e){return Eh({},Qh,t,e)})}),ic=class extends Lh{constructor(){super()}readFromNode(t){return Eh({},Wh,t,[])||null}},nc=[null,"http://www.opengis.net/wmts/1.0"],sc=[null,"http://www.opengis.net/ows/1.1"],rc=wh(nc,{Contents:_h(function(t,e){return Eh({},oc,t,e)})}),oc=wh(nc,{Layer:mh(function(t,e){return Eh({},ac,t,e)}),TileMatrixSet:mh(function(t,e){return Eh({},pc,t,e)})}),ac=wh(nc,{Style:mh(function(t,e){const i=Eh({},lc,t,e);if(!i)return;const n="true"===t.getAttribute("isDefault");return i.isDefault=n,i}),Format:mh(Oh),TileMatrixSetLink:mh(function(t,e){return Eh({},hc,t,e)}),Dimension:mh(function(t,e){return Eh({},dc,t,e)}),ResourceURL:mh(function(t,e){const i=t.getAttribute("format"),n=t.getAttribute("template"),s=t.getAttribute("resourceType"),r={};return i&&(r.format=i),n&&(r.template=n),s&&(r.resourceType=s),r})},wh(sc,{Title:_h(Oh),Abstract:_h(Oh),WGS84BoundingBox:_h(mc),BoundingBox:mh(function(t,e){const i=t.getAttribute("crs"),n=Eh([],gc,t,e);if(2==n.length)return{extent:c(n),crs:i}}),Identifier:_h(Oh)})),lc=wh(nc,{LegendURL:mh(function(t,e){const i={};return i.format=t.getAttribute("format"),i.href=Ih(t),i})},wh(sc,{Title:_h(Oh),Identifier:_h(Oh)})),hc=wh(nc,{TileMatrixSet:_h(Oh),TileMatrixSetLimits:_h(function(t,e){return Eh([],cc,t,e)})}),cc=wh(nc,{TileMatrixLimits:ph(function(t,e){return Eh({},uc,t,e)})}),uc=wh(nc,{TileMatrix:_h(Oh),MinTileRow:_h(Fh),MaxTileRow:_h(Fh),MinTileCol:_h(Fh),MaxTileCol:_h(Fh)}),dc=wh(nc,{Default:_h(Oh),Value:mh(Oh)},wh(sc,{Identifier:_h(Oh)})),gc=wh(sc,{LowerCorner:ph(_c),UpperCorner:ph(_c)}),pc=wh(nc,{WellKnownScaleSet:_h(Oh),TileMatrix:mh(function(t,e){return Eh({},fc,t,e)})},wh(sc,{SupportedCRS:_h(Oh),Identifier:_h(Oh),BoundingBox:_h(mc)})),fc=wh(nc,{TopLeftCorner:_h(_c),ScaleDenominator:_h(Ah),TileWidth:_h(Fh),TileHeight:_h(Fh),MatrixWidth:_h(Fh),MatrixHeight:_h(Fh)},wh(sc,{Identifier:_h(Oh)}));function mc(t,e){const i=Eh([],gc,t,e);if(2==i.length)return c(i)}function _c(t,e){const i=Oh(t).split(/\s+/);if(!i||2!=i.length)return;const n=+i[0],s=+i[1];return isNaN(n)||isNaN(s)?void 0:[n,s]}const yc=class extends Lh{constructor(){super(),this.owsParser_=new ic}readFromNode(t){let e=t.getAttribute("version");e&&(e=e.trim());let i=this.owsParser_.readFromNode(t);return i?(i.version=e,i=Eh(i,rc,t,[]),i||null):null}},xc=class extends Li{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=void 0===i.transition?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(li)}release(){this.setState(4)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(4!==this.state){if(3!==this.state&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){s()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;const n=e-i+1e3/60;return n>=this.transition_?1:Hn(n/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}};function vc(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}const Sc=new Error("disposed"),wc=[256,256],Cc=class extends xc{constructor(t){super(t.tileCoord,0,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=vc(this.data_);return t?[t.width,t.height]:wc}getData(){return this.data_}getError(){return this.error_}load(){if(0!==this.state&&3!==this.state)return;this.state=1,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=2,t.changed()}).catch(function(e){t.error_=e,t.state=3,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(Sc),this.controller_=null),super.disposeInternal()}},Ec=class extends xc{constructor(t,e,i,n,s,r){super(t,e,r),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=2,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=3,this.unlistenImage_(),this.image_=function(){const t=Oe(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=2:this.state=4,this.unlistenImage_(),this.changed()}load(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=function(t,e,i){const n=t;let s=!0,r=!1,o=!1;const a=[Pi(n,"load",function(){o=!0,r||e()})];return n.src&&Ae?(r=!0,n.decode().then(function(){s&&e()}).catch(function(t){s&&(o?e():i())})):a.push(Pi(n,"error",i)),function(){s=!1,a.forEach(Ai)}}(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};class Rc{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}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 Tc(t,e,i,n,s){return void 0!==s?(s.minX=t,s.maxX=e,s.minY=i,s.maxY=n,s):new Rc(t,e,i,n)}const bc=Rc;let Mc;const Lc=[];function Ic(t,e,i,n,s){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,s),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,s)),t.restore()}function Pc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Ac(t,e,i,n){const s=de(i,e,t);let r=re(e,n,i);const o=e.getMetersPerUnit();void 0!==o&&(r*=o);const a=t.getMetersPerUnit();void 0!==a&&(r/=a);const l=t.getExtent();if(!l||p(l,s)){const e=re(t,r,s)/r;isFinite(e)&&e>0&&(r/=e)}return r}const Fc=class{constructor(t,e,i,n,s,r,o){this.sourceProj_=t,this.targetProj_=e;let a={};const l=o?(h=t=>ns(o,de(t,this.targetProj_,this.sourceProj_)),function(t,e,i,n){const s=t.length;i=void 0!==i?i:2,n=n??i,e=void 0!==e?e:new Array(s);for(let r=0;r=o?t[r+i]:s[i]}return e}):ue(this.targetProj_,this.sourceProj_);var h;this.transformInv_=function(t){const e=t[0]+"/"+t[1];return a[e]||(a[e]=l(t)),a[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&z(n)>=z(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?z(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?z(this.targetProj_.getExtent()):null;const c=G(i),u=N(i),d=I(i),g=L(i),p=this.transformInv_(c),f=this.transformInv_(u),m=this.transformInv_(d),_=this.transformInv_(g),y=10+(r?Math.max(0,Math.ceil(Math.log2(M(i)/(r*r*256*256)))):0);if(this.addQuad_(c,u,d,g,p,f,m,_,y),this.wrapsXInSource_){let t=1/0;this.triangles_.forEach(function(e,i,n){t=Math.min(t,e.source[0][0],e.source[1][0],e.source[2][0])}),this.triangles_.forEach(e=>{if(Math.max(e.source[0][0],e.source[1][0],e.source[2][0])-t>this.sourceWorldWidth_/2){const i=[[e.source[0][0],e.source[0][1]],[e.source[1][0],e.source[1][1]],[e.source[2][0],e.source[2][1]]];i[0][0]-t>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-t>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-t>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);const n=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-n.5&&u<1;let p=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=z(c([t,e,i,n]))/this.targetWorldWidth_>.25||p),!g&&this.sourceProj_.isGlobal()&&u&&(p=u>.25||p)),!p&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Y(h,this.maxSourceExtent_))return;let f=0;if(!(p||isFinite(s[0])&&isFinite(s[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)p=!0;else if(f=(isFinite(s[0])&&isFinite(s[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(o[0])&&isFinite(o[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1),1!=f&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!p){const e=[(t[0]+i[0])/2,(t[1]+i[1])/2],n=this.transformInv_(e);let r;r=g?(q(s[0],d)+q(o[0],d))/2-q(n[0],d):(s[0]+o[0])/2-n[0];const a=(s[1]+o[1])/2-n[1];p=r*r+a*a>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const h=[(e[0]+i[0])/2,(e[1]+i[1])/2],c=this.transformInv_(h),u=[(n[0]+t[0])/2,(n[1]+t[1])/2],d=this.transformInv_(u);this.addQuad_(t,e,h,u,s,r,c,d,l-1),this.addQuad_(u,h,i,n,d,c,o,a,l-1)}else{const h=[(t[0]+e[0])/2,(t[1]+e[1])/2],c=this.transformInv_(h),u=[(i[0]+n[0])/2,(i[1]+n[1])/2],d=this.transformInv_(u);this.addQuad_(t,h,u,n,s,c,d,a,l-1),this.addQuad_(h,e,i,u,c,r,o,d,l-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}11&f||this.addTriangle_(t,i,n,s,o,a),14&f||this.addTriangle_(t,i,e,s,o,r),f&&(13&f||this.addTriangle_(e,n,t,r,a,s),7&f||this.addTriangle_(e,n,i,r,a,o))}calculateSourceExtent(){const t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e,i,n){const s=e.source;E(t,s[0]),E(t,s[1]),E(t,s[2])}),t}getTriangles(){return this.triangles_}},Oc=class extends xc{constructor(t,e,i,n,s,r,o,a,l,h,c,u){super(s,0,u),this.renderEdges_=void 0!==c&&c,this.pixelRatio_=o,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=r||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const d=n.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const f=g?k(d,g):d;if(0===M(f))return void(this.state=4);const m=t.getExtent();m&&(p=p?k(p,m):m);const _=n.getResolution(this.wrappedTileCoord_[0]),y=function(t,e,i,n){const s=P(i);let r=Ac(t,e,s,n);return(!isFinite(r)||r<=0)&&b(i,function(i){return r=Ac(t,e,i,n),isFinite(r)&&r>0}),r}(t,i,f,_);if(!isFinite(y)||y<=0)return void(this.state=4);const x=void 0!==h?h:.5;if(this.triangulation_=new Fc(t,i,f,p,y*x,_),0===this.triangulation_.getTriangles().length)return void(this.state=4);this.sourceZ_=e.getZForResolution(y);let v=this.triangulation_.calculateSourceExtent();if(p&&(t.canWrapX()?(v[1]=Z(v[1],p[1],p[3]),v[3]=Z(v[3],p[1],p[3])):v=k(v,p)),M(v)){let i=0,n=0;t.canWrapX()&&(i=z(m),n=Math.floor((v[0]-m[0])/i)),B(v.slice(),t,!0).forEach(t=>{const s=e.getTileRangeForExtentAndZ(t,this.sourceZ_);for(let t=s.minX;t<=s.maxX;t++)for(let e=s.minY;e<=s.maxY;e++){const s=l(this.sourceZ_,t,e,o);if(s){const t=n*i;this.sourceTiles_.push({tile:s,offset:t})}}++n}),0===this.sourceTiles_.length&&(this.state=4)}else this.state=4}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{const i=e.tile;if(i&&2==i.getState()){const n=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);n[0]+=e.offset,n[2]+=e.offset;const s=this.clipExtent_?.slice();s&&(s[0]+=e.offset,s[2]+=e.offset),t.push({extent:n,clipExtent:s,image:i.getImage()})}}),this.sourceTiles_.length=0,0===t.length)this.state=3;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],s="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),o=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=function(t,e,i,n,s,r,o,a,l,h,c,u,d,g){const p=Oe(Math.round(i*t),Math.round(i*e),Lc);if(u||(p.imageSmoothingEnabled=!1),0===l.length)return p.canvas;function f(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";const m=[1/0,1/0,-1/0,-1/0];let _;l.forEach(function(t,e,i){C(m,t.extent)});const y=i/n,x=(u?1:1+Math.pow(2,-24))/y;if(!d||1!==l.length||0!==h){if(_=Oe(Math.round(z(m)*y),Math.round(D(m)*y),Lc),u||(_.imageSmoothingEnabled=!1),s&&g){const t=(s[0]-m[0])*y,e=-(s[3]-m[3])*y,i=z(s)*y,n=D(s)*y;_.rect(t,e,i,n),_.clip()}l.forEach(function(t,e,i){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){_.save();const e=(t.clipExtent[0]-m[0])*y,i=-(t.clipExtent[3]-m[3])*y,n=z(t.clipExtent)*y,s=D(t.clipExtent)*y;_.rect(u?e:Math.round(e),u?i:Math.round(i),u?n:Math.round(e+n)-Math.round(e),u?s:Math.round(i+s)-Math.round(i)),_.clip()}const e=(t.extent[0]-m[0])*y,i=-(t.extent[3]-m[3])*y,n=z(t.extent)*y,s=D(t.extent)*y;_.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,u?e:Math.round(e),u?i:Math.round(i),u?n:Math.round(e+n)-Math.round(e),u?s:Math.round(i+s)-Math.round(i)),t.clipExtent&&_.restore()}})}const v=G(o);return a.getTriangles().forEach(function(t,e,i){const n=t.source,s=t.target;let o=n[0][0],a=n[0][1],h=n[1][0],c=n[1][1],d=n[2][0],g=n[2][1];const y=f((s[0][0]-v[0])/r),S=f(-(s[0][1]-v[1])/r),w=f((s[1][0]-v[0])/r),C=f(-(s[1][1]-v[1])/r),E=f((s[2][0]-v[0])/r),R=f(-(s[2][1]-v[1])/r),T=o,b=a;o=0,a=0,h-=T,c-=b,d-=T,g-=b;const M=function(t){const e=t.length;for(let i=0;is&&(s=e,n=r)}if(0===s)return null;const r=t[n];t[n]=t[i],t[i]=r;for(let n=i+1;n=0;n--){i[n]=t[n][e]/t[n][n];for(let s=n-1;s>=0;s--)t[s][e]-=t[s][n]*i[n]}return i}([[h,c,0,0,w-y],[d,g,0,0,E-y],[0,0,h,c,C-S],[0,0,d,g,R-S]]);if(!M)return;if(p.save(),p.beginPath(),function(){if(void 0===Mc){const t=Oe(6,6,Lc);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Ic(t,4,5,4,0),Ic(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;Mc=Pc(e,0)||Pc(e,4)||Pc(e,8),Ge(t),Lc.push(t.canvas)}return Mc}()||!u){p.moveTo(w,C);const t=4,e=y-w,i=S-C;for(let n=0;n{const i=e.getState();if(0==i||1==i){t++;const i=Ii(e,li,n=>{const s=e.getState();2!=s&&3!=s&&4!=s||(Ai(i),t--,0===t&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(i)}}),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t},e,i){0==t.getState()&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Ai),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Ge(this.canvas_.getContext("2d")),Lc.push(this.canvas_),this.canvas_=null),super.release()}},Dc=class{constructor(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const t=this.pop();t instanceof fi&&t.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}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){const i=this.entries_[t];return Te(void 0!==i,"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){const e=this.entries_[t];return Te(void 0!==e,"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(){const t=new Array(this.count_);let e,i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t}getValues(){const t=new Array(this.count_);let e,i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.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(){const 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){Te(!(t in this.entries_),"Tried to set a value for a key that is used already");const 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}};function kc(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Gc(t){return e=t[0],(t[1]<{if("function"==typeof ke()[e])return this.push_(e),this.pushMethodArgs_},set:(t,e,i)=>(this.push_(e,i),!0)})}push_(...t){const e=this.instructions_,i=this.zIndex+this.offset_;e[i]||(e[i]=[]),e[i].push(...t)}pushMethodArgs_=(...t)=>(this.push_(t),this);pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let i=0,n=e.length;ithis.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return s()}getData(t){return null}prepareFrame(t){return s()}renderFrame(t,e){return s()}forEachFeatureAtCoordinate(t,e,i,n,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;2!==e.getState()&&3!==e.getState()||this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return 2!=e&&3!=e&&t.addEventListener(li,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}},Yc=[];let jc=null;const Wc=class extends zc{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=[1,0,0,1,0,0],this.pixelTransform=[1,0,0,1,0,0],this.inversePixelTransform=[1,0,0,1,0,0],this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,i){let n;jc||(jc=Oe(1,1,void 0,{willReadFrequently:!0})),jc.clearRect(0,0,1,1);try{jc.drawImage(t,e,i,1,1,0,0,1,1),n=jc.getImageData(0,0,1,1).data}catch{return jc=null,null}return n}getBackground(t){let e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let s,r;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&Si(oi(t.style.backgroundColor),oi(i)))){const e=t.firstElementChild;e instanceof HTMLCanvasElement&&(r=e.getContext("2d"))}if(r&&function(t,e){const i=ls(t),n=ls(e);for(let t=0;t<6;++t)if(0!==Math.round((i[t]-n[t])*as[t]))return!1;return!0}(r.canvas.style.transform,e)?(this.container=t,this.context=r,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=n;let t=s.style;t.position="absolute",t.width="100%",t.height="100%",r=Oe();const e=r.canvas;s.appendChild(e),t=e.style,t.position="absolute",t.left="0",t.transformOrigin="top left",this.container=s,this.context=r}this.containerReused||!i||this.container.style.backgroundColor||(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=G(i),s=N(i),r=I(i),o=L(i);ns(e.coordinateToPixelTransform,n),ns(e.coordinateToPixelTransform,s),ns(e.coordinateToPixelTransform,r),ns(e.coordinateToPixelTransform,o);const a=this.inversePixelTransform;ns(a,n),ns(a,s),ns(a,r),ns(a,o),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){const i=t.extent,n=t.viewState.resolution,s=t.viewState.rotation,r=t.pixelRatio,o=Math.round(z(i)/n*r),a=Math.round(D(i)/n*r);rs(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/r,1/r,s,-o/2,-a/2),os(this.inversePixelTransform,this.pixelTransform);const l="matrix("+this.pixelTransform.join(", ")+")";if(this.useContainer(e,l,this.getBackground(t)),!this.containerReused){const t=this.context.canvas;t.width!=o||t.height!=a?(t.width=o,t.height=a):this.context.clearRect(0,0,o,a),l!==t.style.transform&&(t.style.transform=l)}}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const s=new Ul(t,this.inversePixelTransform,i,e);n.dispatchEvent(s)}}preRender(t,e){this.frameState=e,e.declutter||this.dispatchRenderEvent_(Mo,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(Lo,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Nc),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(Mo,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(Lo,this.context,t))}getRenderTransform(t,e,i,n,s,r,o){const a=s/2,l=r/2,h=n/e,c=-h,u=-t[0]+o,d=-t[1];return rs(this.tempTransform,a,l,h,c,-i,u,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}};function Vc(t,e,i,n,s){return`${o(t)},${e},${function(t,e,i){return t+"/"+e+"/"+i}(i,n,s)}`}function Bc(t,e,i){if(!(i in t))return t[i]=new Set([e]),!0;const n=t[i],s=n.has(e);return s||n.add(e),!s}function Zc(t,e,i){const n=t[i];return!!n&&n.delete(e)}function Xc(t,e){const i=t.layerStatesArray[t.layerIndex];i.extent&&(e=k(e,xe(i.extent,t.viewState.projection)));const n=i.layer.getRenderSource();if(!n.getWrapX()){const i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=k(e,i))}return e}const Uc=class extends Wc{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=[1/0,1/0,-1/0,-1/0],this.tempTileRange_=new bc(0,0,0,0),this.tempTileCoord_=kc(0,0,0);const i=void 0!==e.cacheSize?e.cacheSize:512;this.tileCache_=new Dc(i),this.maxStaleKeys=.5*i}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,i,n){const s=this.tileCache_,r=this.getLayer().getSource(),o=Vc(r,r.getKey(),t,e,i);let a;if(s.containsKey(o))a=s.get(o);else{if(a=r.getTile(t,e,i,n.pixelRatio,n.viewState.projection),!a)return null;s.set(o,a)}return a}getTile(t,e,i,n){return this.getOrCreateTile(t,e,i,n)||null}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=ns(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!p(s,n))return null;const r=e.viewState,o=i.getRenderSource(),a=o.getTileGridForProjection(r.projection),l=o.getTilePixelRatio(e.pixelRatio);for(let t=a.getZForResolution(r.resolution);t>=a.getMinZoom();--t){const i=a.getTileCoordForCoordAndZ(n,t),s=this.getTile(t,i[1],i[2],e);if(!s||2!==s.getState())continue;const h=a.getOrigin(t),c=Sn(a.getTileSize(t)),u=a.getResolution(t);let d;if(s instanceof Ec||s instanceof Oc)d=s.getImage();else{if(!(s instanceof Cc))continue;if(d=vc(s.getData()),!d)continue}const g=Math.floor(l*((n[0]-h[0])/u-i[1]*c[0])),p=Math.floor(l*((h[1]-n[1])/u-i[2]*c[1])),f=Math.round(l*o.getGutterForProjection(r.projection));return this.getImageData(d,g+f,p+f)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const i=e.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedSourceRevision_=i,!0}enqueueTiles(t,e,i,n,s){const r=t.viewState,a=this.getLayer(),l=a.getRenderSource(),h=l.getTileGridForProjection(r.projection),c=o(l);c in t.wantedTiles||(t.wantedTiles[c]={});const u=t.wantedTiles[c],d=a.getMapInternal(),g=Math.max(i-s,h.getMinZoom(),h.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):h.getResolution(0)),l.zDirection)),p=r.rotation,f=p?O(r.center,r.resolution,p,t.size):void 0;for(let s=i;s>=g;--s){const i=h.getTileRangeForExtentAndZ(e,s,this.tempTileRange_),r=h.getResolution(s);for(let e=i.minX;e<=i.maxX;++e)for(let o=i.minY;o<=i.maxY;++o){if(p&&!h.tileCoordIntersectsViewport([s,e,o],f))continue;const i=this.getTile(s,e,o,t);if(!i)continue;if(!Bc(n,i,s))continue;const a=i.getKey();if(u[a]=!0,0===i.getState()&&!t.tileQueue.isKeyQueued(a)){const n=kc(s,e,o,this.tempTileCoord_);t.tileQueue.enqueue([i,c,h.getTileCoordCenter(n),r])}}}}findStaleTile_(t,e){const i=this.tileCache_,n=t[0],s=t[1],r=t[2],a=this.getStaleKeys();for(let t=0;t0&&setTimeout(()=>{this.enqueueTiles(t,T,d-1,E,R-1)},0),!(d in E))return this.container;const b=o(this),M=t.time;for(const e of E[d]){const i=e.getState();if(4===i)continue;const n=e.tileCoord;if(2===i&&1===e.getAlpha(b,M)){e.endTransition(b);continue}if(3!==i&&(this.renderComplete=!1),this.findStaleTile_(n,E)){Zc(E,e,d),t.animate=!0;continue}if(this.findAltTiles_(u,n,d+1,E))continue;const s=u.getMinZoom();for(let t=d-1;t>=s&&!this.findAltTiles_(u,n,t,E);--t);}const L=g/r*l/m,I=this.getRenderContext(t);rs(this.tempTransform,_/2,y/2,L,L,0,-_/2,-y/2),i.extent&&this.clipUnrotated(I,t,x),c.getInterpolate()||(I.imageSmoothingEnabled=!1),this.preRender(I,t);const P=Object.keys(E).map(Number);let A;P.sort(mi);const F=[],O=[];for(let e=P.length-1;e>=0;--e){const i=P[e],n=c.getTilePixelSize(i,l,s),r=u.getResolution(i)/g,o=n[0]*r*L,a=n[1]*r*L,h=u.getTileCoordForCoordAndZ(G(C),i),d=u.getTileCoordExtent(h),p=ns(this.tempTransform,[m*(d[0]-C[0])/g,m*(C[3]-d[3])/g]),f=m*c.getGutterForProjection(s);for(const e of E[i]){if(2!==e.getState())continue;const n=e.tileCoord,s=h[1]-n[1],r=Math.round(p[0]-(s-1)*o),l=h[2]-n[2],u=Math.round(p[1]-(l-1)*a),d=Math.round(p[0]-s*o),g=Math.round(p[1]-l*a),m=r-d,_=u-g,y=1===P.length;let x=!1;A=[d,g,d+m,g,d+m,g+_,d,g+_];for(let t=0,e=F.length;t{const i=o(c),n=e.wantedTiles[i],s=n?Object.keys(n).length:0;this.updateCacheSize(s),this.tileCache_.expireCache()};t.postRenderFunctions.push(e)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,2*t)}drawTile(t,e,i,n,s,r,a,l){let h;if(t instanceof Cc){if(h=vc(t.getData()),!h)throw new Error("Rendering array data is not yet supported")}else h=this.getTileImage(t);if(!h)return;const c=this.getRenderContext(e),u=o(this),d=e.layerStatesArray[e.layerIndex],g=d.opacity*(l?t.getAlpha(u,e.time):1),p=g!==c.globalAlpha;p&&(c.save(),c.globalAlpha=g),c.drawImage(h,a,a,h.width-2*a,h.height-2*a,i,n,s,r),p&&c.restore(),g!==d.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){const n=o(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}},Kc="preload",Hc="useInterimTilesOnError",qc=class extends Fo{constructor(t){t=t||{};const e=Object.assign({},t),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(void 0!==t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Kc)}setPreload(t){this.set(Kc,t)}getUseInterimTilesOnError(){return this.get(Hc)}setUseInterimTilesOnError(t){this.set(Hc,t)}getData(t){return super.getData(t)}},$c=class extends qc{constructor(t){super(t)}createRenderer(){return new Uc(this,{cacheSize:this.getCacheSize()})}},Jc=[0,0,0],Qc=class{constructor(t){let e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Te(function(t){const e=((t,e)=>e-t)||mi;return t.every(function(i,n){if(0===n)return!0;const s=e(t[n-1],i);return!(s>0||0===s)})}(this.resolutions_),"`resolutions` must be sorted in descending order"),!t.origins)for(let t=0,i=this.resolutions_.length-1;t{const n=new bc(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){const t=this.getTileRangeForExtentAndZ(i,e);n.minX=Math.max(t.minX,n.minX),n.maxX=Math.min(t.maxX,n.maxX),n.minY=Math.max(t.minY,n.minY),n.maxY=Math.min(t.maxY,n.maxY)}return n}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let t=n.minX,s=n.maxX;t<=s;++t)for(let s=n.minY,r=n.maxY;s<=r;++s)i([e,t,s])}forEachTileCoordParentTileRange(t,e,i,n){let s,r,o,a=null,l=t[0]-1;for(2===this.zoomFactor_?(r=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);l>=this.minZoom;){if(void 0!==r&&void 0!==o?(r=Math.floor(r/2),o=Math.floor(o/2),s=Tc(r,r,o,o,i)):s=this.getTileRangeForExtentAndZ(a,l,i),e(l,s))return!0;--l}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?n:Math.max(r/i[0],s/i[1]);const o=e+1,a=new Array(o);for(let t=0;tt):null}const pu=class extends Bi{constructor(t){super(),this.projection=se(t.projection),this.attributions_=gu(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(t,i){e.viewResolver=t,e.viewRejector=i})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=gu(t),this.changed()}setState(t){this.state_=t,this.changed()}};class fu extends Mi{constructor(t,e){super(t),this.tile=e}}const mu=class extends pu{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;this.tileGrid&&Sn(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=t.key||o(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,r){return s()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:tu(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),r=Sn(n.getTileSize(t),this.tmpSize);return 1==s?r:(o=r,a=s,void 0===(l=this.tmpSize)&&(l=[0,0]),l[0]=o[0]*a+.5|0,l[1]=o[1]*a+.5|0,l);var o,a,l}getTileCoordForTileUrlFunction(t,e){const i=void 0!==e?e:this.getProjection(),n=void 0!==e?this.getTileGridForProjection(i):this.tileGrid||this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){const n=e[0],s=t.getTileCoordCenter(e),r=nu(i);if(!p(r,s)){const e=z(r),i=Math.ceil((r[0]-s[0])/e);return s[0]+=e*i,t.getTileCoordForCoordAndZ(s,n)}return e}(n,t,i)),function(t,e){const i=t[0],n=t[1],s=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;const r=e.getFullTileRange(i);return!r||r.containsXY(n,s)}(t,n)?t:null}clear(){}refresh(){this.clear(),super.refresh()}};class _u extends mu{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===_u.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,i=o(e),n=e.getState();let s;1==n?(this.tileLoadingKeys_[i]=!0,s="tileloadstart"):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=3==n?"tileloaderror":2==n?"tileloadend":void 0),null!=s&&this.dispatchEvent(new fu(s,e))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,void 0!==e?this.setKey(e):this.changed()}setUrl(t){const e=hu(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(uu(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}}const yu=_u;function xu(t,e){t.getImage().src=e}const vu=class extends yu{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:xu,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:void 0===t.interpolate||t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:Ec,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!le(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||le(e,t)))return this.tileGrid;const i=o(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=tu(t)),this.tileGridForProjection[i]}createTile_(t,e,i,n,s,r){const o=[t,e,i],a=this.getTileCoordForTileUrlFunction(o,s),l=a?this.tileUrlFunction(a,n,s):void 0,h=new this.tileClass(o,void 0!==l?0:4,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=r,h.addEventListener(li,this.handleTileChange.bind(this)),h}getTile(t,e,i,n,s){const r=this.getProjection();if(!r||!s||le(r,s))return this.getTileInternal(t,e,i,n,r||s);const o=[t,e,i],a=this.getKey(),l=this.getTileGridForProjection(r),h=this.getTileGridForProjection(s),c=this.getTileCoordForTileUrlFunction(o,s),u=new Oc(r,l,s,h,o,c,this.getTilePixelRatio(n),this.getGutter(),(t,e,i,n)=>this.getTileInternal(t,e,i,n,r),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return u.key=a,u}getTileInternal(t,e,i,n,s){const r=this.getKey();return this.createTile_(t,e,i,n,s,r)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const i=se(t);if(i){const t=o(i);t in this.tileGridForProjection||(this.tileGridForProjection[t]=e)}}},Su=class extends vu{constructor(t){const e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",i=void 0!==t.tileGrid?t.tileGrid:eu({extent:nu(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,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0}getGutter(){return this.gutter_}},wu=class extends Su{constructor(t){let e;e=void 0!==(t=t||{}).attributions?t.attributions:['© OpenStreetMap contributors.'];const i=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n=void 0!==t.url?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}},Cu="1.3.0";function Eu(t,e,i,n,s,r,o){r=Object.assign({REQUEST:"GetMap"},r);const a=e/i,l=[Q(z(t)/a,4),Q(D(t)/a,4)];if(1!=i)switch(o){case"geoserver":const t=90*i+.5|0;"FORMAT_OPTIONS"in r?r.FORMAT_OPTIONS+=";dpi:"+t:r.FORMAT_OPTIONS="dpi:"+t;break;case"mapserver":r.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":r.DPI=90*i;break;default:throw new Error("Unknown `serverType` configured")}return function(t,e,i,n,s){s.WIDTH=i[0],s.HEIGHT=i[1];const r=n.getAxisOrientation(),o=st(s.VERSION,"1.3")>=0;s[o?"CRS":"SRS"]=n.getCode();const a=o&&r.startsWith("ne")?[e[1],e[0],e[3],e[2]]:e;return s.BBOX=a.join(","),su(t,s)}(s,t,l,n,r)}function Ru(t,e){return Object.assign({REQUEST:e,SERVICE:"WMS",VERSION:Cu,FORMAT:"image/png",STYLES:"",TRANSPARENT:"TRUE"},t)}const Tu=class extends vu{constructor(t){t=t||{};const e=Object.assign({},t.params);super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.params_=e,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,e,i,n){const s=se(i),r=this.getProjection()||s;let o=this.getTileGrid();o||(o=this.getTileGridForProjection(r));const a=de(t,s,r),l=Ac(r,s,t,e),h=o.getZForResolution(l,this.zDirection),c=o.getResolution(h),d=o.getTileCoordForCoordAndZ(a,h);if(o.getResolutions().length<=d[0])return;let g=o.getTileCoordExtent(d,this.tmpExtent_);const p=this.gutter_;0!==p&&(g=u(g,c*p,g));const f={QUERY_LAYERS:this.params_.LAYERS};Object.assign(f,Ru(this.params_,"GetFeatureInfo"),n);const m=Math.floor((a[0]-g[0])/c),_=Math.floor((g[3]-a[1])/c);return f[this.v13_?"I":"X"]=m,f[this.v13_?"J":"Y"]=_,this.getRequestUrl_(d,g,1,r||s,f)}getLegendUrl(t,e){if(void 0===this.urls[0])return;const i={SERVICE:"WMS",VERSION:Cu,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){const t=this.params_.LAYERS;if(Array.isArray(t)&&1!==t.length)return;i.LAYER=t}if(void 0!==t){const e=this.getProjection()?this.getProjection().getMetersPerUnit():1,n=28e-5;i.SCALE=t*e/n}return Object.assign(i,e),su(this.urls[0],i)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,i,n,s){const r=this.urls;if(!r)return;let o;return o=1==r.length?r[0]:r[q(Gc(t),r.length)],Eu(e,(this.tileGrid||this.getTileGridForProjection(n)).getResolution(t[0]),i,n,o,s,this.serverType_)}getTilePixelRatio(t){return this.hidpi_&&void 0!==this.serverType_?t:1}getKeyForParams_(){let t=0;const e=[];for(const i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")}setParams_(t){this.params_=t,this.updateV13_(),this.setKey(this.getKeyForParams_())}setParams(t){this.setParams_(Object.assign({},t))}updateParams(t){this.setParams_(Object.assign(this.params_,t))}updateV13_(){const t=this.params_.VERSION||Cu;this.v13_=st(t,"1.3")>=0}tileUrlFunction(t,e,i){let n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(i)),n.getResolutions().length<=t[0])return;1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);const s=n.getResolution(t[0]);let r=n.getTileCoordExtent(t,this.tmpExtent_);const o=this.gutter_;0!==o&&(r=u(r,s*o,r));const a=Object.assign({},Ru(this.params_,"GetMap"));return this.getRequestUrl_(t,r,e,i,a)}};class bu extends Qc{constructor(t){super({extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes}),this.matrixIds_=t.matrixIds}getMatrixId(t){return this.matrixIds_[t]}getMatrixIds(){return this.matrixIds_}}const Mu=class extends vu{constructor(t){const e=void 0!==t.requestEncoding?t.requestEncoding:"KVP",i=t.tileGrid;let n=t.urls;void 0===n&&void 0!==t.url&&(n=hu(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:n,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),n&&n.length>0&&(this.tileUrlFunction=du(n.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join("\n");this.setTileUrlFunction(du(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};"KVP"==e&&Object.assign(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t="KVP"==e?su(t,i):t.replace(/\{(\w+?)\}/g,function(t,e){return e.toLowerCase()in i?i[e.toLowerCase()]:t});const n=this.tileGrid,s=this.dimensions_;return function(i,r,o){if(!i)return;const a={TileMatrix:n.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};Object.assign(a,s);let l=t;return l="KVP"==e?su(l,a):l.replace(/\{(\w+?)\}/g,function(t,e){return encodeURIComponent(a[e])}),l}}};Error,Error;const Lu=class extends vu{constructor(t){if(super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:se("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.tileJSON_=null,this.tileSize_=t.tileSize,t.url)if(t.jsonp)!function(t,e,i){const n=document.createElement("script"),s="olc_"+o(e);function r(){delete window[s],n.parentNode.removeChild(n)}n.async=!0,n.src=t+(t.includes("?")?"&":"?")+"callback="+s;const a=setTimeout(function(){r(),i&&i()},1e4);window[s]=function(t){clearTimeout(a),r(),e(t)},document.head.appendChild(n)}(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else{if(!t.tileJSON)throw new Error("Either `url` or `tileJSON` options must be provided");this.handleTileJSONResponse(t.tileJSON)}}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let t;try{t=JSON.parse(e.responseText)}catch{return void this.handleTileJSONError()}this.handleTileJSONResponse(t)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(t){const e=se("EPSG:4326"),i=this.getProjection();let n;if(void 0!==t.bounds){const s=he(e,i);n=W(t.bounds,s)}const s=nu(i),r=t.minzoom||0,o=eu({extent:s,maxZoom:t.maxzoom||22,minZoom:r,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=uu(t.tiles,o),t.attribution&&!this.getAttributions()){const e=void 0!==n?n:s;this.setAttributions(function(i){return Y(e,i.extent)?[t.attribution]:null})}this.tileJSON_=t,this.setState("ready")}handleTileJSONError(){this.setState("error")}};n().log("cp.maps.TileLayer: version 2024-03-24"),n().maps.TileLayer=class extends $c{constructor(t,e){let i={title:e},n=t.getRestrictedExtent();null!=n&&(i.extent=n),super(i),t.addLayer(this),this.map=t,this.name=e}},n().maps.TileLayer.prototype.setOSMSource=function(){let t=new wu({maxZoom:19,attributions:n().maps.attributons.OSM});this.map.setMaxZoom(19),this.setSource(t)},n().maps.TileLayer.prototype.redraw=function(){this.changed()},n().maps.TileLayer.prototype.setWMSSource=function(t,e,i,s,r){let o={LAYERS:e};s&&(o.VERSION=s);let a=new Tu({url:t,crossOrigin:"anonymous",params:o,attributions:n().maps.attribText(i)});this.map.setMaxZoom(r||19),this.setSource(a)},n().maps.TileLayer.prototype.setWMTSSource=function(t,e,i,s,r){let o=new yc,a=this;fetch(t).then(function(t){return t.text()}).then(function(t){let l=function(t,e){const i=t.Contents.Layer,n=i?.find(function(t){return t.Identifier==e.layer});if(!n)return null;const s=t.Contents.TileMatrixSet;let r;r=n.TileMatrixSetLink.length>1?"projection"in e?n.TileMatrixSetLink.findIndex(function(t){const i=s.find(function(e){return e.Identifier==t.TileMatrixSet}).SupportedCRS,n=se(i),r=se(e.projection);return n&&r?le(n,r):i==e.projection}):n.TileMatrixSetLink.findIndex(function(t){return t.TileMatrixSet==e.matrixSet}):0,r<0&&(r=0);const o=n.TileMatrixSetLink[r].TileMatrixSet,a=n.TileMatrixSetLink[r].TileMatrixSetLimits;let l=n.Format[0];"format"in e&&(l=e.format),r=n.Style.findIndex(function(t){return"style"in e?t.Title==e.style:t.isDefault}),r<0&&(r=0);const h=n.Style[r].Identifier,c={};"Dimension"in n&&n.Dimension.forEach(function(t,e,i){const n=t.Identifier;let s=t.Default;void 0===s&&(s=t.Value[0]),c[n]=s});const u=t.Contents.TileMatrixSet.find(function(t){return t.Identifier==o});let d;const g=u.SupportedCRS;if(g&&(d=se(g)),"projection"in e){const t=se(e.projection);t&&(d&&!le(t,d)||(d=t))}let p=!1;const m=d.getAxisOrientation().startsWith("ne");let _=u.TileMatrix[0],y={MinTileCol:0,MinTileRow:0,MaxTileCol:_.MatrixWidth-1,MaxTileRow:_.MatrixHeight-1};if(a){y=a[a.length-1];const t=u.TileMatrix.find(t=>t.Identifier===y.TileMatrix||u.Identifier+":"+t.Identifier===y.TileMatrix);t&&(_=t)}const x=28e-5*_.ScaleDenominator/d.getMetersPerUnit(),v=m?[_.TopLeftCorner[1],_.TopLeftCorner[0]]:_.TopLeftCorner,S=_.TileWidth*x,w=_.TileHeight*x;let C=u.BoundingBox;C&&m&&(C=[C[1],C[0],C[3],C[2]]);let E=[v[0]+S*y.MinTileCol,v[1]-w*(1+y.MaxTileRow),v[0]+S*(1+y.MaxTileCol),v[1]-w*y.MinTileRow];if(void 0!==C&&!f(C,E)){const t=n.WGS84BoundingBox,e=se("EPSG:4326").getExtent();if(E=C,t)p=t[0]===e[0]&&t[2]===e[2];else{const t=ge(C,u.SupportedCRS,"EPSG:4326");p=t[0]-1e-10<=e[0]&&t[2]+1e-10>=e[2]}}const R=function(t,e,i){const n=[],s=[],r=[],o=[],a=[];i=void 0!==i?i:[];const l="TileMatrix",h="Identifier",c="ScaleDenominator",u="TopLeftCorner",d=se(t.SupportedCRS),g=d.getMetersPerUnit(),p=d.getAxisOrientation().startsWith("ne");return t[l].sort(function(t,e){return e[c]-t[c]}),t[l].forEach(function(e){let d;if(d=!(i.length>0)||i.find(function(i){return e[h]==i[l]||!e[h].includes(":")&&t[h]+":"+e[h]===i[l]}),d){s.push(e[h]);const t=28e-5*e[c]/g,i=e.TileWidth,l=e.TileHeight;p?r.push([e[u][1],e[u][0]]):r.push(e[u]),n.push(t),o.push(i==l?i:[i,l]),a.push([e.MatrixWidth,e.MatrixHeight])}}),new bu({extent:e,origins:r,resolutions:n,matrixIds:s,tileSizes:o,sizes:a})}(u,E,a),T=[];let b=e.requestEncoding;if(b=void 0!==b?b:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata){const e=t.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let t=0,i=e.length;t=this.getMinZoom():this.visible},n().maps.Feature.prototype.getVisible=function(){return this.visible},n().maps.Feature.prototype.setVisible=function(t){t!=this.visible&&(this.visible=t,this.changed())},n().maps.Feature.prototype.isSelectable=function(){return!!this.isVisible()&&this.selectable},n().maps.Feature.prototype.setSelectable=function(t){this.selectable=t},n().maps.Feature.prototype.setSelected=function(t){if(t==this.selected)return;this.selected=t,this.changed();let e=this.getLayer().getAssociatedLayer();e&&e.setFeatureSelected(this.getId(),t)},n().maps.Feature.prototype.getAttributes=function(){return this.attributes},n().maps.Feature.prototype.getAttr=function(t){return this.attributes[t]},n().maps.Feature.prototype.getMinZoom=function(){return this.attributes.minZoom},n().maps.Feature.prototype.setAttr=function(t,e){this.attributes[t]=e,this.changed()},n().maps.Feature.prototype.getMapOptions=function(){return this.mapOptions},n().maps.Feature.prototype.setMapOptions=function(t){for(let e in t)this.mapOptions[e]=t[e]},n().maps.Feature.prototype.getLayer=function(){return this.layer},n().maps.Feature.prototype.setLayer=function(t){this.layer=t},n().maps.Feature.prototype.getPopup=function(){return this.popup},n().maps.Feature.prototype.setPopup=function(t){!t&&this.popup&&this.popup.hide(),this.popup=t,t&&this.selected&&t.show()},n().maps.Feature.prototype.getBounds=function(){let t=this.getGeometry();return t?t.getExtent():null},n().maps.Feature.prototype.getCoveredRect=function(t,e,i,s){let r=this.getLayer().getMap(),o=this.getGeometry().getExtent(),a=r.getPixelFromCoordinate(o);if(!a)return null;let l=s+i/4,h=t?[]:[new(n().maps.Rect)(a[0]-l,a[1]-l,2*l,2*l)];return this.vAlign?("N"==this.vAlign?a[1]-=l+i:"S"==this.vAlign?a[1]+=l:a[1]-=i/2,"W"==this.hAlign?a[0]-=e+l:"CW"==this.hAlign?a[0]-=e:"E"==this.hAlign?a[0]+=l:"CE"==this.hAlign?a[0]-=0:a[0]-=e/2,h.push(new(n().maps.Rect)(a[0],a[1],e,i)),h):h},n().maps.Feature.setDynamicAttributes=function(t,e){let i=0,s=0,r="C4"==e.cat?3:0,o=null!=e.pop&&e.pop>=0?e.pop:e.oldpop,a=t.getName();if(a==n().maps.PLACELAYER||a.startsWith(n().maps.PLACELAYER+"R")||a==n().maps.AGGLOLAYER){let t=n().maps.Symbol.getSizeOfSymbol(o);i=10*t,e.fontSize=.97*(4+16*t+r),e.symbSize=i,e.xOff=0,e.yOff=1.5,s=i}if("W"==e.align?(e.tAlign="right",e.bLine="middle",e.xOff=-3-i-r,e.yOff+=1):"O"==e.align?(e.tAlign="left",e.bLine="middle",e.xOff=3.6+i+r,e.yOff+=1):"N"==e.align?(e.tAlign="center",e.bLine="bottom",e.yOff+=-1-s+r):"NO"==e.align?(e.tAlign="left",e.bLine="bottom",e.yOff+=-.5-s+r):"NW"==e.align?(e.tAlign="right",e.bLine="bottom",e.yOff+=-.5-s+r):"S"==e.align?(e.tAlign="center",e.bLine="top",e.yOff+=1.5+s-r):"SO"==e.align?(e.tAlign="left",e.bLine="top",e.yOff+=1+s-r):"SW"==e.align?(e.tAlign="right",e.bLine="top",e.yOff+=1+s-r):(e.tAlign="center",e.bLine="middle"),a==n().maps.PLACELAYER||a.startsWith(n().maps.PLACELAYER+"R")||a==n().maps.ADMAREALAYER){e.popColor=n().maps.Color.getPopColor(o),e.changeColor=n().maps.Color.getChangeColor(null),e.popdate=t.getMetadata().popdate,e.oldpopdate=t.getMetadata().oldpopdate;let i=n().data.computeAnnualChange(e.oldpopdate,e.popdate,e.oldpop,e.pop);null!=i&&(e.change=Math.round(100*i)/100,e.changeColor=n().maps.Color.getChangeColor(e.change,a==n().maps.PLACELAYER||a.startsWith(n().maps.PLACELAYER+"R")?1:.75),e.changeRot=n().maps.Symbol.computeChangeRotation(e.change)),e.densColor=n().maps.Color.getDensityColor(null),e.area>0&&(100*o/e.area>.1?e.density=Math.round(1e3*o/e.area)/10:e.density=Math.round(1e6*o/e.area)/1e4,e.densColor=n().maps.Color.getDensityColor(e.density,a==n().maps.PLACELAYER||a.startsWith(n().maps.PLACELAYER+"R")?1:.75))}a==n().maps.AGGLOLAYER&&(e.popColor=n().maps.Color.getPopColor(o),e.changeColor=n().maps.Color.getChangeColor(e.change),e.changeRot=n().maps.Symbol.computeChangeRotation(e.change),e.densColor=n().maps.Color.getDensityColor(e.density))},n().maps.Feature.computeAttributes=function(t,e){if(null==e.name&&(e.name="XXX"),null!=e.minZoom&&(e.minZoom=9-Math.log(e.minZoom)/Math.LN2),t.getName()==n().maps.PLACELAYER||t.getName().startsWith(n().maps.PLACELAYER+"R")||t.getName()==n().maps.AGGLOLAYER)null==e.minZoom&&(e.minZoom=9),e.outWidth=0,e.fontColor=new(n().maps.Color)(0,0,0),"C2"==e.cat||"C3"==e.cat?(e.fontWeight="bold",e.fontStyle="",e.textDec=""):"C1"==e.cat?(e.fontWeight="normal",e.fontStyle="",e.textDec=""):"C4"==e.cat?(e.fontWeight="bold",e.fontStyle="",e.textDec="",e.outWidth=3):(e.fontWeight="",e.fontStyle="",e.textDec="");else{e.catClass=parseInt(e.cat.substr(1)),e.cat=e.cat.substr(0,1),e.fontColor=new(n().maps.Color)(0,0,255),e.fontWeight="";let t=6,i=3;switch(e.cat){case"S":t=15,e.fontColor=new(n().maps.Color)(191,0,0),e.fontWeight="bold";break;case"L":t=10,i=4,e.fontColor=e.catClass<=1?new(n().maps.Color)(80,80,80):new(n().maps.Color)(30,30,30),e.fontWeight="bold";break;case"A":t=22,i=-4,e.fontColor=e.catClass>=2?new(n().maps.Color)(80,80,80):new(n().maps.Color)(30,30,30),e.fontWeight="bold";break;case"M":t=14,e.fontWeight="bold";break;case"I":t=8,e.fontColor=new(n().maps.Color)(0,159,0);break;case"C":t=34,i=-9,e.fontWeight="bold",e.fontColor=new(n().maps.Color)(68,68,68),e.outWidth=2}e.fontSize=.9*(t+e.catClass*i),e.yOff=0}return n().maps.Feature.setDynamicAttributes(t,e),e},n().maps.FeatureArray=class extends Array{constructor(){super(),this.bounds=null}},n().maps.FeatureArray.prototype.add=function(t){if(null==this.bounds)this.bounds=t.getBounds();else{let e=t.getBounds(),i=this.bounds;this.bounds=[Math.min(e[0],i[0]),Math.min(e[1],i[1]),Math.max(e[2],i[2]),Math.max(e[3],i[3])]}this.push(t)},n().maps.FeatureArray.prototype.getBounds=function(){return this.bounds},n().maps.Popup=class extends Gu{constructor(t,e,i,n){super({element:e,position:t.getGeometry().getCoordinates(),positioning:"top-center",offset:[i,n]}),this.feature=t,this.add()}},n().maps.Popup.prototype.show=function(){this.setPosition(this.feature.getGeometry().getCoordinates())},n().maps.Popup.prototype.hide=function(){this.setPosition(void 0)},n().maps.Popup.prototype.remove=function(){this.feature.getLayer().getMap().removeOverlay(this)},n().maps.Popup.prototype.add=function(){this.feature.getLayer().getMap().addOverlay(this)},n().maps.Popup.prototype.getFeature=function(){return this.feature},n().maps.Marker=class extends ks{constructor(t,e,i){super(n().maps.Coord.byLatLng(e,i,t.getMap().getProjCode())),this.layer=t}},n().maps.Marker.prototype.getLayer=function(){return this.layer},n().maps.Marker.prototype.getLatLng=function(){let t=de(this.getCoordinates(),this.getLayer().getMap().getProjCode(),n().maps.WGS84);return{lng:t[0],lat:t[1]}},n().maps.Feature,n().maps.FeatureArray,n().maps.Marker,n().maps.Popup;class Nu extends gs{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Ai),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,i=t.length;et.clone())}const Yu=Nu;function ju(t,e,i,n,s,r,o){let a,l;const h=(i-e)/n;if(1===h)a=e;else if(2===h)a=e,l=s;else if(0!==h){let r=t[e],o=t[e+1],h=0;const c=[0];for(let s=e+n;s>1),s=+i(t[n],e),s<0?r=n+1:(o=n,a=!s);return a?r:~r}(c,u);d<0?(l=(u-c[-d-2])/(c[-d-1]-c[-d-2]),a=e+(-d-2)*n):a=e+d*n}o=o>1?o:2,r=r||new Array(o);for(let e=0;e>1;s0?i[0]:null}readFeatureFromNode(t,e){return null}readFeatures(t,e){if(!t)return[];if("string"==typeof t){const i=dh(t);return this.readFeaturesFromDocument(i,e)}return uh(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}readFeaturesFromDocument(t,e){const i=[];for(let n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&vi(i,this.readFeaturesFromNode(n,e));return i}readFeaturesFromNode(t,e){return s()}readGeometry(t,e){if(!t)return null;if("string"==typeof t){const i=dh(t);return this.readGeometryFromDocument(i,e)}return uh(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}readGeometryFromDocument(t,e){return null}readGeometryFromNode(t,e){return null}readProjection(t){if(!t)return null;if("string"==typeof t){const e=dh(t);return this.readProjectionFromDocument(e)}return uh(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}readProjectionFromDocument(t){return this.dataProjection}readProjectionFromNode(t){return this.dataProjection}writeFeature(t,e){const i=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(i)}writeFeatureNode(t,e){return null}writeFeatures(t,e){const i=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(i)}writeFeaturesNode(t,e){return null}writeGeometry(t,e){const i=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(i)}writeGeometryNode(t,e){return null}},id=["http://www.google.com/kml/ext/2.2"],nd=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],sd={fraction:"fraction",pixels:"pixels",insetPixels:"pixels"},rd=wh(nd,{ExtendedData:lg,Region:hg,MultiGeometry:_h(Qd,"geometry"),LineString:_h(qd,"geometry"),LinearRing:_h($d,"geometry"),Point:_h(tg,"geometry"),Polygon:_h(ig,"geometry"),Style:_h(sg),StyleMap:function(t,e){const i=kd.call(this,t,e);if(!i)return;const n=e[e.length-1];if(Array.isArray(i))n.Style=i;else{if("string"!=typeof i)throw new Error("`styleMapValue` has an unknown type");n.styleUrl=i}},address:_h(Oh),description:_h(Oh),name:_h(Oh),open:_h(Ph),phoneNumber:_h(Oh),styleUrl:_h(Fd),visibility:_h(Ph)},wh(id,{MultiTrack:_h(function(t,e){const i=Eh([],Vd,t,e);if(i)return new Uu(i)},"geometry"),Track:_h(Zd,"geometry")})),od=wh(nd,{ExtendedData:lg,Region:hg,Link:function(t,e){Ch(ad,t,e)},address:_h(Oh),description:_h(Oh),name:_h(Oh),open:_h(Ph),phoneNumber:_h(Oh),visibility:_h(Ph)}),ad=wh(nd,{href:_h(Ad)}),ld=wh(nd,{Altitude:_h(Ah),Longitude:_h(Ah),Latitude:_h(Ah),Tilt:_h(Ah),AltitudeMode:_h(Oh),Heading:_h(Ah),Roll:_h(Ah)}),hd=wh(nd,{LatLonAltBox:function(t,e){const i=Eh({},dg,t,e);if(!i)return;const n=e[e.length-1],s=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)];n.extent=s,n.altitudeMode=i.altitudeMode,n.minAltitude=parseFloat(i.minAltitude),n.maxAltitude=parseFloat(i.maxAltitude)},Lod:function(t,e){const i=Eh({},gg,t,e);if(!i)return;const n=e[e.length-1];n.minLodPixels=parseFloat(i.minLodPixels),n.maxLodPixels=parseFloat(i.maxLodPixels),n.minFadeExtent=parseFloat(i.minFadeExtent),n.maxFadeExtent=parseFloat(i.maxFadeExtent)}}),cd=wh(nd,["Document","Placemark"]),ud=wh(nd,{Document:yh(function(t,e,i){Rh({node:t},yg,xg,e,i,void 0,this)}),Placemark:yh(Vg)});let dd,gd,pd,fd,md,_d,yd,xd,vd,Sd=null,wd=null,Cd=null,Ed=null,Rd=null,Td=null;function bd(t){return 32/Math.min(t[0],t[1])}function Md(t){return t}function Ld(t,e,i){return Array.isArray(t)?t:"string"==typeof t?Ld(i[t],e,i):e}function Id(t){const e=hh(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(i){const t=i[1];return[parseInt(t.substr(6,2),16),parseInt(t.substr(4,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(0,2),16)/255]}}function Pd(t){let e=hh(t,!1);const i=[];e=e.replace(/\s*,\s*/g,",");const n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;let s;for(;s=n.exec(e);){const t=parseFloat(s[1]),n=parseFloat(s[2]),r=s[3]?parseFloat(s[3]):0;i.push(t,n,r),e=e.substr(s[0].length)}if(""===e)return i}function Ad(t){const e=hh(t,!1).trim();let i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(e,i).href:e}function Fd(t){const e=hh(t,!1).trim().replace(/^(?!.*#)/,"#");let i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(e,i).href:e}function Od(t){return Ah(t)}const Dd=wh(nd,{Pair:function(t,e){const i=Eh({},cg,t,e,this);if(!i)return;const n=i.key;if(n&&"normal"==n){const t=i.styleUrl;t&&(e[e.length-1]=t);const n=i.Style;n&&(e[e.length-1]=n)}}});function kd(t,e){return Eh(void 0,Dd,t,e,this)}const Gd=wh(nd,{Icon:_h(function(t,e){const i=Eh({},Xd,t,e);return i||null}),color:_h(Id),heading:_h(Ah),hotSpot:_h(function(t){const e=t.getAttribute("xunits"),i=t.getAttribute("yunits");let n;return n="insetPixels"!==e?"insetPixels"!==i?"bottom-left":"top-left":"insetPixels"!==i?"bottom-right":"top-right",{x:parseFloat(t.getAttribute("x")),xunits:sd[e],y:parseFloat(t.getAttribute("y")),yunits:sd[i],origin:n}}),scale:_h(Od)}),Nd=wh(nd,{color:_h(Id),scale:_h(Od)}),zd=wh(nd,{color:_h(Id),width:_h(Ah)}),Yd=wh(nd,{color:_h(Id),fill:_h(Ph),outline:_h(Ph)}),jd=wh(nd,{coordinates:fh(Pd)});function Wd(t,e){return Eh(null,jd,t,e)}const Vd=wh(id,{Track:ph(Zd)}),Bd=wh(nd,{when:function(t,e){const i=e[e.length-1].whens,n=hh(t,!1),s=Date.parse(n);i.push(isNaN(s)?0:s)}},wh(id,{coord:function(t,e){const i=e[e.length-1].coordinates,n=hh(t,!1),s=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(s){const t=parseFloat(s[1]),e=parseFloat(s[2]),n=parseFloat(s[3]);i.push([t,e,n])}else i.push([])}}));function Zd(t,e){const i=Eh({coordinates:[],whens:[]},Bd,t,e);if(!i)return;const n=[],s=i.coordinates,r=i.whens;for(let t=0,e=Math.min(s.length,r.length);t0&&e[e.length-1].push(...i)},outerBoundaryIs:function(t,e){const i=Eh(void 0,fg,t,e);i&&(e[e.length-1][0]=i)}});function ig(t,e){const i=Eh({},Hd,t,e),n=Eh([null],eg,t,e);if(n&&n[0]){const t=n[0],e=[t.length];for(let i=1,s=n.length;i0;let o;const a=s.href;let l,h,c;a?o=a:r&&(o=_d);let u="bottom-left";const d=i.hotSpot;let g;d?(l=[d.x,d.y],h=d.xunits,c=d.yunits,u=d.origin):/^https?:\/\/maps\.(?:google|gstatic)\.com\//.test(o)&&(o.includes("pushpin")?(l=gd,h=pd,c=fd):o.includes("arrow-reverse")?(l=[54,42],h=pd,c=fd):o.includes("paddle")&&(l=[32,1],h=pd,c=fd));const p=s.x,f=s.y;let m;void 0!==p&&void 0!==f&&(g=[p,f]);const _=s.w,y=s.h;let x;void 0!==_&&void 0!==y&&(m=[_,y]);const v=i.heading;void 0!==v&&(x=H(v));const S=i.scale,w=i.color;if(r){o==_d&&(m=md);const t=new zn({anchor:l,anchorOrigin:u,anchorXUnits:h,anchorYUnits:c,crossOrigin:this.crossOrigin_,offset:g,offsetOrigin:"bottom-left",rotation:x,scale:S,size:m,src:this.iconUrlFunction_(o),color:w}),e=t.getScaleArray()[0],i=t.getSize();if(null===i){const i=t.getImageState();if(0===i||1===i){const n=function(){const i=t.getImageState();if(0!==i&&1!==i){const i=t.getSize();if(i&&2==i.length){const n=bd(i);t.setScale(e*n)}t.unlistenImageChange(n)}};t.listenImageChange(n),0===i&&t.load()}}else if(2==i.length){const n=bd(i);t.setScale(e*n)}n.imageStyle=t}else n.imageStyle=yd},LabelStyle:function(t,e){const i=Eh({},Nd,t,e);if(!i)return;const n=e[e.length-1],s=new jn({fill:new Ln({color:"color"in i?i.color:dd}),scale:i.scale});n.textStyle=s},LineStyle:function(t,e){const i=Eh({},zd,t,e);if(!i)return;const n=e[e.length-1],s=new Pn({color:"color"in i?i.color:dd,width:"width"in i?i.width:1});n.strokeStyle=s},PolyStyle:function(t,e){const i=Eh({},Yd,t,e);if(!i)return;const n=e[e.length-1],s=new Ln({color:"color"in i?i.color:dd});n.fillStyle=s;const r=i.fill;void 0!==r&&(n.fill=r);const o=i.outline;void 0!==o&&(n.outline=o)}});function sg(t,e){const i=Eh({},ng,t,e,this);if(!i)return null;let n="fillStyle"in i?i.fillStyle:Sd;const s=i.fill;let r;void 0===s||s||(n=null),"imageStyle"in i?i.imageStyle!=yd&&(r=i.imageStyle):r=wd;const o="textStyle"in i?i.textStyle:Ed,a="strokeStyle"in i?i.strokeStyle:Cd,l=i.outline;return void 0===l||l?[new kn({fill:n,image:r,stroke:a,text:o,zIndex:void 0})]:[new kn({geometry:function(t){const e=t.getGeometry(),i=e.getType();return"GeometryCollection"===i?new Yu(e.getGeometriesArrayRecursive().filter(function(t){const e=t.getType();return"Polygon"!==e&&"MultiPolygon"!==e})):"Polygon"!==i&&"MultiPolygon"!==i?e:void 0},fill:n,image:r,stroke:a,text:o,zIndex:void 0}),new kn({geometry:function(t){const e=t.getGeometry(),i=e.getType();return"GeometryCollection"===i?new Yu(e.getGeometriesArrayRecursive().filter(function(t){const e=t.getType();return"Polygon"===e||"MultiPolygon"===e})):"Polygon"===i||"MultiPolygon"===i?e:void 0},fill:n,stroke:null,zIndex:void 0})]}function rg(t,e){const i=e.length,n=new Array(e.length),s=new Array(e.length),r=new Array(e.length);let o,a,l;o=!1,a=!1,l=!1;for(let t=0;t0){const t=Sh(s,o);Rh(n,Yg,Wg,[{names:o,values:t}],i)}const u=i[0];let d=e.getGeometry();d&&(d=td(d,!0,u)),Rh(n,Yg,Pg,[d],i)}const Bg=wh(nd,["extrude","tessellate","altitudeMode","coordinates"]),Zg=wh(nd,{extrude:yh(Dh),tessellate:yh(Dh),altitudeMode:yh(Yh),coordinates:yh(function(t,e,i){const n=i[i.length-1],s=n.layout,r=n.stride;let o;if("XY"==s||"XYM"==s)o=2;else{if("XYZ"!=s&&"XYZM"!=s)throw new Error("Invalid geometry layout");o=3}const a=e.length;let l="";if(a>0){l+=e[0];for(let t=1;t0;else{const t=e.getType();i="Point"===t||"MultiPoint"===t}}i&&(n=t.get("name"),i=i&&!!n,i&&/&[^&]+;/.test(n)&&(vd||(vd=document.createElement("textarea")),vd.innerHTML=n,n=vd.value));let r=h;if(a?r=a:l&&(r=Ld(l,h,c)),i){const t=function(t,e){const i=[0,0];let n="start";const s=t.getImage();if(s){const t=s.getSize();if(t&&2==t.length){const e=s.getScaleArray(),r=s.getAnchor();i[0]=e[0]*(t[0]-r[0]),i[1]=e[1]*(t[1]/2-r[1]),n="left"}}let r=t.getText();return r?(r=r.clone(),r.setFont(r.getFont()||Ed.getFont()),r.setScale(r.getScale()||Ed.getScale()),r.setFill(r.getFill()||Ed.getFill()),r.setStroke(r.getStroke()||xd)):r=Ed.clone(),r.setText(e),r.setOffsetX(i[0]),r.setOffsetY(i[1]),r.setTextAlign(n),new kn({image:s,text:r})}(r[0],n);return s.length>0?(t.setGeometry(new Yu(s)),[t,new kn({geometry:r[0].getGeometry(),image:null,fill:r[0].getFill(),stroke:r[0].getStroke(),text:null})].concat(r.slice(1))):t}return r});n.setStyle(t)}var a,l,h,c,u;return delete i.Style,n.setProperties(i,!0),n}readSharedStyle_(t,e){const i=t.getAttribute("id");if(null!==i){const n=sg.call(this,t,e);if(n){let e,s=t.baseURI;s&&"about:blank"!=s||(s=window.location.href),e=s?new URL("#"+i,s).href:"#"+i,this.sharedStyles_[e]=n}}}readSharedStyleMap_(t,e){const i=t.getAttribute("id");if(null===i)return;const n=kd.call(this,t,e);if(!n)return;let s,r=t.baseURI;r&&"about:blank"!=r||(r=window.location.href),s=r?new URL("#"+i,r).href:"#"+i,this.sharedStyles_[s]=n}readFeatureFromNode(t,e){if(!nd.includes(t.namespaceURI))return null;return this.readPlacemark_(t,[this.getReadOptions(t,e)])||null}readFeaturesFromNode(t,e){if(!nd.includes(t.namespaceURI))return[];let i;const n=t.localName;if("Document"==n||"Folder"==n)return i=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]),i||[];if("Placemark"==n){const i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){i=[];for(let n=t.firstElementChild;n;n=n.nextElementSibling){const t=this.readFeaturesFromNode(n,e);t&&vi(i,t)}return i}return[]}readName(t){if(t){if("string"==typeof t){const e=dh(t);return this.readNameFromDocument(e)}return uh(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}}readNameFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){const t=this.readNameFromNode(e);if(t)return t}}readNameFromNode(t){for(let e=t.firstElementChild;e;e=e.nextElementSibling)if(nd.includes(e.namespaceURI)&&"name"==e.localName)return Oh(e);for(let e=t.firstElementChild;e;e=e.nextElementSibling){const t=e.localName;if(nd.includes(e.namespaceURI)&&("Document"==t||"Folder"==t||"Placemark"==t||"kml"==t)){const t=this.readNameFromNode(e);if(t)return t}}}readNetworkLinks(t){const e=[];if("string"==typeof t){const i=dh(t);vi(e,this.readNetworkLinksFromDocument(i))}else uh(t)?vi(e,this.readNetworkLinksFromDocument(t)):vi(e,this.readNetworkLinksFromNode(t));return e}readNetworkLinksFromDocument(t){const e=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&vi(e,this.readNetworkLinksFromNode(i));return e}readNetworkLinksFromNode(t){const e=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)if(nd.includes(i.namespaceURI)&&"NetworkLink"==i.localName){const t=Eh({},od,i,[]);e.push(t)}for(let i=t.firstElementChild;i;i=i.nextElementSibling){const t=i.localName;!nd.includes(i.namespaceURI)||"Document"!=t&&"Folder"!=t&&"kml"!=t||vi(e,this.readNetworkLinksFromNode(i))}return e}readRegion(t){const e=[];if("string"==typeof t){const i=dh(t);vi(e,this.readRegionFromDocument(i))}else uh(t)?vi(e,this.readRegionFromDocument(t)):vi(e,this.readRegionFromNode(t));return e}readRegionFromDocument(t){const e=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&vi(e,this.readRegionFromNode(i));return e}readRegionFromNode(t){const e=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)if(nd.includes(i.namespaceURI)&&"Region"==i.localName){const t=Eh({},hd,i,[]);e.push(t)}for(let i=t.firstElementChild;i;i=i.nextElementSibling){const t=i.localName;!nd.includes(i.namespaceURI)||"Document"!=t&&"Folder"!=t&&"kml"!=t||vi(e,this.readRegionFromNode(i))}return e}readCamera(t){const e=[];if("string"==typeof t){const i=dh(t);vi(e,this.readCameraFromDocument(i))}else uh(t)?vi(e,this.readCameraFromDocument(t)):vi(e,this.readCameraFromNode(t));return e}readCameraFromDocument(t){const e=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType===Node.ELEMENT_NODE&&vi(e,this.readCameraFromNode(i));return e}readCameraFromNode(t){const e=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)if(nd.includes(i.namespaceURI)&&"Camera"===i.localName){const t=Eh({},ld,i,[]);e.push(t)}for(let i=t.firstElementChild;i;i=i.nextElementSibling){const t=i.localName;!nd.includes(i.namespaceURI)||"Document"!==t&&"Folder"!==t&&"Placemark"!==t&&"kml"!==t||vi(e,this.readCameraFromNode(i))}return e}writeFeaturesNode(t,e){e=this.adaptOptions(e);const i=lh(nd[4],"kml"),n="http://www.w3.org/2000/xmlns/";i.setAttributeNS(n,"xmlns:gx",id[0]),i.setAttributeNS(n,"xmlns:xsi",ah),i.setAttributeNS(ah,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");const s={node:i},r={};t.length>1?r.Document=t:1==t.length&&(r.Placemark=t[0]);const o=cd[i.namespaceURI],a=Sh(r,o);return Rh(s,ud,vh,a,[e],o,this),i}},np=class{drawCustom(t,e,i,n,s){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,i){}drawFeature(t,e,i){}drawGeometryCollection(t,e,i){}drawLineString(t,e,i){}drawMultiLineString(t,e,i){}drawMultiPoint(t,e,i){}drawMultiPolygon(t,e,i){}drawPoint(t,e,i){}drawPolygon(t,e,i){}drawText(t,e,i){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}},sp={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},rp=[sp.FILL],op=[sp.STROKE],ap=[sp.BEGIN_PATH],lp=[sp.CLOSE_PATH],hp=sp,up=class extends np{constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,s=this.coordinates;let r=s.length;for(let o=0,a=t.length;oa&&(this.instructions.push([hp.CUSTOM,a,h,t,i,Rs,s]),this.hitDetectionInstructions.push([hp.CUSTOM,a,h,t,n||i,Rs,s]));break;case"Point":l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),h=this.coordinates.length,this.instructions.push([hp.CUSTOM,a,h,t,i,void 0,s]),this.hitDetectionInstructions.push([hp.CUSTOM,a,h,t,n||i,void 0,s])}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[hp.BEGIN_GEOMETRY,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[hp.BEGIN_GEOMETRY,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;let e;t.reverse();const i=t.length;let n,s,r=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0;return e}setFillStrokeStyle(t,e){const i=this.state;this.fillStyleToState(t,i),this.strokeStyleToState(e,i)}createFill(t){const e=t.fillStyle,i=[hp.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[hp.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,t.lineDash?this.applyPixelRatio(t.lineDash):null,t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,s=t.lineDash,r=t.lineDashOffset,o=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||s!=t.currentLineDash&&!Si(t.currentLineDash,s)||t.currentLineDashOffset!=r||t.currentLineJoin!=o||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=s,t.currentLineDashOffset=r,t.currentLineJoin=o,t.currentLineWidth=a,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[hp.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=d(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;u(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},dp=class extends up{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinatess_(t,e,i,n){const s=this.state,r=void 0!==s.fillStyle,o=void 0!==s.strokeStyle,a=i.length;this.instructions.push(ap),this.hitDetectionInstructions.push(ap);for(let s=0;s=t){const e=(t-a+u)/u,d=$(i,h,e),g=$(n,c,e);l.push(d,g),r.push(l),l=[d,g],a==t&&(o+=s),a=0}else if(a0&&r.push(l),r}function pp(t,e,i,n,s){let r,o,a,l,h,c,u,d,g,p,f=i,m=i,_=0,y=0,x=i;for(o=i;ot&&(y>_&&(_=y,f=x,m=o),y=0,x=o-s)),a=l,u=g,d=p),h=i,c=n}return y+=l,y>_?[x,o]:[f,m]}const fp={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},mp={Circle:dp,Default:up,Image:class extends up{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,i){if(!this.image_||this.maxExtent&&!p(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),s=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(n,s);this.instructions.push([hp.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([hp.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),s=[];for(let e=0,i=n.length;e{const n=o[2*(t+i)]===h[i*c]&&o[2*(t+i)+1]===h[i*c+1];return n||--t,n})}this.saveTextStates_();const u=r.backgroundFill?this.createFill(this.fillStyleToState(r.backgroundFill)):null,d=r.backgroundStroke?this.createStroke(this.strokeStyleToState(r.backgroundStroke)):null;this.beginGeometry(t,e,i);let g=r.padding;if(g!=ln&&(r.scale[0]<0||r.scale[1]<0)){let t=r.padding[0],e=r.padding[1],i=r.padding[2],n=r.padding[3];r.scale[0]<0&&(e=-e,n=-n),r.scale[1]<0&&(t=-t,i=-i),g=[t,e,i,n]}const p=this.pixelRatio;this.instructions.push([hp.DRAW_IMAGE,a,s,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,g==ln?ln:g.map(function(t){return t*p}),u,d,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]);const f=1/p,m=u?u.slice(0):null;m&&(m[1]=tn),this.hitDetectionInstructions.push([hp.DRAW_IMAGE,a,s,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[f,f],NaN,this.declutterMode_,this.declutterImageWithText_,g,m,d,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?tn:this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]),this.endGeometry(e)}else{if(!Y(this.maxExtent,t.getExtent()))return;let n;if(h=t.getFlatCoordinates(),"LineString"==l)n=[h.length];else if("MultiLineString"==l)n=t.getEnds();else if("Polygon"==l)n=t.getEnds().slice(0,1);else if("MultiPolygon"==l){const e=t.getEndss();n=[];for(let t=0,i=e.length;tt[2]}else M=S>T;const L=Math.PI,I=[],P=C+n===e;let A;if(_=0,y=E,g=t[e=C],p=t[e+1],P){x(),A=Math.atan2(p-m,g-f),M&&(A+=A>0?-L:L);const t=(T+S)/2,e=(b+w)/2;return I[0]=[t,e,(R-r)/2,A,s],I}for(let t=0,u=(s=s.replace(/\n/g," ")).length;t0?-L:L),void 0!==A){let t=d-A;if(t+=t>L?-2*L:t<-L?2*L:0,Math.abs(t)>o)return null}A=d;const S=t;let w=0;for(;t0&&t.push("\n",""),t.push(e,""),t}function Mp(t,e,i){return i%2==0&&(t+=e),t}const Lp=class{constructor(t,e,i,n,s){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=s?new Nc:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,n){const s=t+e+i+n;if(this.labels_[s])return this.labels_[s];const r=n?this.strokeStates[n]:null,o=i?this.fillStates[i]:null,a=this.textStates[e],l=this.pixelRatio,h=[a.scale[0]*l,a.scale[1]*l],c=a.justify?fp[a.justify]:Tp(Array.isArray(t)?t[0]:t,a.textAlign||on),u=n&&r.lineWidth?r.lineWidth:0,d=Array.isArray(t)?t:String(t).split("\n").reduce(bp,[]),{width:g,height:p,widths:f,heights:m,lineWidths:_}=function(t,e){const i=[],n=[],s=[];let r=0,o=0,a=0,l=0;for(let h=0,c=e.length;h<=c;h+=2){const u=e[h];if("\n"===u||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const d=e[h+1]||t.font,g=yn(d,u);i.push(g),o+=g;const p=mn(d);n.push(p),l=Math.max(l,p)}return{width:r,height:a,widths:i,heights:n,lineWidths:s}}(a,d),y=g+u,x=[],v=(y+2)*h[0],S=(p+u)*h[1],w={width:v<0?Math.floor(v):Math.ceil(v),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:x};1==h[0]&&1==h[1]||x.push("scale",h),n&&(x.push("strokeStyle",r.strokeStyle),x.push("lineWidth",u),x.push("lineCap",r.lineCap),x.push("lineJoin",r.lineJoin),x.push("miterLimit",r.miterLimit),x.push("setLineDash",[r.lineDash]),x.push("lineDashOffset",r.lineDashOffset)),i&&x.push("fillStyle",o.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");const C=.5-c;let E=c*y+C*u;const R=[],T=[];let b,M=0,L=0,I=0,P=0;for(let t=0,e=d.length;tt?t-l:s,v=r+h>e?e-h:r,S=g[3]+x*u[0]+g[1],w=g[0]+v*u[1]+g[2],C=m-g[3],E=_-g[0];let R;return(p||0!==c)&&(vp[0]=C,Cp[0]=C,vp[1]=E,Sp[1]=E,Sp[0]=C+S,wp[0]=Sp[0],wp[1]=E+w,Cp[1]=wp[1]),0!==c?(R=rs([1,0,0,1,0,0],i,n,1,1,c,-i,-n),ns(R,vp),ns(R,Sp),ns(R,wp),ns(R,Cp),y(Math.min(vp[0],Sp[0],wp[0],Cp[0]),Math.min(vp[1],Sp[1],wp[1],Cp[1]),Math.max(vp[0],Sp[0],wp[0],Cp[0]),Math.max(vp[1],Sp[1],wp[1],Cp[1]),xp)):y(Math.min(C,C+S),Math.min(E,E+w),Math.max(C,C+S),Math.max(E,E+w),xp),d&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:x,drawImageH:v,originX:l,originY:h,declutterBox:{minX:xp[0],minY:xp[1],maxX:xp[2],maxY:xp[3],value:f},canvasTransform:R,scale:u}}replayImageOrLabel_(t,e,i,n,s,r,o){const a=!(!r&&!o),l=n.declutterBox,h=o?o[2]*n.scale[0]/2:0;return l.minX-h<=e[0]&&l.maxX+h>=0&&l.minY-h<=e[1]&&l.maxY+h>=0&&(a&&this.replayTextBackground_(t,vp,Sp,wp,Cp,r,o),function(t,e,i,n,s,r,o,a,l,h,c){t.save(),1!==i&&(void 0===t.globalAlpha?t.globalAlpha=t=>t.globalAlpha*=i:t.globalAlpha*=i),e&&t.transform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(c[0],c[1]),function(t,e){const i=t.contextInstructions;for(let t=0,n=i.length;tO&&(this.fill_(t),M=0),L>O&&(t.stroke(),L=0),M||L||(t.beginPath(),y=NaN,x=NaN),++d;break;case hp.CIRCLE:b=i[1];const n=h[b],c=h[b+1],u=h[b+2]-n,g=h[b+3]-c,z=Math.sqrt(u*u+g*g);t.moveTo(n+z,c),t.arc(n,c,z,0,2*Math.PI,!0),++d;break;case hp.CLOSE_PATH:t.closePath(),++d;break;case hp.CUSTOM:b=i[1],p=i[2];const j=i[3],W=i[4],V=i[5];F.geometry=j,F.feature=D,d in I||(I[d]=[]);const B=I[d];V?V(h,b,p,2,B):(B[0]=h[b],B[1]=h[b+1],B.length=2),l&&(l.zIndex=i[6]),W(B,F),++d;break;case hp.DRAW_IMAGE:b=i[1],p=i[2],w=i[3],f=i[4],m=i[5];let Z=i[6];const X=i[7],U=i[8],K=i[9],H=i[10];let q=i[11];const $=i[12];let J=i[13];_=i[14]||"declutter";const Q=i[15];if(!w&&i.length>=20){C=i[19],E=i[20],R=i[21],T=i[22];const t=this.drawLabelWithPointPlacement_(C,E,R,T);w=t.label,i[3]=w;const e=i[23];f=(t.anchorX-e)*this.pixelRatio,i[4]=f;const n=i[24];m=(t.anchorY-n)*this.pixelRatio,i[5]=m,Z=w.height,i[6]=Z,J=w.width,i[13]=J}let tt,et,it,nt;i.length>25&&(tt=i[25]),i.length>17?(et=i[16],it=i[17],nt=i[18]):(et=ln,it=null,nt=null),H&&A?q+=P:H||A||(q-=P);let st=0;for(;b!Pp.includes(t)),Fp={},Op=class{constructor(t,e,i,n,s,r,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,o)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t,e){for(const i in t){let n=this.executorsByZIndex_[i];void 0===n&&(n={},this.executorsByZIndex_[i]=n);const s=t[i];for(const t in s){const i=s[t];n[t]=new Lp(this.resolution_,this.pixelRatio_,this.overlaps_,i,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let e=0,n=t.length;ei)break;let a=n[o];a||(a=[],n[o]=a),a.push(4*((t+s)*e+(t+r))+3),s>0&&a.push(4*((t-s)*e+(t+r))+3),r>0&&(a.push(4*((t+s)*e+(t-r))+3),s>0&&a.push(4*((t-s)*e+(t-r))+3))}const s=[];for(let t=0,e=n.length;t0){if(!r||"none"===i||"Image"!==g&&"Text"!==g||r.includes(t)){const i=(d[l]-3)/4,r=n-i%o,a=n-(i/o|0),h=s(t,e,r*r+a*a);if(h)return h}h.clearRect(0,0,o,o);break}}const f=Object.keys(this.executorsByZIndex_).map(Number);let m,_,y,x,v;for(f.sort(mi),m=f.length-1;m>=0;--m){const t=f[m].toString();for(y=this.executorsByZIndex_[t],_=Ip.length-1;_>=0;--_)if(g=Ip[_],x=y[g],void 0!==x&&(v=x.executeHitDetection(h,a,i,p,c),v))return v}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],s=e[2],r=e[3],o=[i,n,i,r,s,r,s,n];return hs(o,0,8,2,t,o),o}isEmpty(){return bi(this.executorsByZIndex_)}execute(t,e,i,n,s,r,o){const a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(o?_i:mi),r=r||Ip;const l=Ip.length;for(let h=0,c=a.length;hg.execute(t,e,i,n,s,o)):g.execute(c,e,i,n,s,o),u&&c.restore(),r){r.offset();const t=a[h]*l+Ip.indexOf(d);this.deferredZIndexContexts_[t]||(this.deferredZIndexContexts_[t]=[]),this.deferredZIndexContexts_[t].push(r)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(mi);for(let i=0,n=e.length;i{t.draw(this.renderedContext_),t.clear()}),t[e[i]].length=0}},Dp=class extends np{constructor(t,e,i,n,s,r,o){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?J(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=r,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}drawImages_(t,e,i,n){if(!this.image_)return;const s=hs(t,e,i,n,this.transform_,this.pixelCoordinates_),r=this.context_,o=this.tmpLocalTransform_,a=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=a*this.imageOpacity_);let l=this.imageRotation_;0===this.transformRotation_&&(l-=this.viewRotation_),this.imageRotateWithView_&&(l+=this.viewRotation_);for(let t=0,e=s.length;tt*this.pixelRatio_),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==r?r:sn,lineWidth:(void 0!==o?o:1)*this.pixelRatio_,miterLimit:void 0!==a?a:10,strokeStyle:zi(t||rn)}}else this.strokeState_=null}setImageStyle(t){let e;if(!t||!(e=t.getSize()))return void(this.image_=null);const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const r=t.getScaleArray();this.imageScale_=[r[0]*this.pixelRatio_/i,r[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(t){const e=t.getFill();if(e){const t=e.getColor();this.textFillState_={fillStyle:zi(t||tn)}}else this.textFillState_=null;const i=t.getStroke();if(i){const t=i.getColor(),e=i.getLineCap(),n=i.getLineDash(),s=i.getLineDashOffset(),r=i.getLineJoin(),o=i.getWidth(),a=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:en,lineDash:n||nn,lineDashOffset:s||0,lineJoin:void 0!==r?r:sn,lineWidth:void 0!==o?o:1,miterLimit:void 0!==a?a:10,strokeStyle:zi(t||rn)}}else this.textStrokeState_=null;const n=t.getFont(),s=t.getOffsetX(),r=t.getOffsetY(),o=t.getRotateWithView(),a=t.getRotation(),l=t.getScaleArray(),h=t.getText(),c=t.getTextAlign(),u=t.getTextBaseline();this.textState_={font:void 0!==n?n:Qi,textAlign:void 0!==c?c:on,textBaseline:void 0!==u?u:an},this.text_=void 0!==h?Array.isArray(h)?h.reduce((t,e,i)=>t+(i%2?" ":e),""):h:"",this.textOffsetX_=void 0!==s?this.pixelRatio_*s:0,this.textOffsetY_=void 0!==r?this.pixelRatio_*r:0,this.textRotateWithView_=void 0!==o&&o,this.textRotation_=void 0!==a?a:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}else this.text_=""}},kp=.5;function Gp(t,e,i,n,s,r,o,a,l){const h=l?ye(s):s,c=Oe(t[0]*kp,t[1]*kp);c.imageSmoothingEnabled=!1;const u=c.canvas,d=new Dp(c,kp,s,null,o,a,l?he(fe(),l):null),g=i.length,p=Math.floor(16777215/g),f={};for(let t=1;t<=g;++t){const e=i[t-1],s=e.getStyleFunction()||n;if(!s)continue;let o=s(e,r);if(!o)continue;Array.isArray(o)||(o=[o]);const a=(t*p).toString(16).padStart(7,"#00000");for(let t=0,i=o.length;t0;return u&&Promise.all(l).then(()=>s(null)),function(t,e,i,n,s,r,o){const a=i.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(n,s);i.getRenderer()?Bp(t,l,i,e,o):(0,zp[l.getType()])(t,l,i,e,o,r)}(t,e,i,n,r,o,a),u}function Bp(t,e,i,n,s){if("GeometryCollection"==e.getType()){const r=e.getGeometries();for(let e=0,o=r.length;e{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=this.frameState.size.slice(),e=this.renderedCenter_,i=this.renderedResolution_,n=this.renderedRotation_,s=this.renderedProjection_,r=this.wrappedRenderedExtent_,o=this.getLayer(),a=[],l=t[0]*kp,h=t[1]*kp;a.push(this.getRenderTransform(e,i,n,kp,l,h,0).slice());const c=o.getSource(),u=s.getExtent();if(c.getWrapX()&&s.canWrapX()&&!f(u,r)){let t=r[0];const s=z(u);let o,c=0;for(;tu[2];)++c,o=s*c,a.push(this.getRenderTransform(e,i,n,kp,l,h,o).slice()),t-=s}const d=fe();this.hitDetectionImageData_=Gp(t,a,this.renderedFeatures_,o.getStyleFunction(),r,i,n,jp(i,this.renderedPixelRatio_),d?s:null)}e(Np(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,n,s){if(!this.replayGroup_)return;const r=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(t,r,a,i,function(t,e,i){const r=o(t),a=h[r];if(a){if(!0!==a&&it.value):null)}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[0],s=t.viewHints[1],r=e.getUpdateWhileAnimating(),o=e.getUpdateWhileInteracting();if(this.ready&&!r&&n||!o&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const a=t.extent,l=t.viewState,h=l.projection,c=l.resolution,d=t.pixelRatio,g=e.getRevision(),p=e.getRenderBuffer();let m=e.getRenderOrder();void 0===m&&(m=Yp);const _=l.center.slice(),y=u(a,p*c),x=y.slice(),v=[y.slice()],S=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!f(S,t.extent)){const t=z(S),e=Math.max(z(y)/2,t);y[0]=S[0]-e,y[2]=S[2]+e,lt(_,h);const i=V(v[0],h);i[0]S[0]&&i[2]>S[2]&&v.push([i[0]-t,i[1],i[2]-t,i[3]])}if(this.ready&&this.renderedResolution_==c&&this.renderedRevision_==g&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!t.declutter&&f(this.wrappedRenderedExtent_,y))return Si(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const w=new _p(Wp(c,d),y,c,d),C=fe();let E;if(C){for(let t=0,e=v.length;t{let n;const s=t.getStyleFunction()||e.getStyleFunction();if(s&&(n=s(t,c)),n){const e=this.renderFeature(t,R,n,w,E,this.getLayer().getDeclutter(),i);T=T&&!e}},M=ye(y),L=i.getFeaturesInExtent(M);m&&L.sort(m);for(let t=0,e=L.length;t=200&&a.status<300){const t=e.getType();try{let n;"text"==t||"json"==t?n=a.responseText:"xml"==t?n=a.responseXML||a.responseText:"arraybuffer"==t&&(n=a.response),n?r(e.readFeatures(n,{extent:i,featureProjection:s}),e.readProjection(n)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function Kp(t,e){return function(i,n,s,r,o){Up(t,e,i,n,s,(t,e)=>{this.addFeatures(t),void 0!==r&&r(t)},()=>{this.changed(),void 0!==o&&o()})}}function Hp(t,e){return[[-1/0,-1/0,1/0,1/0]]}const qp=[1,0,0,1,0,0];class $p{constructor(t,e,i,n,s,r){this.styleFunction,this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=n,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?v(this.flatCoordinates_):S(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=P(this.getExtent());this.flatInteriorPoints_=Ys(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=$s(this.flatCoordinates_,this.ends_),e=qu(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=js(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=ju(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const i=this.ends_;for(let n=0,s=i.length;n{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":i.length=Ms(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),n=[i.length];break;case"MultiLineString":n=[],i.length=Ls(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,n);break;case"Polygon":n=[],i.length=As(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,n)}return n&&(this.simplifiedGeometry_=new $p(this.type_,i,n,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}$p.prototype.getFlatCoordinates=$p.prototype.getOrientedFlatCoordinates;const Jp=$p,Qp=class{constructor(t){this.rbush_=new Go(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[o(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,s=e.length;n{e||(e=!0,this.addFeature(t.element),e=!1)}),t.addEventListener(ur,t=>{e||(e=!0,this.removeFeature(t.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const t in this.featureChangeKeys_)this.featureChangeKeys_[t].forEach(Ai);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(t=>{this.removeFeatureInternal(t)});for(const t in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[t])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new nf("clear");this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(i){const n=i.getGeometry();if(n instanceof Jp||n.intersectsCoordinate(t))return e(i)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){const n=i.getGeometry();if(n instanceof Jp||n.intersectsExtent(t)){const t=e(i);if(t)return t}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),bi(this.nullGeometryFeatures_)||vi(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const i=B(t,e);return[].concat(...i.map(t=>this.featuresRtree_.getInExtent(t)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let s=null;const r=[NaN,NaN];let o=1/0;const a=[-1/0,-1/0,1/0,1/0];return e=e||wi,this.featuresRtree_.forEachInExtent(a,function(t){if(e(t)){const e=t.getGeometry(),l=o;if(o=e instanceof Jp?0:e.closestPointXY(i,n,r,o),o{--this.loadingExtentsCount_,this.dispatchEvent(new nf("featuresloadend",void 0,t))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new nf("featuresloaderror"))}),n.insert(r,{extent:r.slice()}))}this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_,i=e.forEachInExtent(t,function(e){if(w(e.extent,t))return e});i&&e.remove(i)}removeFeatures(t){let e=!1;for(let i=0,n=t.length;it.getMaxZoom()&&(l=t.getMaxZoom()),t.moveTo([a[0],a[1]],l,r)}else t.zoomToExtent(a,r)}t.selectFeature(o)}}else t.selectFeature(null)},getSelectedFeaturePos:function(){return t.getSelectedFeaturePos()},getSelectedFeatureProps:function(e){var i=t.getSelectedFeatureProps(e);return i&&i.id&&(i=this.getFeaturePropsByID(i.id)),i},featureHasPos:function(t){var e=f.getSource().getFeatureById(t);if(e&&e.getGeometry()&&e.getGeometry().getExtent()){var i=e.getGeometry().getExtent();return 0!=i[0]||0!=i[1]}return!1},setFeatureSelected:function(t,e){var i=f.getSource().getFeatureById(t);i&&i.setSelected(e)},setFeatureVisible:function(t,e){void 0===e&&(e=!0);var i=f.getSource().getFeatureById(t);i&&i.setVisible(e)},setFeatureSelectable:function(t,e){var i=f.getSource().getFeatureById(t);i&&i.setSelectable(e)},zoomToFeatureBounds:function(e,i){i=null==i?500:i;var n=f.getSource().getFeatureById(e);if(n){var s=n.getGeometry().getExtent();t.zoomToExtent(s,i)}},getMapOptions:function(t){var e=f.getSource().getFeatureById(t);return e?e.getMapOptions():null},setMapOptions:function(t,e){var i=f.getSource().getFeatureById(t);i&&i.setMapOptions(e)},redraw:function(){f.changed()},getAttribution:function(t){return f.getSource().getAttributions()},setAttribution:function(t){f.getSource().setAttributions([t])},setToolTipFunction:function(t){m=t},getToolTipFunction:function(){return m},setAssociatedLayer:function(t){y=t},getAssociatedLayer:function(){return y},associateWithLayer:function(t){y=t,t.setAssociatedLayer(v)},setVisible:function(t){f.setVisible(t)},set:function(t,e,i){f.set(t,e,i)},drawMostRelevant:function(e,i,s){if(0!=v.size()){var r=n().maps.Style.scaleLabelSize(i,t.getZoom()),o=t.getSize()[0],a=t.getSize()[1],l=Math.ceil(o/(28*r)),h=Math.ceil(a/(9*r)),c=t.getBounds();if(c){var u=c[0],g=c[1],p=c[2],m=c[3];u>p&&(Math.abs(u)>Math.abs(p)?u=-20037508.34:p=20037508.34);var _=v.getBounds(),y=_[0],x=_[1],S=_[2]+1,w=_[3]+1;if(y>u||SC&&(l=Math.ceil(o*(N-C)/(p-u)/(28*r))),u=C,p=N}(x>g||wC&&(h=Math.ceil(a*(N-C)/(m-g)/(9*r))),g=C,m=N);for(var E=(p-u)/(l-1e-4),R=(m-g)/(h-1e-4),T=new Array(l),b=0;b=0;b--){var P=f.array[b].getBounds(),A=Math.floor((P[0]-u)/E),F=Math.floor((P[1]-g)/R);A>=0&&F>=0&&A2){var D=T[b][M].getBounds(),k=2,G=[];if((D[2]-D[0])*(D[3]-D[1])k;){var N;(N=T[b][M][T[b][M].length-1]).isSelected()?(G.push(T[b][M].pop()),k--):I.push(T[b][M].pop())}if(G.length>0)for(var z=0;z0)for(b=0;b(i.maxViz?i.maxViz:13)?null:t<=2?"R2":t<=4?"R4":t<=6?"R6":t<=8?"R8":t<=10?"R10":"R12"}:function(t,e){return e?t<=(i.minViz?i.minViz:2)?null:t<=4?"R5":t<=6?"R4":t<=8?"R3":t<=9?"R2":t<=(i.maxViz?i.maxViz:13)?"R1":null:null};function y(){if(!n().isBot()){var e=t.getBounds(),s=t.getZoom(),o=_(s,g);r&&r(o);var a=l;if(l!=o&&(o&&u[o].setVisible(!0),l=o),o){for(var d=i.useFb?i.fbdist[o]:i.dist[o],p=ge(e,t.getProj(),i.proj),f=Math.floor(p[0]/d),m=Math.floor(p[1]/d),y=Math.floor(p[2]/d),v=Math.floor(p[3]/d),S=[],w=[],C=Date.now(),E=p[0],R=!1,T=f;T<=y;T++){var b=T;b*d>=180&&(R||(E=-E,T--,y++,R=!0),b=Math.floor(E/d),b++);for(var M=m;M<=v;M++)h[o][b+"_"+M]||c[o][b+"_"+M]&&!(C-c[o][b+"_"+M]>5e3)||(c[o][b+"_"+M]=C,S.push(b),w.push(M),S.length>=i.maxReq&&(x(o,S,w),S=[],w=[]));E+=d}S.length>0&&x(o,S,w)}a!=l&&a&&setTimeout(function(){a!=l&&u[a].setVisible(!1)},i.vizDelay)}}function x(t,s,r){if(i.useFb)return void(n().fbdb&&function(t,s,r){let o=[],a={};for(let t=0;t0){let e={objs:[],res:1e4};s.forEach(function(n){let s=null,r=n.data().c;for(let t=0;t0&&(i.tiles[e].res=i.res,u[t].addData(i.tiles[e]),o&&o(u[t]),u[t].redraw()),h[t][i.tiles[e].xi+"_"+i.tiles[e].yi]=!0}).fail(function(){n().log("cp.GridLayer.requestTiles: error for "+e+t+" at "+l+"/"+c)})}var v={start:function(){g=!0,p?y():(p=!0,y(),t.onViewChangeEnd?t.onViewChangeEnd(y):t.onViewChange(y))},setVisible:function(t){g=t,p&&y()},setMode:function(t){var e=i.useFb?i.fbdist:i.dist;for(var n in e)u[n].setMode(t)},setZoomToLevel:function(t){_=t,p&&y()},isGridLayer:!0};return v},n().maps.GridLayer;const rf={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},of={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]},af=class extends Uc{constructor(t,e){super(t,e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=[1,0,0,1,0,0],this.tileClipContexts_=null}drawTile(t,e,i,n,s,r,o,a){this.updateExecutorGroup_(t,e.pixelRatio,e.viewState.projection),this.tileImageNeedsRender_(t)&&this.renderTileImage_(t,e),super.drawTile(t,e,i,n,s,r,o,a)}getTile(t,e,i,n){const s=this.getOrCreateTile(t,e,i,n);if(!s)return null;const r=n.viewState.resolution,o=n.viewHints;return!(!o[0]&&!o[1])&&s.wantedResolution||(s.wantedResolution=r),s}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!==e&&(this.renderedLayerRevision_=e,this.renderedTiles.length=0),super.prepareFrame(t)}updateExecutorGroup_(t,e,i){const n=this.getLayer(),s=n.getRevision(),r=n.getRenderOrder()||null,a=t.wantedResolution,l=t.getReplayState(n);if(!l.dirty&&l.renderedResolution===a&&l.renderedRevision==s&&l.renderedRenderOrder==r)return;const h=n.getSource(),c=!!n.getDeclutter(),d=h.getTileGrid(),g=h.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),p=h.getSourceTiles(e,i,t),f=o(n);delete t.hitDetectionImageData[f],t.executorGroups[f]=[],l.dirty=!1;for(let i=0,s=p.length;it.value):null;let x;t:for(let e=0,n=f.length;e{const n=this.getLayer(),s=n.getSource(),r=this.renderedProjection,a=r.getExtent(),l=this.renderedResolution,h=s.getTileGridForProjection(r),c=ns(this.renderedPixelToCoordinateTransform_,t.slice()),u=h.getTileCoordForCoordAndResolution(c,l).toString(),d=this.renderedTiles.find(t=>t.tileCoord.toString()===u&&2===t.getState());if(!d||d.loadingSourceTiles>0)return void e([]);s.getWrapX()&&r.canWrapX()&&!f(a,h.getTileCoordExtent(d.tileCoord))&<(c,r);const g=o(n),p=G(h.getTileCoordExtent(d.wrappedTileCoord)),m=[(c[0]-p[0])/l,(p[1]-c[1])/l],_=d.getSourceTiles().reduce((t,e)=>t.concat(e.getFeatures()),[]);let y=d.hitDetectionImageData[g];if(!y){const t=Sn(h.getTileSize(h.getZForResolution(l,s.zDirection))),e=this.renderedRotation_;y=Gp(t,[this.getRenderTransform(h.getTileCoordCenter(d.wrappedTileCoord),l,0,kp,t[0]*kp,t[1]*kp,0)],_,n.getStyleFunction(),h.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(n).renderedResolution,e),d.hitDetectionImageData[g]=y}e(Np(m,_,y))})}getFeaturesInExtent(t){const e=[],i=this.getTileCache();if(0===i.getCount())return e;const n=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),s=n.getZForResolution(this.renderedResolution),r={};return i.forEach(i=>{if(i.tileCoord[0]!==s||2!==i.getState())return;const o=i.getSourceTiles();for(let i=0,s=o.length;i=0;--e)n[e].execute(this.context,a,this.getTileRenderTransform(i,t),t.viewState.rotation,r,Pp,h)}i.globalAlpha=n}renderDeferredInternal(t){const e=this.renderedTiles,i=o(this.getLayer()),n=e.reduce((t,e,n)=>(e.executorGroups[i].forEach(e=>t.push({executorGroup:e,index:n})),t),[]),s=n.map(({executorGroup:t})=>t.getDeferredZIndexContexts()),r={};for(let t=0,e=n.length;t{s.forEach((e,i)=>{e[t]&&(e[t].forEach(t=>{const{executorGroup:e,index:s}=n[i],r=e.getRenderedContext(),o=r.globalAlpha;r.globalAlpha=this.renderedOpacity_;const a=this.tileClipContexts_[s];a&&a.draw(r),t.draw(r),a&&r.restore(),r.globalAlpha=o,t.clear()}),e[t].length=0)})})}getTileRenderTransform(t,e){const i=e.pixelRatio,n=e.viewState,s=n.center,r=n.resolution,o=n.rotation,a=e.size,l=Math.round(a[0]*i),h=Math.round(a[1]*i),c=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),u=t.tileCoord,d=c.getTileCoordExtent(t.wrappedTileCoord),g=c.getTileCoordExtent(u,this.tempExtent)[0]-d[0];return es(ss(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,r,o,i,l,h,g))}postRender(t,e){const i=e.viewHints,n=!(i[0]||i[1]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation,this.renderedOpacity_=e.layerStatesArray[e.layerIndex].opacity;const s=this.getLayer(),r=s.getRenderMode(),a=t.globalAlpha;t.globalAlpha=this.renderedOpacity_;const l=s.getDeclutter(),h=l?of[r].filter(t=>!Pp.includes(t)):of[r],c=e.viewState,u=c.rotation,d=s.getSource(),g=d.getTileGridForProjection(c.projection).getZForResolution(c.resolution,d.zDirection),p=this.renderedTiles,f=[],m=[],_=[],y=o(s);let x=!0;for(let i=p.length-1;i>=0;--i){const r=p[i];x=x&&!r.getReplayState(s).dirty;const o=r.executorGroups[y].filter(t=>t.hasExecutors(h));if(0===o.length)continue;const a=this.getTileRenderTransform(r,e),c=r.tileCoord[0];let d=!1;const v=o[0].getClipCoords(a);let S,w=t;if(v){S=new Nc,w=S.getContext();for(let t=0,e=f.length;t{const s=this.tileUrlFunction(n,t,e);this.sourceTiles_[s]||(this.sourceTiles_[s]=new this.tileClass(n,s?0:4,s,this.format_,this.tileLoadFunction));const r=this.sourceTiles_[s];i.sourceTiles.push(r),this.tileKeysBySourceTileUrl_[s]||(this.tileKeysBySourceTileUrl_[s]=[]),this.tileKeysBySourceTileUrl_[s].push(i.getKey());const o=r.getState();if(o<2){const t=e=>{this.handleTileChange(e);const n=r.getState();if(2===n||3===n){const e=r.getKey();e in i.errorTileKeys?2===r.getState()&&delete i.errorTileKeys[e]:i.loadingSourceTiles--,3===n?i.errorTileKeys[e]=!0:r.removeEventListener(li,t),0===i.loadingSourceTiles&&i.setState(bi(i.errorTileKeys)?2:3)}};r.addEventListener(li,t),i.loadingSourceTiles++}0===o&&(r.extent=l.getTileCoordExtent(n),r.projection=e,r.resolution=l.getResolution(n[0]),r.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(t=>3===t.getState())?3:2)}return i.sourceTiles}removeSourceTiles(t){const e=t.getKey(),i=t.sourceTiles;for(let t=0,n=i.length;t{h=h&&!this.tileUrlFunction(t,n,s)})}const c=new cf(r,h?4:0,o,this.getSourceTiles.bind(this,n,s),this.removeSourceTiles.bind(this));return c.key=this.getKey(),c}getTileGridForProjection(t){const e=t.getCode();let i=this.tileGrids_[e];if(!i){const n=this.getProjection();Te(null===n||le(n,t),"A VectorTile source can only be rendered if it has a projection compatible with the view projection.");const s=this.tileGrid,r=s.getResolutions().slice(),o=r.map(function(t,e){return s.getOrigin(e)}),a=r.map(function(t,e){return s.getTileSize(e)}),l=43;for(let t=r.length;t>3,s=this.pos;this.type=7&i,t(n,e,this),this.pos===s&&this.skip(i)}return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*pf;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*pf;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const e=this.buf;let i,n;return n=e[this.pos++],i=127&n,n<128?i:(n=e[this.pos++],i|=(127&n)<<7,n<128?i:(n=e[this.pos++],i|=(127&n)<<14,n<128?i:(n=e[this.pos++],i|=(127&n)<<21,n<128?i:(n=e[this.pos],i|=(15&n)<<28,function(t,e,i){const n=i.buf;let s,r;if(r=n[i.pos++],s=(112&r)>>4,r<128)return yf(t,s,e);if(r=n[i.pos++],s|=(127&r)<<3,r<128)return yf(t,s,e);if(r=n[i.pos++],s|=(127&r)<<10,r<128)return yf(t,s,e);if(r=n[i.pos++],s|=(127&r)<<17,r<128)return yf(t,s,e);if(r=n[i.pos++],s|=(127&r)<<24,r<128)return yf(t,s,e);if(r=n[i.pos++],s|=(1&r)<<31,r<128)return yf(t,s,e);throw new Error("Expected varint not more than 10 bytes")}(i,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return Boolean(this.readVarint())}readString(){const t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&mf?mf.decode(this.buf.subarray(e,t)):function(t,e,i){let n="",s=e;for(;s239?4:e>223?3:e>191?2:1;if(s+h>i)break;1===h?e<128&&(l=e):2===h?(r=t[s+1],128==(192&r)&&(l=(31&e)<<6|63&r,l<=127&&(l=null))):3===h?(r=t[s+1],o=t[s+2],128==(192&r)&&128==(192&o)&&(l=(15&e)<<12|(63&r)<<6|63&o,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===h&&(r=t[s+1],o=t[s+2],a=t[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&(l=(15&e)<<18|(63&r)<<12|(63&o)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,h=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),s+=h}return n}(this.buf,e,t)}readBytes(){const t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){const i=this.readPackedEnd();for(;this.pos127;);else if(2===e)this.pos=this.readVarint()+this.pos;else if(5===e)this.pos+=4;else{if(1!==e)throw new Error(`Unimplemented type: ${e}`);this.pos+=8}}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e268435455||t<0?function(t,e){let i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),4294967295^i?i=i+1|0:(i=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){const i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const e=this.pos;this.pos=function(t,e,i){for(let n,s,r=0;r55295&&n<57344){if(!s){n>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):s=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,s=n;continue}n=s-55296<<10|n-56320|65536,s=null}else s&&(t[i++]=239,t[i++]=191,t[i++]=189,s=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);const i=this.pos-e;i>=128&&xf(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const e=t.length;this.writeVarint(e),this.realloc(e);for(let i=0;i=128&&xf(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}writeMessage(t,e,i){this.writeTag(t,2),this.writeRawMessage(e,i)}writePackedVarint(t,e){e.length&&this.writeMessage(t,vf,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,Sf,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,Ef,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,wf,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,Cf,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,Rf,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Tf,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,bf,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,Mf,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}}function yf(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function xf(t,e,i){const n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(let e=i.pos-1;e>=t;e--)i.buf[e+n]=i.buf[e]}function vf(t,e){for(let i=0;i>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(n)}}function Pf(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t){const t=i.readVarint()+i.pos;for(;i.pos>3}if(o--,1===r||2===r)a+=t.readSVarint(),l+=t.readSVarint(),1===r&&h>c&&(n.push(h),c=h),i.push(a,l),h+=2;else{if(7!==r)throw new Error("Invalid command found in the PBF");h>c&&(i.push(i[c],i[c+1]),h+=2)}}h>c&&(n.push(h),c=h)}createFeature_(t,e,i){const n=e.type;if(0===n)return null;let s;const r=e.properties;let o;this.idProperty_?(o=r[this.idProperty_],delete r[this.idProperty_]):o=e.id,r[this.layerName_]=e.layer.name;const a=[],l=[];this.readRawGeometry_(t,e,a,l);const h=function(t,e){let i;return 1===t?i=1===e?"Point":"MultiPoint":2===t?i=1===e?"LineString":"MultiLineString":3===t&&(i="Polygon"),i}(n,l.length);if(this.featureClass===Jp)s=new this.featureClass(h,a,l,2,r,o),s.transform(i.dataProjection);else{let t;if("Polygon"==h){const e=$s(a,l);t=e.length>1?new Ju(a,"XY",e):new Qs(a,"XY",l)}else t="Point"===h?new ks(a,"XY"):"LineString"===h?new Zu(a,"XY"):"MultiPoint"===h?new Hu(a,"XY"):"MultiLineString"===h?new Uu(a,"XY",l):null;s=new(0,this.featureClass),this.geometryName_&&s.setGeometryName(this.geometryName_);const e=td(t,!1,i);s.setGeometry(e),void 0!==o&&s.setId(o),s.setProperties(r,!0)}return s}getType(){return"arraybuffer"}readFeatures(t,e){const i=this.layers_,n=se((e=this.adaptOptions(e)).dataProjection);n.setWorldExtent(e.extent),e.dataProjection=n;const s=new _f(t),r=s.readFields(Lf,{}),o=[];for(const t in r){if(i&&!i.includes(t))continue;const a=r[t],l=a?[0,0,a.extent,a.extent]:null;n.setExtent(l);for(let t=0,i=a.length;t
  • Deutschland Städte

    Die größten Städte

    Die deutschen Bundesländer und alle Städte mit mehr als 50.000 Einwohnern.

    Schätzung/Zensus 1990, 2001, 2011, 2022, 2024

  • Deutschland Verwaltungsgliederung

    Verwaltungsgliederung

    Die Einwohnerzahlen der Bundesländer und Kreise in Deutschland.

    Schätzung/Zensus 1990, 2001, 2011, 2022, 2024

  • Deutschland Urbane Gebiete

    Urbane Gebiete

    Alle urbanen Gebiete in Deutschland mit mehr als 15.000 Einwohnern.

    Zensus 2011, 2022, Schätzung 2024

  • Deutschland Zensusergebnisse

    Zensusbevölkerung

    Die Bundesländer sowie alle Städte und Gemeinden mit mehr als 7.500 Einwohnern.

    Zensus 1970, 1987, 2011, 2022

  • Top 10 Städte in Deutschland

    Top 10 Cities

    Die Top-10-Städte Deutschlands und der deutschen Bundesländer (englisch).

    Schätzung 2024

  • Suche
  • Bundesländer

    • Kreise: alle Kreise des Bundeslandes – Schätzung/Zensus 1990, 2001, 2011, 2022, 2024
    • Größere & mittlere Städte: Städte und Gemeinden mit mehr als 15.000 Einwohnern – Schätzung/Zensus 1990, 2001, 2011, 2022, 2024
    • Alle Städte & Gemeinden: alle Städte und Gemeinden des Bundeslandes – Schätzung/Zensus 1990, 2001, 2011, 2022, 2024
    • Siedlungen: Siedlungen mit mehr als 300 Einwohnern – Zensus 2011, 2022
    • Urbane Gebiete: urbane Gebiete mit mehr als 2.500 Einwohnern – Zensus 2011, 2022, Schätzung 2024

    Städte: Bezirke und Stadtteile