mapicgc-gl-js 0.0.53 → 0.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mapicgc-gl.js
CHANGED
|
@@ -3153,7 +3153,7 @@ end`};e.events.push(["putFont",function(o){(function(l){var s=l.font,g=l.out,v=l
|
|
|
3153
3153
|
xml:space="preserve">
|
|
3154
3154
|
<image style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;"
|
|
3155
3155
|
xlink:href="${r}" width="${n}" height="${o}"></image>
|
|
3156
|
-
</svg>`,s=document.createElement("a");s.href=`data:application/xml,${encodeURIComponent(l)}`,s.download=t,s.click(),s.remove()}toPixels(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:96;return this.unit===Hy.mm&&(t/=25.4),`${t*e}px`}toBlob(e){const t=atob(e.replace(/^.*,/,"")),r=new Uint8Array(t.length);for(let n=0;n<t.length;n+=1)r[n]=t.charCodeAt(n);return new Blob([r.buffer],{type:"image/png"})}},Ire=class{constructor(e){Is(this,"map"),Is(this,"width"),Is(this,"height"),Is(this,"unit"),Is(this,"svgCanvas"),Is(this,"svgPath");var t,r,n;if(this.map=e,this.map===void 0)return;this.mapResize=this.mapResize.bind(this),this.map.on("resize",this.mapResize);const o=(t=this.map)==null?void 0:t.getCanvas().clientWidth,l=(r=this.map)==null?void 0:r.getCanvas().clientHeight,s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.setAttribute("width",`${o}px`),s.setAttribute("height",`${l}px`);const g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("style","fill:#888888;stroke-width:0"),g.setAttribute("fill-opacity","0.5"),s.append(g),(n=this.map)==null||n.getCanvasContainer().appendChild(s),this.svgCanvas=s,this.svgPath=g}mapResize(){this.generateCutOut()}updateArea(e,t){this.width=e,this.height=t,this.unit=Hy.mm,this.generateCutOut()}generateCutOut(){var e,t;if(this.map===void 0||this.svgCanvas===void 0||this.svgPath===void 0)return;const r=this.toPixels(this.width),n=this.toPixels(this.height),o=(e=this.map)==null?void 0:e.getCanvas().clientWidth,l=(t=this.map)==null?void 0:t.getCanvas().clientHeight,s=o/2-r/2,g=s+r,v=l/2-n/2,T=v+n;this.svgCanvas.setAttribute("width",`${o}px`),this.svgCanvas.setAttribute("height",`${l}px`),this.svgPath.setAttribute("d",`M 0 0 L ${o} 0 L ${o} ${l} L 0 ${l} M ${s} ${v} L ${s} ${T} L ${g} ${T} L ${g} ${v}`)}destroy(){this.svgCanvas!==void 0&&(this.svgCanvas.remove(),this.svgCanvas=void 0),this.map!==void 0&&(this.map=void 0)}toPixels(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:96;return this.unit===Hy.mm&&(t/=25.4),t*e}};const J4={PageSize:"Page Size",PageOrientation:"Page Orientation",Format:"Format",DPI:"DPI",Generate:"Generate"},Lre={PageSize:"Taille de page",PageOrientation:"Orientation de la page",Format:"Format",DPI:"DPI",Generate:"Générer"},Mre={PageSize:"Sivukoko",PageOrientation:"Sivun suunta",Format:"Muoto",DPI:"DPI",Generate:"Generoi"},Pre={PageSize:"Papierformat",PageOrientation:"Papierausrichtung",Format:"Dateiformat",DPI:"Druckauflösung",Generate:"Erstellen"},Fre={PageSize:"Sidstorlek",PageOrientation:"Sidorientering",Format:"Format",DPI:"DPI",Generate:"Generera"},Dre={PageSize:"Tamaño de página",PageOrientation:"Orientación de página",Format:"Formato",DPI:"DPI",Generate:"Generar"},Rre={PageSize:"Kích thước trang",PageOrientation:"Loại trang",Format:"Định dạng",DPI:"Mật độ điểm ảnh (DPI)",Generate:"Tạo"},kre={PageSize:"Розмір сторінки",PageOrientation:"Орієнтація сторінки",Format:"Формат",DPI:"DPI",Generate:"Згенерувати"},Ore={PageSize:"页面大小",PageOrientation:"页面方向",Format:"格式",DPI:"像素",Generate:"导出"},Ure={PageSize:"頁面大小",PageOrientation:"頁面方向",Format:"格式",DPI:"像素",Generate:"導出"},Nre={PageSize:"ページサイズ",PageOrientation:"ページ方向",Format:"フォーマット",DPI:"DPI(解像度)",Generate:"出力"};let zre=class{constructor(e){Is(this,"controlContainer"),Is(this,"exportContainer"),Is(this,"crosshair"),Is(this,"printableArea"),Is(this,"map"),Is(this,"exportButton"),Is(this,"options",{PageSize:Mg.A4,PageOrientation:Gy.Landscape,Format:bd.PDF,DPI:RC[300],Crosshair:!1,PrintableArea:!1,Local:"en",AllowedSizes:Object.keys(Mg),Filename:"map"}),e&&(this.options=Object.assign(this.options,e)),this.onDocumentClick=this.onDocumentClick.bind(this)}getDefaultPosition(){return"top-right"}getTranslation(){switch(this.options.Local){case"de":return Pre;case"en":return J4;case"fr":return Lre;case"fi":return Mre;case"sv":return Fre;case"es":return Dre;case"vi":return Rre;case"uk":return kre;case"zhHans":return Ore;case"zhHant":return Ure;case"ja":return Nre;default:return J4}}onAdd(e){var t;this.map=e,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("maplibregl-ctrl"),this.controlContainer.classList.add("maplibregl-ctrl-group"),this.exportContainer=document.createElement("div"),this.exportContainer.classList.add("maplibregl-export-list"),this.exportButton=document.createElement("button"),this.exportButton.classList.add("maplibregl-ctrl-icon"),this.exportButton.classList.add("maplibregl-export-control"),this.exportButton.type="button",this.exportButton.addEventListener("click",()=>{this.exportButton.style.display="none",this.exportContainer.style.display="block",this.toggleCrosshair(!0),this.togglePrintableArea(!0)}),document.addEventListener("click",this.onDocumentClick),this.controlContainer.appendChild(this.exportButton),this.controlContainer.appendChild(this.exportContainer);const r=document.createElement("TABLE");r.className="print-table";const n={};(t=this.options.AllowedSizes)==null||t.forEach(T=>{Mg[T]&&(n[T]=Mg[T])});const o=this.createSelection(n,this.getTranslation().PageSize,"page-size",this.options.PageSize,(T,F)=>JSON.stringify(T[F]));r.appendChild(o);const l=this.createSelection(Gy,this.getTranslation().PageOrientation,"page-orientation",this.options.PageOrientation,(T,F)=>T[F]);r.appendChild(l);const s=this.createSelection(bd,this.getTranslation().Format,"format-type",this.options.Format,(T,F)=>T[F]);r.appendChild(s);const g=this.createSelection(RC,this.getTranslation().DPI,"dpi-type",this.options.DPI,(T,F)=>T[F]);r.appendChild(g),this.exportContainer.appendChild(r);const v=document.createElement("button");return v.type="button",v.textContent=this.getTranslation().Generate,v.classList.add("generate-button"),v.addEventListener("click",()=>{const T=document.getElementById("mapbox-gl-export-page-size"),F=document.getElementById("mapbox-gl-export-page-orientation"),R=document.getElementById("mapbox-gl-export-format-type"),U=document.getElementById("mapbox-gl-export-dpi-type"),J=F.value;let te=JSON.parse(T.value);J===Gy.Portrait&&(te=te.reverse()),new Tre(e,te,Number(U.value),R.value,Hy.mm,this.options.Filename).generate()}),this.exportContainer.appendChild(v),this.controlContainer}createSelection(e,t,r,n,o){const l=document.createElement("label");l.textContent=t;const s=document.createElement("select");s.setAttribute("id",`mapbox-gl-export-${r}`),s.style.width="100%",Object.keys(e).forEach(F=>{const R=document.createElement("option");R.setAttribute("value",o(e,F)),R.appendChild(document.createTextNode(F)),R.setAttribute("name",r),n===e[F]&&(R.selected=!0),s.appendChild(R)}),s.addEventListener("change",()=>{this.updatePrintableArea()});const g=document.createElement("TR"),v=document.createElement("TD"),T=document.createElement("TD");return v.appendChild(l),T.appendChild(s),g.appendChild(v),g.appendChild(T),g}onRemove(){!this.controlContainer||!this.controlContainer.parentNode||!this.map||!this.exportButton||(this.exportButton.removeEventListener("click",this.onDocumentClick),this.controlContainer.parentNode.removeChild(this.controlContainer),document.removeEventListener("click",this.onDocumentClick),this.crosshair!==void 0&&(this.crosshair.destroy(),this.crosshair=void 0),this.map=void 0)}onDocumentClick(e){this.controlContainer&&!this.controlContainer.contains(e.target)&&this.exportContainer&&this.exportButton&&(this.exportContainer.style.display="none",this.exportButton.style.display="block",this.toggleCrosshair(!1),this.togglePrintableArea(!1))}toggleCrosshair(e){this.options.Crosshair===!0&&(e===!1?this.crosshair!==void 0&&(this.crosshair.destroy(),this.crosshair=void 0):(this.crosshair=new Lie(this.map),this.crosshair.create()))}togglePrintableArea(e){this.options.PrintableArea===!0&&(e===!1?this.printableArea!==void 0&&(this.printableArea.destroy(),this.printableArea=void 0):(this.printableArea=new Ire(this.map),this.updatePrintableArea()))}updatePrintableArea(){if(this.printableArea===void 0)return;const e=document.getElementById("mapbox-gl-export-page-size"),t=document.getElementById("mapbox-gl-export-page-orientation").value;let r=JSON.parse(e.value);t===Gy.Portrait&&(r=r.reverse()),this.printableArea.updateArea(r[0],r[1])}};var Y4=Vre,Qre=Object.prototype.hasOwnProperty;function Vre(){for(var i={},e=0;e<arguments.length;e++){var t=arguments[e];for(var r in t)Qre.call(t,r)&&(i[r]=t[r])}return i}var eD={exports:{}};(function(i,e){(function(){var t={};i.exports=t,t.simpleFilter=function(r,n){return n.filter(function(o){return t.test(r,o)})},t.test=function(r,n){return t.match(r,n)!==null},t.match=function(r,n,o){o=o||{};var l=0,s=[],g=n.length,v=0,T=0,F=o.pre||"",R=o.post||"",U=o.caseSensitive&&n||n.toLowerCase(),J;r=o.caseSensitive&&r||r.toLowerCase();for(var te=0;te<g;te++)J=n[te],U[te]===r[l]?(J=F+J+R,l+=1,T+=1+T):T=0,v+=T,s[s.length]=J;return l===r.length?(v=U===r?1/0:v,{rendered:s.join(""),score:v}):null},t.filter=function(r,n,o){return!n||n.length===0?[]:typeof r!="string"?n:(o=o||{},n.reduce(function(l,s,g,v){var T=s;o.extract&&(T=o.extract(s));var F=t.match(r,T,o);return F!=null&&(l[l.length]={string:F.rendered,score:F.score,index:g,original:s}),l},[]).sort(function(l,s){var g=s.score-l.score;return g||l.index-s.index}))}})()})(eD);var Hre=eD.exports,Rc=function(i){return this.component=i,this.items=[],this.active=i.options.noInitialSelection?-1:0,this.wrapper=document.createElement("div"),this.wrapper.className="suggestions-wrapper",this.element=document.createElement("ul"),this.element.className="suggestions",this.wrapper.appendChild(this.element),this.selectingListItem=!1,i.el.parentNode.insertBefore(this.wrapper,i.el.nextSibling),this};Rc.prototype.show=function(){this.element.style.display="block"},Rc.prototype.hide=function(){this.element.style.display="none"},Rc.prototype.add=function(i){this.items.push(i)},Rc.prototype.clear=function(){this.items=[],this.active=this.component.options.noInitialSelection?-1:0},Rc.prototype.isEmpty=function(){return!this.items.length},Rc.prototype.isVisible=function(){return this.element.style.display==="block"},Rc.prototype.draw=function(){if(this.element.innerHTML="",this.items.length===0){this.hide();return}for(var i=0;i<this.items.length;i++)this.drawItem(this.items[i],this.active===i);this.show()},Rc.prototype.drawItem=function(i,e){var t=document.createElement("li"),r=document.createElement("a");e&&(t.className+=" active"),r.innerHTML=i.string,t.appendChild(r),this.element.appendChild(t),t.addEventListener("mousedown",(function(){this.selectingListItem=!0}).bind(this)),t.addEventListener("mouseup",(function(){this.handleMouseUp.call(this,i)}).bind(this))},Rc.prototype.handleMouseUp=function(i){this.selectingListItem=!1,this.component.value(i.original),this.clear(),this.draw()},Rc.prototype.move=function(i){this.active=i,this.draw()},Rc.prototype.previous=function(){this.move(this.active<=0?this.items.length-1:this.active-1)},Rc.prototype.next=function(){this.move(this.active>=this.items.length-1?0:this.active+1)},Rc.prototype.drawError=function(i){var e=document.createElement("li");e.innerHTML=i,this.element.appendChild(e),this.show()};var Gre=Rc,jre=Y4,qre=Hre,$re=Gre,Rl=function(i,e,t){return t=t||{},this.options=jre({minLength:2,limit:5,filter:!0,hideOnBlur:!0,noInitialSelection:!0},t),this.el=i,this.data=e||[],this.list=new $re(this),this.query="",this.selected=null,this.list.draw(),this.el.addEventListener("keyup",(function(r){this.handleKeyUp(r.keyCode,r)}).bind(this),!1),this.el.addEventListener("keydown",(function(r){this.handleKeyDown(r)}).bind(this)),this.el.addEventListener("focus",(function(){this.handleFocus()}).bind(this)),this.el.addEventListener("blur",(function(){this.handleBlur()}).bind(this)),this.el.addEventListener("paste",(function(r){this.handlePaste(r)}).bind(this)),this.render=this.options.render?this.options.render.bind(this):this.render.bind(this),this.getItemValue=this.options.getItemValue?this.options.getItemValue.bind(this):this.getItemValue.bind(this),this};Rl.prototype.handleKeyUp=function(i,e){if(!(i===40||i===38||i===27||i===9)){if(i===13){this.list.items[this.list.active]&&(this.list.handleMouseUp(this.list.items[this.list.active]),e.stopPropagation());return}this.handleInputChange(this.el.value)}},Rl.prototype.handleKeyDown=function(i){switch(i.keyCode){case 13:this.list.active>=0&&(this.list.selectingListItem=!0);break;case 9:this.list.isEmpty()||(this.list.isVisible()&&i.preventDefault(),this.value(this.list.active>=0?this.list.items[this.list.active].original:null),this.list.hide());break;case 27:this.list.isEmpty()||this.list.hide();break;case 38:this.list.previous();break;case 40:this.list.next();break}},Rl.prototype.handleBlur=function(){!this.list.selectingListItem&&this.options.hideOnBlur&&this.list.hide()},Rl.prototype.handlePaste=function(i){if(i.clipboardData)this.handleInputChange(i.clipboardData.getData("Text"));else{var e=this;setTimeout(function(){e.handleInputChange(i.target.value)},100)}},Rl.prototype.handleInputChange=function(i){if(this.query=this.normalize(i),this.list.clear(),this.query.length<this.options.minLength){this.list.draw();return}this.getCandidates((function(e){for(var t=0;t<e.length&&(this.list.add(e[t]),t!==this.options.limit-1);t++);this.list.draw()}).bind(this))},Rl.prototype.handleFocus=function(){this.list.isEmpty()||this.list.show(),this.list.selectingListItem=!1},Rl.prototype.update=function(i){this.data=i,this.handleKeyUp()},Rl.prototype.clear=function(){this.data=[],this.list.clear()},Rl.prototype.normalize=function(i){return i=i.toLowerCase(),i},Rl.prototype.match=function(i,e){return i.indexOf(e)>-1},Rl.prototype.value=function(i){if(this.selected=i,this.el.value=this.getItemValue(i||{place_name:this.query}),document.createEvent){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.el.dispatchEvent(e)}else this.el.fireEvent("onchange")},Rl.prototype.getCandidates=function(i){var e={pre:"<strong>",post:"</strong>",extract:(function(r){return this.getItemValue(r)}).bind(this)},t;this.options.filter?(t=qre.filter(this.query,this.data,e),t=t.map((function(r){return{original:r.original,string:this.render(r.original,r.string)}}).bind(this))):t=this.data.map((function(r){var n=this.render(r);return{original:r,string:n}}).bind(this)),i(t)},Rl.prototype.getItemValue=function(i){return i},Rl.prototype.render=function(i,e){if(e)return e;for(var t=i.original?this.getItemValue(i.original):this.getItemValue(i),r=this.normalize(t),n=r.lastIndexOf(this.query);n>-1;){var o=n+this.query.length;t=t.slice(0,n)+"<strong>"+t.slice(n,o)+"</strong>"+t.slice(o),n=r.slice(0,n).lastIndexOf(this.query)}return t},Rl.prototype.renderError=function(i){this.list.drawError(i)};var Kre=Rl,tD=Kre,Wre=tD;typeof window<"u"&&(window.Suggestions=tD);var Zre="Expected a function",iD=NaN,Xre="[object Symbol]",Jre=/^\s+|\s+$/g,Yre=/^[-+]0x[0-9a-f]+$/i,ene=/^0b[01]+$/i,tne=/^0o[0-7]+$/i,ine=parseInt,rne=typeof cf=="object"&&cf&&cf.Object===Object&&cf,nne=typeof self=="object"&&self&&self.Object===Object&&self,sne=rne||nne||Function("return this")(),one=Object.prototype,ane=one.toString,lne=Math.max,cne=Math.min,kC=function(){return sne.Date.now()};function une(i,e,t){var r,n,o,l,s,g,v=0,T=!1,F=!1,R=!0;if(typeof i!="function")throw new TypeError(Zre);e=rD(e)||0,OC(t)&&(T=!!t.leading,F="maxWait"in t,o=F?lne(rD(t.maxWait)||0,e):o,R="trailing"in t?!!t.trailing:R);function U(je){var We=r,Ne=n;return r=n=void 0,v=je,l=i.apply(Ne,We),l}function J(je){return v=je,s=setTimeout(he,e),T?U(je):l}function te(je){var We=je-g,Ne=je-v,at=e-We;return F?cne(at,o-Ne):at}function Ae(je){var We=je-g,Ne=je-v;return g===void 0||We>=e||We<0||F&&Ne>=o}function he(){var je=kC();if(Ae(je))return pe(je);s=setTimeout(he,te(je))}function pe(je){return s=void 0,R&&r?U(je):(r=n=void 0,l)}function be(){s!==void 0&&clearTimeout(s),v=0,r=g=n=s=void 0}function Te(){return s===void 0?l:pe(kC())}function qe(){var je=kC(),We=Ae(je);if(r=arguments,n=this,g=je,We){if(s===void 0)return J(g);if(F)return s=setTimeout(he,e),U(g)}return s===void 0&&(s=setTimeout(he,e)),l}return qe.cancel=be,qe.flush=Te,qe}function OC(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function hne(i){return!!i&&typeof i=="object"}function Ane(i){return typeof i=="symbol"||hne(i)&&ane.call(i)==Xre}function rD(i){if(typeof i=="number")return i;if(Ane(i))return iD;if(OC(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=OC(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Jre,"");var t=ene.test(i);return t||tne.test(i)?ine(i.slice(2),t?2:8):Yre.test(i)?iD:+i}var dne=une,UC={exports:{}},Pg=typeof Reflect=="object"?Reflect:null,nD=Pg&&typeof Pg.apply=="function"?Pg.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},cv;Pg&&typeof Pg.ownKeys=="function"?cv=Pg.ownKeys:Object.getOwnPropertySymbols?cv=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:cv=function(e){return Object.getOwnPropertyNames(e)};function fne(i){console&&console.warn&&console.warn(i)}var sD=Number.isNaN||function(e){return e!==e};function xs(){xs.init.call(this)}UC.exports=xs,UC.exports.once=yne,xs.EventEmitter=xs,xs.prototype._events=void 0,xs.prototype._eventsCount=0,xs.prototype._maxListeners=void 0;var oD=10;function uv(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(xs,"defaultMaxListeners",{enumerable:!0,get:function(){return oD},set:function(i){if(typeof i!="number"||i<0||sD(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");oD=i}}),xs.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},xs.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||sD(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function aD(i){return i._maxListeners===void 0?xs.defaultMaxListeners:i._maxListeners}xs.prototype.getMaxListeners=function(){return aD(this)},xs.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var l;if(t.length>0&&(l=t[0]),l instanceof Error)throw l;var s=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw s.context=l,s}var g=o[e];if(g===void 0)return!1;if(typeof g=="function")nD(g,this,t);else for(var v=g.length,T=AD(g,v),r=0;r<v;++r)nD(T[r],this,t);return!0};function lD(i,e,t,r){var n,o,l;if(uv(t),o=i._events,o===void 0?(o=i._events=Object.create(null),i._eventsCount=0):(o.newListener!==void 0&&(i.emit("newListener",e,t.listener?t.listener:t),o=i._events),l=o[e]),l===void 0)l=o[e]=t,++i._eventsCount;else if(typeof l=="function"?l=o[e]=r?[t,l]:[l,t]:r?l.unshift(t):l.push(t),n=aD(i),n>0&&l.length>n&&!l.warned){l.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=i,s.type=e,s.count=l.length,fne(s)}return i}xs.prototype.addListener=function(e,t){return lD(this,e,t,!1)},xs.prototype.on=xs.prototype.addListener,xs.prototype.prependListener=function(e,t){return lD(this,e,t,!0)};function pne(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function cD(i,e,t){var r={fired:!1,wrapFn:void 0,target:i,type:e,listener:t},n=pne.bind(r);return n.listener=t,r.wrapFn=n,n}xs.prototype.once=function(e,t){return uv(t),this.on(e,cD(this,e,t)),this},xs.prototype.prependOnceListener=function(e,t){return uv(t),this.prependListener(e,cD(this,e,t)),this},xs.prototype.removeListener=function(e,t){var r,n,o,l,s;if(uv(t),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(o=-1,l=r.length-1;l>=0;l--)if(r[l]===t||r[l].listener===t){s=r[l].listener,o=l;break}if(o<0)return this;o===0?r.shift():gne(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,s||t)}return this},xs.prototype.off=xs.prototype.removeListener,xs.prototype.removeAllListeners=function(e){var t,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var o=Object.keys(r),l;for(n=0;n<o.length;++n)l=o[n],l!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this};function uD(i,e,t){var r=i._events;if(r===void 0)return[];var n=r[e];return n===void 0?[]:typeof n=="function"?t?[n.listener||n]:[n]:t?mne(n):AD(n,n.length)}xs.prototype.listeners=function(e){return uD(this,e,!0)},xs.prototype.rawListeners=function(e){return uD(this,e,!1)},xs.listenerCount=function(i,e){return typeof i.listenerCount=="function"?i.listenerCount(e):hD.call(i,e)},xs.prototype.listenerCount=hD;function hD(i){var e=this._events;if(e!==void 0){var t=e[i];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}xs.prototype.eventNames=function(){return this._eventsCount>0?cv(this._events):[]};function AD(i,e){for(var t=new Array(e),r=0;r<e;++r)t[r]=i[r];return t}function gne(i,e){for(;e+1<i.length;e++)i[e]=i[e+1];i.pop()}function mne(i){for(var e=new Array(i.length),t=0;t<e.length;++t)e[t]=i[t].listener||i[t];return e}function yne(i,e){return new Promise(function(t,r){function n(l){i.removeListener(e,o),r(l)}function o(){typeof i.removeListener=="function"&&i.removeListener("error",n),t([].slice.call(arguments))}dD(i,e,o,{once:!0}),e!=="error"&&_ne(i,n,{once:!0})})}function _ne(i,e,t){typeof i.on=="function"&&dD(i,"error",e,t)}function dD(i,e,t,r){if(typeof i.on=="function")r.once?i.once(e,t):i.on(e,t);else if(typeof i.addEventListener=="function")i.addEventListener(e,function n(o){r.once&&i.removeEventListener(e,n),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}var fD=UC.exports,vne={fr:{name:"France",bbox:[[-4.59235,41.380007],[9.560016,51.148506]]},us:{name:"United States",bbox:[[-171.791111,18.91619],[-66.96466,71.357764]]},ru:{name:"Russia",bbox:[[19.66064,41.151416],[190.10042,81.2504]]},ca:{name:"Canada",bbox:[[-140.99778,41.675105],[-52.648099,83.23324]]}},bne={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"},xne={placeholder:bne},pD={exports:{}};(function(i){(function(e,t,r){i.exports?i.exports=r():e[t]=r()})(cf,"subtag",function(){var e="",t=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function r(g){return g.match(t)||[]}function n(g){return r(g).filter(function(v,T){return v&&T})}function o(g){return g=r(g),{language:g[1]||e,extlang:g[2]||e,script:g[3]||e,region:g[4]||e}}function l(g,v,T){Object.defineProperty(g,v,{value:T,enumerable:!0})}function s(g,v,T){function F(R){return r(R)[g]||e}l(F,"pattern",v),l(o,T,F)}return s(1,/^[a-zA-Z]{2,3}$/,"language"),s(2,/^[a-zA-Z]{3}$/,"extlang"),s(3,/^[a-zA-Z]{4}$/,"script"),s(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),l(o,"split",n),o})})(pD);var wne=pD.exports,Bne=Wre,Cne=dne,au=Y4,Ene=fD.EventEmitter,gD=vne,Sne=xne,Tne=wne;function mD(i,e){this._eventEmitter=new Ene,this.options=au({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null,this.geocoderApi=i}mD.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,showResultsWhileTyping:!1,minLength:2,reverseGeocode:!1,limit:5,enableEventLogging:!0,marker:!0,popup:!1,maplibregl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,getItemValue:function(i){return i.text!==void 0?i.text:i.place_name},render:function(i){if(i.geometry){var s=i.place_name.split(",");return'<div class="mapboxgl-ctrl-geocoder--result maplibregl-ctrl-geocoder--result"><svg class="mapboxgl-ctrl-geocoder--result-icon maplibre-ctrl-geocoder--result-icon" viewBox="0 0 24 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.36571 0 0 5.38676 0 12.0471C0 21.0824 12 32 12 32C12 32 24 21.0824 24 12.0471C24 5.38676 18.6343 0 12 0ZM12 16.3496C9.63428 16.3496 7.71429 14.4221 7.71429 12.0471C7.71429 9.67207 9.63428 7.74454 12 7.74454C14.3657 7.74454 16.2857 9.67207 16.2857 12.0471C16.2857 14.4221 14.3657 16.3496 12 16.3496Z" fill="#687078"/></svg><div><div class="mapboxgl-ctrl-geocoder--result-title maplibregl-ctrl-geocoder--result-title">'+s[0]+'</div><div class="mapboxgl-ctrl-geocoder--result-address maplibregl-ctrl-geocoder--result-address">'+s.splice(1,s.length).join(",")+"</div></div></div>"}else{var e=i.text,t=e.toLowerCase().indexOf(this.query.toLowerCase()),r=this.query.length,n=e.substring(0,t),o=e.substring(t,t+r),l=e.substring(t+r);return'<div class="mapboxgl-ctrl-geocoder--suggestion maplibregl-ctrl-geocoder--suggestion"><svg class="mapboxgl-ctrl-geocoder--suggestion-icon maplibre-ctrl-geocoder--suggestion-icon" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22.8702 20.1258H21.4248L20.9125 19.6318C22.7055 17.546 23.785 14.8382 23.785 11.8925C23.785 5.32419 18.4608 0 11.8925 0C5.32419 0 0 5.32419 0 11.8925C0 18.4608 5.32419 23.785 11.8925 23.785C14.8382 23.785 17.546 22.7055 19.6318 20.9125L20.1258 21.4248V22.8702L29.2739 32L32 29.2739L22.8702 20.1258ZM11.8925 20.1258C7.33676 20.1258 3.65923 16.4483 3.65923 11.8925C3.65923 7.33676 7.33676 3.65923 11.8925 3.65923C16.4483 3.65923 20.1258 7.33676 20.1258 11.8925C20.1258 16.4483 16.4483 20.1258 11.8925 20.1258Z" fill="#687078"/></svg><div class="mapboxgl-ctrl-geocoder--suggestion-info maplibregl-ctrl-geocoder--suggestion-info"><div class="mapboxgl-ctrl-geocoder--suggestion-title maplibregl-ctrl-geocoder--suggestion-title">'+n+'<span class="mapboxgl-ctrl-geocoder--suggestion-match maplibregl-ctrl-geocoder--suggestion-match">'+o+"</span>"+l+"</div></div></div>"}},popupRender:function(i){var e=i.place_name.split(",");return'<div class="mapboxgl-ctrl-geocoder--suggestion maplibre-ctrl-geocoder--suggestion popup-suggestion"><div class="mapboxgl-ctrl-geocoder--suggestion-title maplibre-ctrl-geocoder--suggestion-title popup-suggestion-title">'+e[0]+'</div><div class="mapboxgl-ctrl-geocoder--suggestion-address maplibre-ctrl-geocoder--suggestion-address popup-suggestion-address">'+e.splice(1,e.length).join(",")+"</div></div>"},showResultMarkers:!0,debounceSearch:200},addTo:function(i){function e(r,n){if(!document.body.contains(n))throw new Error("Element provided to #addTo() exists, but is not in the DOM");var o=r.onAdd();n.appendChild(o)}if(i._controlContainer)i.addControl(this);else if(i instanceof HTMLElement)e(this,i);else if(typeof i=="string"){var t=document.querySelectorAll(i);if(t.length===0)throw new Error("Element ",i,"not found.");if(t.length>1)throw new Error("Geocoder can only be added to a single html element");e(this,t[0])}else throw new Error("Error: addTo must be a maplibre-gl-js map, an html element, or a CSS selector query for a single html element")},onAdd:function(i){if(i&&typeof i!="string"&&(this._map=i),this.setLanguage(),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);var e=this.container=document.createElement("div");e.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl";var t=this.createIcon("search",'<path d="M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"/>');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input maplibregl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",Cne(this._onKeyDown,this.options.debounceSearch)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton);var r=document.createElement("div");r.classList.add("mapboxgl-ctrl-geocoder--pin-right","maplibregl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button maplibregl-ctrl-geocoder--button";var n=this.createIcon("close",'<path d="M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"/>');return this._clearEl.appendChild(n),this._loadingEl=this.createIcon("loading",'<path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"/><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"/>'),r.appendChild(this._clearEl),r.appendChild(this._loadingEl),e.appendChild(t),e.appendChild(this._inputEl),e.appendChild(r),this._typeahead=new Bne(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit,noInitialSelection:!0}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this.resultMarkers=[],this._handleMarker=this._handleMarker.bind(this),this._handleResultMarkers=this._handleResultMarkers.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._maplibregl=this.options.maplibregl,!this._maplibregl&&this.options.marker&&(console.error("No maplibregl detected in options. Map markers are disabled. Please set options.maplibregl."),this.options.marker=!1)),e},createIcon:function(i,e){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");if(t.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+i+" maplibregl-ctrl-geocoder--icon maplibregl-ctrl-geocoder--icon-"+i),t.setAttribute("viewBox","0 0 18 18"),t.setAttribute("xml:space","preserve"),t.setAttribute("width",18),t.setAttribute("height",18),"innerHTML"in t)t.innerHTML=e;else{var r=document.createElement("div");r.innerHTML="<svg>"+e.valueOf().toString()+"</svg>";var n=r.firstChild,o=n.firstChild;t.appendChild(o)}return t},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_onPaste:function(i){var e=(i.clipboardData||window.clipboardData).getData("text");e.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(e)},_onKeyDown:function(i){var e=27,t=9;if(i.keyCode===e&&this.options.clearAndBlurOnEsc)return this._clear(i),this._inputEl.blur();var r=i.target&&i.target.shadowRoot?i.target.shadowRoot.activeElement:i.target,n=r?r.value:"";if(!n)return this.fresh=!0,i.keyCode!==t&&this.clear(i),this._clearEl.style.display="none";if(!(i.metaKey||[t,e,37,39,38,40].indexOf(i.keyCode)!==-1)){if(i.keyCode===13)if(!this.options.showResultsWhileTyping)this._typeahead.selected||this._geocode(r.value);else{this._typeahead.selected==null&&this.geocoderApi.getSuggestions?this._geocode(r.value,!0):this._typeahead.selected==null&&this.options.showResultMarkers&&this._fitBoundsForMarkers();return}r.value.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(r.value)}},_showButton:function(){this._inputEl.value.length>0&&(this._clearEl.style.display="block")},_hideButton:function(){this._typeahead.selected&&(this._clearEl.style.display="none")},_onBlur:function(i){this.options.clearOnBlur&&this._clearOnBlur(i),this.options.collapsed&&this._collapse()},_onChange:function(){var i=this._typeahead.selected;if(i&&!i.geometry)i.placeId?this._geocode(i.placeId,!0,!0):this._geocode(i.text,!0);else if(i&&JSON.stringify(i)!==this.lastSelected){if(this._clearEl.style.display="none",this.options.flyTo){var e;if(this._removeResultMarkers(),i.properties&&gD[i.properties.short_code])e=au({},this.options.flyTo),this._map&&this._map.fitBounds(gD[i.properties.short_code].bbox,e);else if(i.bbox){var t=i.bbox;e=au({},this.options.flyTo),this._map&&this._map.fitBounds([[t[0],t[1]],[t[2],t[3]]],e)}else{var r={zoom:this.options.zoom};e=au({},r,this.options.flyTo),i.center?e.center=i.center:i.geometry&&i.geometry.type&&i.geometry.type==="Point"&&i.geometry.coordinates&&(e.center=i.geometry.coordinates),this._map&&this._map.flyTo(e)}}this.options.marker&&this._maplibregl&&this._handleMarker(i),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(i),this._typeahead.selected=null,this._eventEmitter.emit("result",{result:i})}},_getConfigForRequest:function(){var i=["bbox","limit","proximity","countries","types","language","reverseMode"],e=this,t=i.reduce(function(r,n){return e.options[n]&&(["countries","types","language"].indexOf(n)>-1?r[n]=e.options[n].split(/[\s,]+/):r[n]=e.options[n],n==="proximity"&&e.options[n]&&typeof e.options[n].longitude=="number"&&typeof e.options[n].latitude=="number"&&(r[n]=[e.options[n].longitude,e.options[n].latitude])),r},{});return t},_geocode:function(i,e,t){this._loadingEl.style.display="block",this._eventEmitter.emit("loading",{query:i}),this.inputString=i;var r=null,n=this._getConfigForRequest(),o;if(this.options.localGeocoderOnly)o=Promise.resolve();else if(this.options.reverseGeocode&&/(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/.test(i)){var l=i.split(/[\s(,)?]+/).map(function(v){return parseFloat(v,10)}).reverse();n.types&&n.types[0],n=au(n,{query:l,limit:1}),"proximity"in n&&delete n.proximity,o=this.geocoderApi.reverseGeocode(n)}else n=au(n,{query:i}),this.geocoderApi.getSuggestions?e?this.geocoderApi.searchByPlaceId&&t?o=this.geocoderApi.searchByPlaceId(n):o=this.geocoderApi.forwardGeocode(n):o=this.geocoderApi.getSuggestions(n):o=this.geocoderApi.forwardGeocode(n);var s=[];this.options.localGeocoder&&(s=this.options.localGeocoder(i),s||(s=[]));var g=[];return o.catch((function(v){r=v}).bind(this)).then((function(v){this._loadingEl.style.display="none";var T={};return v?T=v:T={type:"FeatureCollection",features:[]},T.config=n,this.fresh&&(this.fresh=!1),T.features=T.features?s.concat(T.features):s,this.options.externalGeocoder?(g=this.options.externalGeocoder(i,T.features,n)||[],g.then(function(F){return T.features=T.features?F.concat(T.features):F,T},function(){return T})):T}).bind(this)).then((function(v){if(r)throw r;this.options.filter&&v.features.length&&(v.features=v.features.filter(this.options.filter));var T=[];v.suggestions?T=v.suggestions:v.place?T=[v.place]:T=v.features,T.length?(this._clearEl.style.display="block",this._typeahead.update(T),(!this.options.showResultsWhileTyping||e)&&this.options.showResultMarkers&&(v.features.length>0||v.place)&&this._fitBoundsForMarkers(),this._eventEmitter.emit("results",v)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",v))}).bind(this)).catch((function(v){this._loadingEl.style.display="none",s.length&&this.options.localGeocoder||g.length&&this.options.externalGeocoder?(this._clearEl.style.display="block",this._typeahead.update(s)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:s}),this._eventEmitter.emit("error",{error:v})}).bind(this)),o},_clear:function(i){i&&i.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display="none",this._removeMarker(),this._removeResultMarkers(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(i){this._clear(i),this._inputEl.focus()},_clearOnBlur:function(i){var e=this;i.relatedTarget&&e._clear(i)},_onQueryResult:function(i){var e=i;if(e.features.length){var t=e.features[0];this._typeahead.selected=t,this._inputEl.value=t.place_name,this._onChange()}},_updateProximity:function(){if(this._map)if(this._map.getZoom()>9){var i=this._map.getCenter().wrap();this.setProximity({longitude:i.lng,latitude:i.lat})}else this.setProximity(null)},_collapse:function(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed","maplibregl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed","maplibregl-ctrl-geocoder--collapsed")},query:function(i){return this._geocode(i).then(this._onQueryResult),this},_renderError:function(){var i="<div class='mapbox-gl-geocoder--error maplibre-gl-geocoder--error'>There was an error reaching the server</div>";this._renderMessage(i)},_renderNoResults:function(){var i="<div class='mapbox-gl-geocoder--error mapbox-gl-geocoder--no-results maplibre-gl-geocoder--error maplibre-gl-geocoder--no-results'>No results found</div>";this._renderMessage(i)},_renderMessage:function(i){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(i)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var i=this.options.language.split(",")[0],e=Tne.language(i),t=Sne.placeholder[e];if(t)return t}return"Search"},_fitBoundsForMarkers:function(){if(!(this._typeahead.data.length<1)){var i=this._typeahead.data.filter(function(n){return typeof n!="string"}).slice(0,this.options.limit);if(this._clearEl.style.display="none",this.options.flyTo&&this._maplibregl&&this._map){var e={padding:100},t=au({},e,this.options.flyTo),r=new this._maplibregl.LngLatBounds;i.forEach(function(n){r.extend(n.geometry.coordinates)}),this._map.fitBounds(r.toArray(),t)}return i.length>0&&this._maplibregl&&this._handleResultMarkers(i),this}},setInput:function(i){return this._inputEl.value=i,this._typeahead.selected=null,this._typeahead.clear(),i.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(i),this},setProximity:function(i){return this.options.proximity=i,this},getProximity:function(){return this.options.proximity},setRenderFunction:function(i){return i&&typeof i=="function"&&(this._typeahead.render=i),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(i){var e=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=i||this.options.language||e,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(i){return this.options.zoom=i,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(i){return this.options.flyTo=i,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(i){return this.placeholder=i||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(i){return this.options.bbox=i,this},getCountries:function(){return this.options.countries},setCountries:function(i){return this.options.countries=i,this},getTypes:function(){return this.options.types},setTypes:function(i){return this.options.types=i,this},getMinLength:function(){return this.options.minLength},setMinLength:function(i){return this.options.minLength=i,this._typeahead&&(this._typeahead.options.minLength=i),this},getLimit:function(){return this.options.limit},setLimit:function(i){return this.options.limit=i,this._typeahead&&(this._typeahead.options.limit=i),this},getFilter:function(){return this.options.filter},setFilter:function(i){return this.options.filter=i,this},setGeocoderApi:function(i){return this.geocoderApi=i,this},getGeocoderApi:function(){return this.geocoderApi},_handleMarker:function(i){if(this._map){this._removeMarker();var e={color:"#4668F2"},t=au({},e,this.options.marker);this.mapMarker=new this._maplibregl.Marker(t);var r;if(this.options.popup){var n={},o=au({},n,this.options.popup);r=new this._maplibregl.Popup(o).setHTML(this.options.popupRender(i))}return i.center?(this.mapMarker.setLngLat(i.center).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(r)):i.geometry&&i.geometry.type&&i.geometry.type==="Point"&&i.geometry.coordinates&&(this.mapMarker.setLngLat(i.geometry.coordinates).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(r)),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},_handleResultMarkers:function(i){if(this._map){this._removeResultMarkers();var e={color:"#4668F2"},t=au({},e,this.options.showResultMarkers);return i.forEach((function(r){if(this.options.showResultMarkers&&this.options.showResultMarkers.element){var n=this.options.showResultMarkers.element.cloneNode(!0);t=au(t,{element:n})}var o=new this._maplibregl.Marker(au({},t,{element:n})),l;if(this.options.popup){var s={},g=au({},s,this.options.popup);l=new this._maplibregl.Popup(g).setHTML(this.options.popupRender(r))}r.center?(o.setLngLat(r.center).addTo(this._map),this.options.popup&&o.setPopup(l)):r.geometry&&r.geometry.type&&r.geometry.type==="Point"&&r.geometry.coordinates&&(o.setLngLat(r.geometry.coordinates).addTo(this._map),this.options.popup&&o.setPopup(l)),this.resultMarkers.push(o)}).bind(this)),this}},_removeResultMarkers:function(){this.resultMarkers&&this.resultMarkers.length>0&&(this.resultMarkers.forEach(function(i){i.remove()}),this.resultMarkers=[])},on:function(i,e){return this._eventEmitter.on(i,e),this},off:function(i,e){return this._eventEmitter.removeListener(i,e),this}};var Ine=mD;const Lne=Um(Ine),rn={limitsUrl:"https://tilemaps.icgc.cat/vt/limits-tilejsonV3.json",geocoder:{peliasUrl1:"https://eines.icgc.cat/geocodificador/autocompletar?text=",peliasUrl2:"&layers=topo1%2Ctopo2%2Caddress&size=5"},mapOptions:{container:"map",center:{0:1.537786,1:41.837539},zoom:7.5,bearing:0,pitch:0,hash:!1,style:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json.json",maxZoom:18,maxPitch:85},logoIcgcOptions:{logoUrlColor:"https://tilemaps.icgc.cat/cdn/logos/icgc_logo_color.png",logoUrlWhite:"https://tilemaps.icgc.cat/cdn/logos/icgc_logo_blanc.svg",logoLink:"https://www.icgc.cat",logoTitle:"Institut Cartogràfic i Geològic de Catalunya",logoWidth:100},logoGencatOptions:{logoUrlColor:"https://tilemaps.icgc.cat/cdn/logos/gencat_logo_color.png",logoUrlWhite:"https://tilemaps.icgc.cat/cdn/logos/gencat_logo_blanc.png",logoLink:"https://web.gencat.cat/",logoTitle:"Generalitat de Catalunya",logoWidth:100},map3dOptions:{spaceErrorFactor:2,exaggeration:1,zfactor:48,minZoomRange:15.5,maxZoomRange:22,urlTilesetCities:"https://tilemaps.icgc.cat/vector/3dtiles/ciutats/v1/tilesetV1.0.json",layerIdOrder:"place-isolated",sourceLayerFilterId:"place",minZoomFilter:14,layerId3d:"edificisMapboxLayer",terrainSource:"ICGC5M",style3dName:"orto3d",imageIcon:"https://tilemaps.icgc.cat/cdn/images/stick.png"},baseStyles:{0:{key:"TOPO",url:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_mapa_estandard.png"},1:{key:"ORTO",url:"https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_orto_hibrida.png"},2:{key:"ORTO3D",url:"https://tilemaps.icgc.cat/cdn/styles/icgc_orto_3d.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_orto_hibrida.png"},3:{key:"ADMIN",url:"https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_delimitacio_limits_administratius.png"},4:{key:"DARK",url:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_mapa_base_fosc.png"},5:{key:"LIGHT",url:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_mapa_base_gris.png"},6:{key:"GEOLOGY",url:"https://geoserveis.icgc.cat/contextmaps/icgc_geologic_informacio.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_geologic_informacio.png"}},urlTerrainICGC:{0:{name:"ICGC5M",url:"https://tilemaps.icgc.cat/tileserver/tileserver/terreny-5m-30m-rgb-extent/{z}/{x}/{y}.png"},1:{name:"WORLD30M",url:"https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png",encoding:"terrarium"}},ortoLayersICGC:{0:{name:"ortofotoColorProvisional",key:"ortofoto_color_provisional",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_provisional"},1:{name:"ortofotoColor2022",key:"ortofoto_color_2022",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2022"},2:{name:"ortofotoColor2021",key:"ortofoto_color_2021",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2021"},3:{name:"ortofotoColor2020",key:"ortofoto_color_2020",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2020"},4:{name:"ortofotoColor2019",key:"ortofoto_color_2019",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2019"},5:{name:"ortofotoColor2018",key:"ortofoto_color_2018",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2018"},6:{name:"ortofotoColor2017",key:"ortofoto_color_2017",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2017"},7:{name:"ortofotoColor2016",key:"ortofoto_color_2016",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2016"},8:{name:"ortofotoColor2015",key:"ortofoto_color_2015",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2015"},9:{name:"ortofotoColor2014",key:"ortofoto_color_2014",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2014"},10:{name:"ortofotoColor2013",key:"ortofoto_color_2013",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2013"},11:{name:"ortofotoColor2012",key:"ortofoto_color_2012",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2012"},12:{name:"ortofotoColor2011",key:"ortofoto_color_2011",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2011"},13:{name:"ortofotoColor2010",key:"ortofoto_color_2010",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2010"},14:{name:"ortofotoColor2009",key:"ortofoto_color_2009",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2009"},15:{name:"ortofotoColor2008",key:"ortofoto_color_2008",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2008"},16:{name:"ortofotoColor20062007",key:"ortofoto_color_2006-2007",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2006-2007"},17:{name:"ortofotoColor20042005",key:"ortofoto_color_2004-2005",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2004-2005"},18:{name:"ortofotoColor20002003",key:"ortofoto_color_2000-2003",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2000-2003"},19:{name:"ortofotoBlancINegre1998",key:"ortofoto_blanc_i_negre_1998",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1998"},20:{name:"ortofotoBlancINegre19941997",key:"ortofoto_blanc_i_negre_1994-1997",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1994-1997"},21:{name:"ortofotoColor1993",key:"ortofoto_color_1993",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_1993"},22:{name:"ortofotoBlancINegre19831992",key:"ortofoto_blanc_i_negre_1983-1992",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1983-1992"},23:{name:"ortofotoBlancINegre19701977",key:"ortofoto_blanc_i_negre_1970-1977",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1970-1977"},24:{name:"ortofotoBlancINegre1956",key:"ortofoto_blanc_i_negre_1956",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1956"},25:{name:"ortofotoBlancINegre1945",key:"ortofoto_blanc_i_negre_1945",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1945"},26:{name:"ortofotoColorSerieAnual",key:"ortofoto_color_serie_anual",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_serie_anual"},27:{name:"ortofotoInfraroigProvisional",key:"ortofoto_infraroig_provisional",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_provisional"},28:{name:"ortofotoInfraroig2022",key:"ortofoto_infraroig_2022",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2022"},29:{name:"ortofotoInfraroig2021",key:"ortofoto_infraroig_2021",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2021"},30:{name:"ortofotoInfraroig2020",key:"ortofoto_infraroig_2020",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2020"},31:{name:"ortofotoInfraroig2019",key:"ortofoto_infraroig_2019",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2019"},32:{name:"ortofotoInfraroig2018",key:"ortofoto_infraroig_2018",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2018"},33:{name:"ortofotoInfraroig2017",key:"ortofoto_infraroig_2017",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2017"},34:{name:"ortofotoInfraroig2016",key:"ortofoto_infraroig_2016",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2016"},35:{name:"ortofotoInfraroig2015",key:"ortofoto_infraroig_2015",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2015"},36:{name:"ortofotoInfraroig2014",key:"ortofoto_infraroig_2014",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2014"},37:{name:"ortofotoInfraroig2013",key:"ortofoto_infraroig_2013",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2013"},38:{name:"ortofotoInfraroig2012",key:"ortofoto_infraroig_2012",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2012"},39:{name:"ortofotoInfraroig2011",key:"ortofoto_infraroig_2011",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2011"},40:{name:"ortofotoInfraroig2010",key:"ortofoto_infraroig_2010",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2010"},41:{name:"ortofotoInfraroig2009",key:"ortofoto_infraroig_2009",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2009"},42:{name:"ortofotoInfraroig2008",key:"ortofoto_infraroig_2008",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2008"},43:{name:"ortofotoInfraroig20062007",key:"ortofoto_infraroig_2006-2007",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2006-2007"},44:{name:"ortofotoInfraroig19961997",key:"ortofoto_infraroig_1996-1997",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_1996-1997"},45:{name:"ortofotoInfraroigSerieAnual",key:"ortofoto_infraroig_serie_anual",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_serie_anual"}},vectorLayersICGC:{0:{name:"agrupacionsCensals2015",key:"agrupacions_censals_2015"},1:{name:"agrupacionsCensals2016",key:"agrupacions_censals_2016"},2:{name:"agrupacionsCensals2017",key:"agrupacions_censals_2017"},3:{name:"agrupacionsCensals2018",key:"agrupacions_censals_2018"},4:{name:"agrupacionsCensals2019",key:"agrupacions_censals_2019"},5:{name:"agrupacionsCensals2020",key:"agrupacions_censals_2020"},6:{name:"agrupacionsCensals2021",key:"agrupacions_censals_2021"},7:{name:"agrupacionsCensalsVigent",key:"agrupacions_censals_vigent"},8:{name:"agrupacionsCensalsVigentText",key:"agrupacions_censals_vigent_text"},9:{name:"areesBasiquesPolicials2019",key:"arees_basiques_policials_2019"},10:{name:"areesBasiquesPolicials2020",key:"arees_basiques_policials_2020"},11:{name:"areesBasiquesPolicials2022",key:"arees_basiques_policials_2022"},12:{name:"areesBasiquesPolicialsVigent",key:"arees_basiques_policials_vigent"},13:{name:"areesBasiquesPolicialsVigentText",key:"arees_basiques_policials_vigent_text"},14:{name:"areesBasiquesSalutVigent",key:"arees_basiques_salut_vigent"},15:{name:"areesBasiquesServeisSocialsVigent",key:"arees_basiques_serveis_socials_vigent"},16:{name:"areesBasiquesServeisSocialsVigentText",key:"arees_basiques_serveis_socials_vigent_text"},17:{name:"areesGestioAssistencialVigent",key:"arees_gestio_assistencial_vigent"},18:{name:"areesHidrogeologiquesAquifersVigent",key:"arees_hidrogeologiques_aquifers_vigent"},19:{name:"catalunyaVigent",key:"catalunya_vigent"},20:{name:"catalunyaVigentText",key:"catalunya_vigent_text"},21:{name:"comarques2022",key:"comarques_2022"},22:{name:"comarquesVigent",key:"comarques_vigent"},23:{name:"comarquesVigentText",key:"comarques_vigent_text"},24:{name:"districtesCensals2015",key:"districtes_censals_2015"},25:{name:"districtesCensals2016",key:"districtes_censals_2016"},26:{name:"districtesCensals2017",key:"districtes_censals_2017"},27:{name:"districtesCensals2018",key:"districtes_censals_2018"},28:{name:"districtesCensals2019",key:"districtes_censals_2019"},29:{name:"districtesCensals2020",key:"districtes_censals_2020"},30:{name:"districtesCensals2021",key:"districtes_censals_2021"},31:{name:"districtesCensals2022",key:"districtes_censals_2022"},32:{name:"districtesCensalsVigent",key:"districtes_censals_vigent"},33:{name:"districtesCensalsVigentText",key:"districtes_censals_vigent_text"},34:{name:"incendisForestalsVigent",key:"incendis_forestals_vigent"},35:{name:"incendisForestalsVigentText",key:"incendis_forestals_vigent_text"},36:{name:"municipis2022",key:"municipis_2022"},37:{name:"municipis2022Text",key:"municipis_2022_text"},38:{name:"municipisVigent",key:"municipis_vigent"},39:{name:"municipisVigentText",key:"municipis_vigent_text"},40:{name:"partitsJudicialsVigent",key:"partits_judicials_vigent"},41:{name:"partitsJudicialsVigentText",key:"partits_judicials_vigent_text"},42:{name:"plaTerritorial2015",key:"pla_territorial_2015"},43:{name:"plaTerritorialVigent",key:"pla_territorial_vigent"},44:{name:"plaTerritorialVigentText",key:"pla_territorial_vigent_text"},45:{name:"provinciesVigent",key:"provincies_vigent"},46:{name:"provinciesVigentText",key:"provincies_vigent_text"},47:{name:"regionsPolicialsVigent",key:"regions_policials_vigent"},48:{name:"regionsPolicialsVigentText",key:"regions_policials_vigent_text"},49:{name:"regionsSanitariesVigent",key:"regions_sanitaries_vigent"},50:{name:"regionsSanitariesVigentText",key:"regions_sanitaries_vigent_text"},51:{name:"seccionsCensals2015",key:"seccions_censals_2015"},52:{name:"seccionsCensals2016",key:"seccions_censals_2016"},53:{name:"seccionsCensals2017",key:"seccions_censals_2017"},54:{name:"seccionsCensals2018",key:"seccions_censals_2018"},55:{name:"seccionsCensals2019",key:"seccions_censals_2019"},56:{name:"seccionsCensals2020",key:"seccions_censals_2020"},57:{name:"seccionsCensals2021",key:"seccions_censals_2021"},58:{name:"seccionsCensals2022",key:"seccions_censals_2022"},59:{name:"seccionsCensalsVigent",key:"seccions_censals_vigent"},60:{name:"seccionsCensalsVigentText",key:"seccions_censals_vigent_text"},61:{name:"sectorsSanitarisVigent",key:"sectors_sanitaris_vigent"},62:{name:"vegueriesVigent",key:"vegueries_vigent"},63:{name:"vegueriesVigentText",key:"vegueries_vigent_text"}},vectorLayers:{0:{key:"cobertes2018",url:"https://tilemaps.icgc.cat/tileserver/cobertes_tilejson.json",legend:"https://tilemaps.icgc.cat/cdn/images/llegendaCobertesSol2018.jpg"}},wmsLayers:{0:{key:"espaisInteresGeologic",layer:"",url:"https://geoserveis.icgc.cat/servei/catalunya/espais-interes-geologic/wms/service?&service=WMS&request=GetMap&layers=espais-interes-geologic&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}"},1:{key:"gravimetriaBouguer500000",layer:"",url:"https://geoserveis.icgc.cat/servei/catalunya/gravimetria/wms/service?&service=WMS&request=GetMap&layers=anomalia_bouguer_500000&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}"},2:{key:"cobertesSol2018",layer:"",url:"https://geoserveis.icgc.cat/servei/catalunya/cobertes-sol/wms/service?&service=WMS&request=GetMap&layers=cobertes_2018&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}"},3:{key:"administratiu",layer:"",url:"http://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/administratiu/MON3857NW/{z}/{x}/{y}.png"},4:{key:"simplificat",layer:"",url:"http://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/simplificat/MON3857NW/{z}/{x}/{y}.png"},5:{key:"cims",layer:"",url:"https://geoserveis.icgc.cat/icc_100cims/wms/service?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=0&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:25831&BBOX=137118.923076923,4488408.75,650959.076923077,4749634.75&WIDTH=895&HEIGHT=455"},6:{key:"cobertesSol",layer:"",url:"http://geoserveis.icgc.cat/servei/catalunya/cobertes-sol/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=cobertes_2009&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&CRS=EPSG:25831&BBOX=374110.828167253,4639230.79853085,452621.120632226,4703578.45000215&WIDTH=1020&HEIGHT=836"}},fgbLayers:{0:{name:"agrupacionsCensalsVigent",key:"agrupacions_censals_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/agrupacions_censals_vigent.fgb"},1:{name:"agrupacionsCensalsVigentText",key:"agrupacions_censals_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/agrupacions_censals_vigent_text.fgb"},2:{name:"areesBasiquesPolicialsVigent",key:"arees_basiques_policials_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_policials_vigent.fgb"},3:{name:"areesBasiquesPolicialsVigentText",key:"arees_basiques_policials_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_policials_vigent_text.fgb"},4:{name:"areesBasiquesSalutVigent",key:"arees_basiques_salut_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_salut_vigent.fgb"},5:{name:"areesBasiquesServeisSocialsVigent",key:"arees_basiques_serveis_socials_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_serveis_socials_vigent.fgb"},6:{name:"areesBasiquesServeisSocialsVigentText",key:"arees_basiques_serveis_socials_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_serveis_socials_vigent_text.fgb"},7:{name:"areesGestioAssistencialVigent",key:"arees_gestio_assistencial_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_gestio_assistencial_vigent.fgb"},8:{name:"areesHidrogeologiquesAquifersVigent",key:"arees_hidrogeologiques_aquifers_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_hidrogeologiques_aquifers_vigent.fgb"},9:{name:"catalunyaVigent",key:"catalunya_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/catalunya_vigent.fgb"},10:{name:"catalunyaVigentText",key:"catalunya_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/catalunya_vigent_text.fgb"},11:{name:"comarquesVigent",key:"comarques_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/comarques_vigent.fgb"},12:{name:"comarquesVigentText",key:"comarques_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/comarques_vigent_text.fgb"},13:{name:"districtesCensalsVigent",key:"districtes_censals_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/districtes_censals_vigent.fgb"},14:{name:"districtesCensalsVigentText",key:"districtes_censals_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/districtes_censals_vigent_text.fgb"},15:{name:"incendisForestalsVigent",key:"incendis_forestals_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/incendis_forestals_vigent.fgb"},16:{name:"incendisForestalsVigentText",key:"incendis_forestals_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/incendis_forestals_vigent_text.fgb"},17:{name:"municipisVigent",key:"municipis_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/municipis_vigent.fgb"},18:{name:"municipisVigentText",key:"municipis_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/municipis_vigent_text.fgb"},19:{name:"partitsJudicialsVigent",key:"partits_judicials_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/partits_judicials_vigent.fgb"},20:{name:"partitsJudicialsVigentText",key:"partits_judicials_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/partits_judicials_vigent_text.fgb"},21:{name:"plaTerritorialVigent",key:"pla_territorial_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/pla_territorial_vigent.fgb"},22:{name:"plaTerritorialVigentText",key:"pla_territorial_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/pla_territorial_vigent_text.fgb"},23:{name:"provinciesVigent",key:"provincies_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/provincies_vigent.fgb"},24:{name:"provinciesVigentText",key:"provincies_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/provincies_vigent_text.fgb"},25:{name:"regionsPolicialsVigent",key:"regions_policials_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/regions_policials_vigent.fgb"},26:{name:"regionsPolicialsVigentText",key:"regions_policials_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/regions_policials_vigent_text.fgb"},27:{name:"regionsSanitariesVigent",key:"regions_sanitaries_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/regions_sanitaries_vigent.fgb"},28:{name:"regionsSanitariesVigentText",key:"regions_sanitaries_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/regions_sanitaries_vigent_text.fgb"},29:{name:"seccionsCensalsVigent",key:"seccions_censals_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/seccions_censals_vigent.fgb"},30:{name:"seccionsCensalsVigentText",key:"seccions_censals_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/seccions_censals_vigent_text.fgb"},31:{name:"sectorsSanitarisVigent",key:"sectors_sanitaris_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/sectors_sanitaris_vigent.fgb"},32:{name:"vegueriesVigent",key:"vegueries_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/vegueries_vigent.fgb"},33:{name:"vegueriesVigentText",key:"vegueries_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/vegueries_vigent_text.fgb"}}};class Mne{constructor(e){this.options=e}onAdd(e){return this._map=e,this._img1=document.createElement("img"),this._img1.className="maplibregl-ctrl",this._img1.src=this.options.color?rn.logoIcgcOptions.logoUrlColor:rn.logoIcgcOptions.logoUrlWhite,this._img1.width=rn.logoIcgcOptions.logoWidth,this._img1.title=rn.logoIcgcOptions.logoTitle,this.link1=document.createElement("a"),this.link1.href=rn.logoIcgcOptions.logoLink,this.link1.target="_blank",this.link1.appendChild(this._img1),this._container1=document.createElement("div"),this._container1.className="maplibregl-ctrl",this._container1.style.width=`${rn.logoIcgcOptions.logoWidth}px`,this._container1.appendChild(this.link1),this._img2=document.createElement("img"),this._img2.className="maplibregl-ctrl",this._img2.src=this.options.color?rn.logoGencatOptions.logoUrlColor:rn.logoGencatOptions.logoUrlWhite,this._img2.width=rn.logoGencatOptions.logoWidth,this._img2.title=rn.logoGencatOptions.logoTitle,this.link2=document.createElement("a"),this.link2.href=rn.logoGencatOptions.logoLink,this.link2.target="_blank",this.link2.appendChild(this._img2),this._container2=document.createElement("div"),this._container2.className="maplibregl-ctrl",this._container2.style.width=`${rn.logoGencatOptions.logoWidth}px`,this._container2.appendChild(this.link2),this._mainContainer=document.createElement("div"),this._mainContainer.className="divLogos",this._mainContainer.style="display: flex",this._mainContainer.appendChild(this._container1),this._mainContainer.appendChild(this._container2),this._mainContainer}}var Fg=yD.prototype,NC="WGS 84";function yD(i){i!==void 0&&(NC=i),this.setEllipsoid(NC)}Fg.convertLatLngToUtm=function(i,e,t){var r;if(this.status)return"No ecclipsoid data associated with unknown datum: "+NC;if(!Number.isInteger(t))return"Precision is not integer number.";i=parseFloat(i),e=parseFloat(e);var n=e,o=this.toRadians(i),l=this.toRadians(n);n>=8&&n<=13&&i>54.5&&i<58||i>=56&&i<64&&n>=3&&n<12?r=32:(r=(n+180)/6+1,i>=72&&i<84&&(n>=0&&n<9?r=31:n>=9&&n<21?r=33:n>=21&&n<33?r=35:n>=33&&n<42&&(r=37))),r=parseInt(r);var s=(r-1)*6-180+3,g=this.toRadians(s),v=this.getUtmLetterDesignator(i),T=this.eccSquared/(1-this.eccSquared),F=this.a/Math.sqrt(1-this.eccSquared*Math.sin(o)*Math.sin(o)),R=Math.tan(o)*Math.tan(o),U=T*Math.cos(o)*Math.cos(o),J=Math.cos(o)*(l-g),te=this.a*((1-this.eccSquared/4-3*this.eccSquared*this.eccSquared/64-5*this.eccSquared*this.eccSquared*this.eccSquared/256)*o-(3*this.eccSquared/8+3*this.eccSquared*this.eccSquared/32+45*this.eccSquared*this.eccSquared*this.eccSquared/1024)*Math.sin(2*o)+(15*this.eccSquared*this.eccSquared/256+45*this.eccSquared*this.eccSquared*this.eccSquared/1024)*Math.sin(4*o)-35*this.eccSquared*this.eccSquared*this.eccSquared/3072*Math.sin(6*o)),Ae=parseFloat(.9996*F*(J+(1-R+U)*J*J*J/6+(5-18*R+R*R+72*U-58*T)*J*J*J*J*J/120)+5e5),he=parseFloat(.9996*(te+F*Math.tan(o)*(J*J/2+(5-R+9*U+4*U*U)*J*J*J*J/24+(61-58*R+R*R+600*U-330*T)*J*J*J*J*J*J/720)));return i<0&&(he+=1e7),he=_D(he,t),Ae=_D(Ae,t),{Easting:Ae,Northing:he,ZoneNumber:parseInt(r),ZoneLetter:v}},Fg.convertUtmToLatLng=function(i,e,t,r){var n=(1-Math.sqrt(1-this.eccSquared))/(1+Math.sqrt(1-this.eccSquared)),o=i-5e5,l=e,s=t,g=r;if(i===void 0)return"Please pass the UTMEasting!";if(e===void 0)return"Please pass the UTMNorthing!";if(t===void 0)return"Please pass the UTMZoneNumber!";if(r===void 0)return"Please pass the UTMZoneLetter!";["N","P","Q","R","S","T","U","V","W","X","Y","Z"].indexOf(g)!==-1||(l-=1e7);var v=(s-1)*6-180+3,T=this.eccSquared/(1-this.eccSquared),F=l/.9996,R=F/(this.a*(1-this.eccSquared/4-3*this.eccSquared*this.eccSquared/64-5*this.eccSquared*this.eccSquared*this.eccSquared/256)),U=R+(3*n/2-27*n*n*n/32)*Math.sin(2*R)+(21*n*n/16-55*n*n*n*n/32)*Math.sin(4*R)+151*n*n*n/96*Math.sin(6*R);this.toDegrees(U);var J=this.a/Math.sqrt(1-this.eccSquared*Math.sin(U)*Math.sin(U)),te=Math.tan(U)*Math.tan(U),Ae=T*Math.cos(U)*Math.cos(U),he=this.a*(1-this.eccSquared)/Math.pow(1-this.eccSquared*Math.sin(U)*Math.sin(U),1.5),pe=o/(J*.9996),be=U-J*Math.tan(U)/he*(pe*pe/2-(5+3*te+10*Ae-4*Ae*Ae-9*T)*pe*pe*pe*pe/24+(61+90*te+298*Ae+45*te*te-252*T-3*Ae*Ae)*pe*pe*pe*pe*pe*pe/720);be=this.toDegrees(be);var Te=(pe-(1+2*te+Ae)*pe*pe*pe/6+(5-2*Ae+28*te-3*Ae*Ae+8*T+24*te*te)*pe*pe*pe*pe*pe/120)/Math.cos(U);return Te=v+this.toDegrees(Te),{lat:be,lng:Te}},Fg.getUtmLetterDesignator=function(i){return i=parseFloat(i),84>=i&&i>=72?"X":72>i&&i>=64?"W":64>i&&i>=56?"V":56>i&&i>=48?"U":48>i&&i>=40?"T":40>i&&i>=32?"S":32>i&&i>=24?"R":24>i&&i>=16?"Q":16>i&&i>=8?"P":8>i&&i>=0?"N":0>i&&i>=-8?"M":-8>i&&i>=-16?"L":-16>i&&i>=-24?"K":-24>i&&i>=-32?"J":-32>i&&i>=-40?"H":-40>i&&i>=-48?"G":-48>i&&i>=-56?"F":-56>i&&i>=-64?"E":-64>i&&i>=-72?"D":-72>i&&i>=-80?"C":"Z"},Fg.setEllipsoid=function(i){switch(i){case"Airy":this.a=6377563,this.eccSquared=.00667054;break;case"Australian National":this.a=6378160,this.eccSquared=.006694542;break;case"Bessel 1841":this.a=6377397,this.eccSquared=.006674372;break;case"Bessel 1841 Nambia":this.a=6377484,this.eccSquared=.006674372;break;case"Clarke 1866":this.a=6378206,this.eccSquared=.006768658;break;case"Clarke 1880":this.a=6378249,this.eccSquared=.006803511;break;case"Everest":this.a=6377276,this.eccSquared=.006637847;break;case"Fischer 1960 Mercury":this.a=6378166,this.eccSquared=.006693422;break;case"Fischer 1968":this.a=6378150,this.eccSquared=.006693422;break;case"GRS 1967":this.a=6378160,this.eccSquared=.006694605;break;case"GRS 1980":this.a=6378137,this.eccSquared=.00669438;break;case"Helmert 1906":this.a=6378200,this.eccSquared=.006693422;break;case"Hough":this.a=6378270,this.eccSquared=.00672267;break;case"International":this.a=6378388,this.eccSquared=.00672267;break;case"Krassovsky":this.a=6378245,this.eccSquared=.006693422;break;case"Modified Airy":this.a=6377340,this.eccSquared=.00667054;break;case"Modified Everest":this.a=6377304,this.eccSquared=.006637847;break;case"Modified Fischer 1960":this.a=6378155,this.eccSquared=.006693422;break;case"South American 1969":this.a=6378160,this.eccSquared=.006694542;break;case"WGS 60":this.a=6378165,this.eccSquared=.006693422;break;case"WGS 66":this.a=6378145,this.eccSquared=.006694542;break;case"WGS 72":this.a=6378135,this.eccSquared=.006694318;break;case"ED50":this.a=6378388,this.eccSquared=.00672267;break;case"WGS 84":case"EUREF89":case"ETRS89":this.a=6378137,this.eccSquared=.00669438;break;default:this.status=!0}},Fg.toDegrees=function(i){return i/Math.PI*180},Fg.toRadians=function(i){return i*Math.PI/180};function _D(i,e){var t=Math.pow(10,e);return Math.round(i*t)/t}var Pne=yD;const Fne=Um(Pne);class Dne{constructor(e){this.options=e||{},this.options.utm=this.options.hasOwnProperty("utm")?this.options.utm:!0,this.options.lonlat=this.options.hasOwnProperty("lonlat")?this.options.lonlat:!0}onAdd(e){const t=new Fne;return this._map=e,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl coordControl",this._container.style.width=`${this.options.width||"225px"}`,this._map.on("mousemove",r=>{const n=r.lngLat.lat,o=r.lngLat.lng;let l="",s="";const g=t.convertLatLngToUtm(n,o,2),v=n>0?"N":"S";this.options.utm&&(l=`ETRS89 UTM ${g.ZoneNumber}${v} X:<b> ${g.Easting}</b> Y:<b> ${g.Northing}</b> <br>`),this.options.lonlat&&(s=`WGS 84 Lon:<b> ${o.toFixed(5)}</b> Lat:<b> ${n.toFixed(5)}</b>`);const T=`${l}${s}`;this._container.innerHTML=T}),this._container}_lookUTM31(e,t){var r=0,n=0,o=6,l=84;return e>=r&&e<=o&&t>=n&&t<=l}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}}const hv={ICGC5M:"https://tilemaps.icgc.cat/tileserver/tileserver/terreny-5m-30m-rgb-extent/{z}/{x}/{y}.png",WORLD30M:"https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"},Dg={TOPO:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",ORTO:"https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json",ORTO3D:"https://tilemaps.icgc.cat/cdn/styles/icgc_orto_3d.json",ADMIN:"https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json",DARK:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json",LIGHT:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json",GEOLOGY:"https://geoserveis.icgc.cat/contextmaps/icgc_geologic_informacio.json"},so={Orto:{ortofotoColorProvisional:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_provisional",ortofotoColor2022:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2022",ortofotoColor2021:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2021",ortofotoColor2020:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2020",ortofotoColor2019:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2019",ortofotoColor2018:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2018",ortofotoColor2017:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2017",ortofotoColor2016:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2016",ortofotoColor2015:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2015",ortofotoColor2014:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2014",ortofotoColor2013:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2013",ortofotoColor2012:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2012",ortofotoColor2011:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2011",ortofotoColor2010:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2010",ortofotoColor2009:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2009",ortofotoColor2008:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2008",ortofotoColor20062007:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2006-2007",ortofotoColor20042005:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2004-2005",ortofotoColor20002003:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2000-2003",ortofotoBlancINegre1998:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1998",ortofotoBlancINegre19941997:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1994-1997",ortofotoColor1993:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_1993",ortofotoBlancINegre19831992:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1983-1992",ortofotoBlancINegre19701977:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1970-1977",ortofotoBlancINegre1956:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1956",ortofotoBlancINegre1945:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1945",ortofotoColorSerieAnual:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_serie_anual",ortofotoInfraroigProvisional:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_provisional",ortofotoInfraroig2022:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2022",ortofotoInfraroig2021:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2021",ortofotoInfraroig2020:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2020",ortofotoInfraroig2019:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2019",ortofotoInfraroig2018:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2018",ortofotoInfraroig2017:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2017",ortofotoInfraroig2016:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2016",ortofotoInfraroig2015:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2015",ortofotoInfraroig2014:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2014",ortofotoInfraroig2013:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2013",ortofotoInfraroig2012:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2012",ortofotoInfraroig2011:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2011",ortofotoInfraroig2010:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2010",ortofotoInfraroig2009:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2009",ortofotoInfraroig2008:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2008",ortofotoInfraroig20062007:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2006-2007",ortofotoInfraroig19961997:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_1996-1997",ortofotoInfraroigSerieAnual:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_serie_anual"},VectorAdmin:{agrupacionsCensals2015:"agrupacions_censals_2015",agrupacionsCensals2016:"agrupacions_censals_2016",agrupacionsCensals2017:"agrupacions_censals_2017",agrupacionsCensals2018:"agrupacions_censals_2018",agrupacionsCensals2019:"agrupacions_censals_2019",agrupacionsCensals2020:"agrupacions_censals_2020",agrupacionsCensals2021:"agrupacions_censals_2021",agrupacionsCensalsVigent:"agrupacions_censals_vigent",agrupacionsCensalsVigentText:"agrupacions_censals_vigent_text",areesBasiquesPolicials2019:"arees_basiques_policials_2019",areesBasiquesPolicials2020:"arees_basiques_policials_2020",areesBasiquesPolicials2022:"arees_basiques_policials_2022",areesBasiquesPolicialsVigent:"arees_basiques_policials_vigent",areesBasiquesPolicialsVigentText:"arees_basiques_policials_vigent_text",areesBasiquesSalutVigent:"arees_basiques_salut_vigent",areesBasiquesServeisSocialsVigent:"arees_basiques_serveis_socials_vigent",areesBasiquesServeisSocialsVigentText:"arees_basiques_serveis_socials_vigent_text",areesGestioAssistencialVigent:"arees_gestio_assistencial_vigent",areesHidrogeologiquesAquifersVigent:"arees_hidrogeologiques_aquifers_vigent",catalunyaVigent:"catalunya_vigent",catalunyaVigentText:"catalunya_vigent_text",comarques2022:"comarques_2022",comarquesVigent:"comarques_vigent",comarquesVigentText:"comarques_vigent_text",districtesCensals2015:"districtes_censals_2015",districtesCensals2016:"districtes_censals_2016",districtesCensals2017:"districtes_censals_2017",districtesCensals2018:"districtes_censals_2018",districtesCensals2019:"districtes_censals_2019",districtesCensals2020:"districtes_censals_2020",districtesCensals2021:"districtes_censals_2021",districtesCensals2022:"districtes_censals_2022",districtesCensalsVigent:"districtes_censals_vigent",districtesCensalsVigentText:"districtes_censals_vigent_text",incendisForestalsVigent:"incendis_forestals_vigent",incendisForestalsVigentText:"incendis_forestals_vigent_text",municipis2022:"municipis_2022",municipis2022Text:"municipis_2022_text",municipisVigent:"municipis_vigent",municipisVigentText:"municipis_vigent_text",partitsJudicialsVigent:"partits_judicials_vigent",partitsJudicialsVigentText:"partits_judicials_vigent_text",plaTerritorial2015:"pla_territorial_2015",plaTerritorialVigent:"pla_territorial_vigent",plaTerritorialVigentText:"pla_territorial_vigent_text",provinciesVigent:"provincies_vigent",provinciesVigentText:"provincies_vigent_text",regionsPolicialsVigent:"regions_policials_vigent",regionsPolicialsVigentText:"regions_policials_vigent_text",regionsSanitariesVigent:"regions_sanitaries_vigent",regionsSanitariesVigentText:"regions_sanitaries_vigent_text",seccionsCensals2015:"seccions_censals_2015",seccionsCensals2016:"seccions_censals_2016",seccionsCensals2017:"seccions_censals_2017",seccionsCensals2018:"seccions_censals_2018",seccionsCensals2019:"seccions_censals_2019",seccionsCensals2020:"seccions_censals_2020",seccionsCensals2021:"seccions_censals_2021",seccionsCensals2022:"seccions_censals_2022",seccionsCensalsVigent:"seccions_censals_vigent",seccionsCensalsVigentText:"seccions_censals_vigent_text",sectorsSanitarisVigent:"sectors_sanitaris_vigent",vegueriesVigent:"vegueries_vigent",vegueriesVigentText:"vegueries_vigent_text"},WMS:{espaisInteresGeologic:"https://geoserveis.icgc.cat/servei/catalunya/espais-interes-geologic/wms/service?&service=WMS&request=GetMap&layers=espais-interes-geologic&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}",gravimetriaBouguer500000:"https://geoserveis.icgc.cat/servei/catalunya/gravimetria/wms/service?&service=WMS&request=GetMap&layers=anomalia_bouguer_500000&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}",cobertesSol2018:"https://geoserveis.icgc.cat/servei/catalunya/cobertes-sol/wms/service?&service=WMS&request=GetMap&layers=cobertes_2018&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}",administratiu:"http://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/administratiu/MON3857NW/{z}/{x}/{y}.png",simplificat:"http://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/simplificat/MON3857NW/{z}/{x}/{y}.png",cims:"https://geoserveis.icgc.cat/icc_100cims/wms/service?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=0&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:25831&BBOX=137118.923076923,4488408.75,650959.076923077,4749634.75&WIDTH=895&HEIGHT=455",cobertesSol:"http://geoserveis.icgc.cat/servei/catalunya/cobertes-sol/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=cobertes_2009&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&CRS=EPSG:25831&BBOX=374110.828167253,4639230.79853085,452621.120632226,4703578.45000215&WIDTH=1020&HEIGHT=836"},FGBAdmin:{agrupacionsCensalsVigent:"https://tilemaps.icgc.cat/vector/fgb/agrupacions_censals_vigent.fgb",agrupacionsCensalsVigentText:"https://tilemaps.icgc.cat/vector/fgb/agrupacions_censals_vigent_text.fgb",areesBasiquesPolicialsVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_policials_vigent.fgb",areesBasiquesPolicialsVigentText:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_policials_vigent_text.fgb",areesBasiquesSalutVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_salut_vigent.fgb",areesBasiquesServeisSocialsVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_serveis_socials_vigent.fgb",areesBasiquesServeisSocialsVigentText:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_serveis_socials_vigent_text.fgb",areesGestioAssistencialVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_gestio_assistencial_vigent.fgb",areesHidrogeologiquesAquifersVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_hidrogeologiques_aquifers_vigent.fgb",catalunyaVigent:"https://tilemaps.icgc.cat/vector/fgb/catalunya_vigent.fgb",catalunyaVigentText:"https://tilemaps.icgc.cat/vector/fgb/catalunya_vigent_text.fgb",comarquesVigent:"https://tilemaps.icgc.cat/vector/fgb/comarques_vigent.fgb",comarquesVigentText:"https://tilemaps.icgc.cat/vector/fgb/comarques_vigent_text.fgb",districtesCensalsVigent:"https://tilemaps.icgc.cat/vector/fgb/districtes_censals_vigent.fgb",districtesCensalsVigentText:"https://tilemaps.icgc.cat/vector/fgb/districtes_censals_vigent_text.fgb",incendisForestalsVigent:"https://tilemaps.icgc.cat/vector/fgb/incendis_forestals_vigent.fgb",incendisForestalsVigentText:"https://tilemaps.icgc.cat/vector/fgb/incendis_forestals_vigent_text.fgb",municipisVigent:"https://tilemaps.icgc.cat/vector/fgb/municipis_vigent.fgb",municipisVigentText:"https://tilemaps.icgc.cat/vector/fgb/municipis_vigent_text.fgb",partitsJudicialsVigent:"https://tilemaps.icgc.cat/vector/fgb/partits_judicials_vigent.fgb",partitsJudicialsVigentText:"https://tilemaps.icgc.cat/vector/fgb/partits_judicials_vigent_text.fgb",plaTerritorialVigent:"https://tilemaps.icgc.cat/vector/fgb/pla_territorial_vigent.fgb",plaTerritorialVigentText:"https://tilemaps.icgc.cat/vector/fgb/pla_territorial_vigent_text.fgb",provinciesVigent:"https://tilemaps.icgc.cat/vector/fgb/provincies_vigent.fgb",provinciesVigentText:"https://tilemaps.icgc.cat/vector/fgb/provincies_vigent_text.fgb",regionsPolicialsVigent:"https://tilemaps.icgc.cat/vector/fgb/regions_policials_vigent.fgb",regionsPolicialsVigentText:"https://tilemaps.icgc.cat/vector/fgb/regions_policials_vigent_text.fgb",regionsSanitariesVigent:"https://tilemaps.icgc.cat/vector/fgb/regions_sanitaries_vigent.fgb",regionsSanitariesVigentText:"https://tilemaps.icgc.cat/vector/fgb/regions_sanitaries_vigent_text.fgb",seccionsCensalsVigent:"https://tilemaps.icgc.cat/vector/fgb/seccions_censals_vigent.fgb",seccionsCensalsVigentText:"https://tilemaps.icgc.cat/vector/fgb/seccions_censals_vigent_text.fgb",sectorsSanitarisVigent:"https://tilemaps.icgc.cat/vector/fgb/sectors_sanitaris_vigent.fgb",vegueriesVigent:"https://tilemaps.icgc.cat/vector/fgb/vegueries_vigent.fgb",vegueriesVigentText:"https://tilemaps.icgc.cat/vector/fgb/vegueries_vigent_text.fgb"},Vector:{cobertes2018:"https://tilemaps.icgc.cat/tileserver/cobertes_tilejson.json"}};let Rne=class{constructor(e){if(!e)e=rn.mapOptions;else for(const t in rn.mapOptions){let r=[rn.mapOptions.center[0],rn.mapOptions.center[1]];rn.mapOptions.center=r,e.hasOwnProperty(t)||(e[t]=rn.mapOptions[t])}e.maxPitch=85,e.maplibreLogo=!1,e.attributionControl=!1,this.map=new nl.Map(e),this.map.options=e,this.map.addControl(new nl.AttributionControl({compact:!0})),this.map.on("load",async()=>{const t=this.map.getStyle().name,r=this.map.options.style;if(window.document.querySelector(".maplibregl-compact-show")){var n=window.document.querySelector(".maplibregl-compact-show");n.classList.remove("maplibregl-compact-show")}this.map.addControl(new Mne({color:r.indexOf("orto")===-1}),"bottom-left"),this._dealOrto3dStyle(t)})}addGeocoderICGC(e){try{e===void 0&&(e="top-right");let t={collapsed:!0,marker:!0,popup:!0,showResultMarkers:!0,maplibregl:nl,showResultsWhileTyping:!0,minLength:2};const r={forwardGeocode:async o=>{const l=[];try{const s=rn.geocoder.peliasUrl1+encodeURIComponent(o.query)+rn.geocoder.peliasUrl2,v=await(await fetch(s)).json();for(const T of v.features){const F=T.geometry.coordinates,R={type:"Feature",geometry:{type:"Point",coordinates:F},place_name:T.properties.label,properties:T.properties,text:T.properties.label,place_type:["place"],center:F};l.push(R)}}catch(s){console.error(`Failed to forwardGeocode with error: ${s}`)}return{features:l}}};this.map.addControl(new Lne(r,t),e);let n=document.getElementsByClassName("maplibregl-ctrl-geocoder--input");n[0].attributes[2].nodeValue="Cerca...",n[0].addEventListener("input",function(o){o.target.value.length>3})}catch(t){console.error(`Error adding ICGC geocoder: ${t.message}`)}}getStyle(){try{return this.map.getStyle()}catch(e){console.error(`Error getting style: ${e.message}`)}}async loadImage(e){try{return this.map.loadImage(e)}catch(t){console.error(`Error getting loadImage: ${t.message}`)}}addImage(e,t){try{return this.map.addImage(e,t)}catch(r){console.error(`Error getting addImage: ${r.message}`)}}getConfigStyles(){try{let e=[];for(const t of Dg)e.push(t.name);return e}catch(e){console.error(`Error retrieving base styles: ${e.message}`)}}getConfigWMSLayers(){try{let e=[];for(const t in so.WMS)so.WMS.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving WMS layers: ${e.message}`)}}getConfigOrtoLayers(){try{let e=[];for(const t in so.Orto)so.Orto.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving orto image layers: ${e.message}`)}}getConfigVectorLayers(){try{let e=[];for(const t in so.Vector)so.Vector.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving vector layers: ${e.message}`)}}getConfigVectorAdminLayers(){try{let e=[];for(const t in so.VectorAdmin)so.VectorAdmin.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving vectorAdmin layers: ${e.message}`)}}getConfigFGBAdminLayers(){try{let e=[];for(const t in so.FGBAdmin)so.FGBAdmin.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving FGBAdmin layers: ${e.message}`)}}async fetchData(e,t,r,n){try{if(e.includes(".fgb"))this.addFGBLayerICGC(e,r,null,n);else{const l=await(await fetch(e)).json();let s=t,g="";r==="labels"&&(g=this._firstSymbolLayer()),r==="lines"&&(g=this._firstLineLayer());let v=l.features[0].geometry.type;v.includes("ine")&&(n!==void 0?map.addLayer({id:s,type:"line",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:n},g):map.addLayer({id:s,type:"line",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:{"line-color":"black","line-width":2,"line-opacity":1}},g)),v.includes("olygon")&&(n!==void 0?map.addLayer({id:s,type:"fill",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:n},g):map.addLayer({id:s,type:"fill",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:{"fill-color":"blue","fill-opacity":.6}},g)),v.includes("oint")&&(n!==void 0?map.addLayer({id:s,type:"circle",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:n},g):map.addLayer({id:s,type:"circle",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:{"circle-color":"red","circle-opacity":.85}},g))}}catch(o){console.error(`Error fetching data: ${o.message}`)}}async fetchDataAndMenu(e,t,r,n,o){try{const l=document.getElementById("menu-group");let s="visible",g="";n==="labels"&&(g=this._firstSymbolLayer()),n==="lines"&&(g=this._firstLineLayer());let v;if(e.includes(".fgb")){let R=function(U){for(const J in so.FGBAdmin)if(so.FGBAdmin.hasOwnProperty(J)&&so.FGBAdmin[J]===U)return J;return null}(e);if(R===null)console.log("❌ %c The layer: %c%s%c does not exist in the ICGC DB. Consult the documentation.","font-weight: bold; font-style: italic;","font-weight: normal; font-style: normal; color: red;",R,"font-weight: bold; font-style: italic;");else{const U=await fetch(e),J={type:"FeatureCollection",features:[]};for await(const Ae of ZI(U.body))J.features.push(Ae);v=J;let te=R;if(this.map.addSource(te,{type:"geojson",data:J}),e.includes("text"))this.map.addLayer({id:R,type:"symbol",source:te,layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[8,0],[12,14],[15,15]]},"text-font":["FiraSans-Regular"],"text-field":["get","NOM_AC"],"text-transform":"none","text-max-width":25,visibility:s,"text-justify":"right","text-anchor":"top","text-allow-overlap":!1,"symbol-spacing":2,"text-line-height":1},paint:{"text-halo-blur":.5,"text-color":"rgba(90, 7, 7, 1)","text-halo-width":2,"text-halo-color":"rgba(255, 255, 255,0.8)"}},g);else{let Ae=R+"Text";this.map.addLayer({id:Ae,type:"symbol",source:te,layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[8,0],[12,14],[15,15]]},"text-font":["FiraSans-Regular"],"text-field":["get","NOM_AC"],"text-transform":"none","text-max-width":25,visibility:s,"text-justify":"right","text-anchor":"top","text-allow-overlap":!1,"symbol-spacing":2,"text-line-height":1},paint:{"text-halo-blur":.5,"text-color":"rgba(90, 7, 7, 1)","text-halo-width":2,"text-halo-color":"rgba(255, 255, 255,0.8)"}},g)}}}else v=await(await fetch(e)).json();if(r!=="all"){const F=document.createElement("div");F.id="titleDivMenu",F.textContent=t,l.appendChild(F);const R=document.createElement("div");R.id="titleDivMenuSub",R.textContent=`📂 ${r}`,l.appendChild(R)}let T=v.features[0].geometry.type;if(r==="all")T.includes("ine")&&(o!==void 0?map.addLayer({id:t,type:"line",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:o},g):map.addLayer({id:t,type:"line",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:{"line-color":"black","line-width":2,"line-opacity":1}},g)),T.includes("olygon")&&(o!==void 0?this.map.addLayer({id:t,type:"fill",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:o},g):this.map.addLayer({id:t,type:"fill",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:{"fill-color":"#0000FF","fill-opacity":0}},g)),T.includes("oint")&&(o!==void 0?map.addLayer({id:t,type:"circle",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:o},g):map.addLayer({id:t,type:"circle",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:{"circle-color":"red","circle-opacity":.85}},g)),console.log("itemSensefiltre",t),map.addMenuItem(t);else{let F=r;const R={};v.features.forEach(U=>{const J=U.properties[F],te=J+"-userFieldFilter-"+t;J!==null&&(R[te]||(T.includes("ine")&&(o!==void 0?map.addLayer({id:te,type:"line",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:o},g):map.addLayer({id:te,type:"line",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:{"line-color":"black","line-width":2,"line-opacity":1}},g)),T.includes("olygon")&&(o!==void 0?map.addLayer({id:te,type:"fill",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:o},g):map.addLayer({id:te,type:"fill",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:{"fill-color":"blue","fill-opacity":.6}},g)),T.includes("oint")&&(o!==void 0?map.addLayer({id:te,type:"circle",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:o},g):map.addLayer({id:te,type:"circle",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:{"circle-color":"red","circle-opacity":.85}},g)),R[te]=!0,map.addMenuItem(te)))})}}catch(l){console.error(`Error fetching data: ${l.message}`)}}on(e,t){try{this.map.on(e,t)}catch(r){console.error(`Error adding event listener: ${r.message}`)}}getSource(e){try{return this.map.getSource(e)}catch(t){console.error(`Error getting source: ${t.message}`)}}addSource(e,t){try{this.map.addSource(e,t)}catch(r){console.error(`Error adding source: ${r.message}`)}}setStyle(e,t){try{t!==void 0?this.map.setStyle(e,t):this.map.setStyle(e),this.map.on("styledata",()=>{if(window.document.querySelector(".maplibregl-compact-show")){var r=window.document.querySelector(".maplibregl-compact-show");r.classList.remove("maplibregl-compact-show")}this._dealOrto3dStyle(this.map.getStyle().name)})}catch(r){console.error(`Error setting style: ${r.message}`)}}getLayer(e){try{return this.map.getLayer(e)}catch(t){console.error(`Error getting layer: ${t.message}`)}}setFilter(e,t,r){try{return this.map.setFilter(e,t,r)}catch(n){console.error(`Error setting filter: ${n.message}`)}}jumpTo(e){try{this.map.jumpTo(e)}catch(t){console.error(`Error jumping to ${e}: ${t.message}`)}}setLayoutProperty(e,t,r){try{this.map.setLayoutProperty(e,t,r)}catch(n){console.error(`Error setting layout property: ${n.message}`)}}setPaintProperty(e,t,r){try{this.map.setPaintProperty(e,t,r)}catch(n){console.error(`Error setting paint property: ${n.message}`)}}addControl(e,t){try{t===void 0&&(t="top-right"),this.map.addControl(e,t)}catch(r){console.error(`Error adding control: ${r.message}`)}}getZoom(){try{return this.map.getZoom()}catch(e){console.error(`Error getting zoom level: ${e.message}`)}}addMouseCoordControl(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"bottom-left";try{this.map.addControl(new Dne(e),t)}catch(r){console.error(`Error adding mouse coordinate control: ${r.message}`)}}addGeolocateControl(e,t){try{t===void 0&&(t="top-right"),e===void 0?this.map.addControl(new nl.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0}),t):this.map.addControl(new nl.GeolocateControl(e),t)}catch(r){console.error(`Error adding geolocate control: ${r.message}`)}}addFullscreenControl(){try{this.map.addControl(new nl.FullscreenControl)}catch(e){console.error(`Error adding fullscreen control: ${e.message}`)}}getBounds(){try{return this.map.getBounds()}catch(e){console.error(`Error getting bounds: ${e.message}`)}}getCenter(){try{return this.map.getCenter()}catch(e){console.error(`Error getting center: ${e.message}`)}}setTerrain(e){try{return this.map.setTerrain(e)}catch(t){console.error(`Error setting terrain: ${t.message}`)}}setLayerZoomRange(e,t,r){try{return this.map.setLayerZoomRange(e,t,r)}catch(n){console.error(`Error setting terrain: ${n.message}`)}}getCanvas(){try{return this.map.getCanvas()}catch(e){console.error(`Error getting canvas: ${e.message}`)}}setCenter(e){try{return this.map.setCenter(e)}catch(t){console.error(`Error setting center: ${t.message}`)}}addLayer(e,t){try{this.map.addLayer(e,t)}catch(r){console.error(`Error adding layer: ${r.message}`)}}addLayerGeoJSON(e){try{this.map.addSource(`${e.id}`,{type:"geojson",data:e.data}),this.map.addLayer({id:`${e.id}-layerIcgcMap`,type:e.layerType,source:`${e.id}`,layout:e.layout,paint:e.paint},this._firstSymbolLayer())}catch(t){console.error(`Error adding GeoJSON layer: ${t.message}`)}}addLayerWMS(e,t){try{let r="";t==="labels"&&(r=this._firstSymbolLayer()),t==="lines"&&(r=this._firstLineLayer()),this.map.addSource(`${e.id}`,{type:"raster",tiles:[e.tiles],tileSize:256},r),this.map.addLayer({id:`${e.id}-layerIcgcMap`,type:"raster",source:`${e.id}`,paint:{}},r)}catch(r){console.error(`Error adding WMS layer: ${r.message}`)}}removeControl(e){try{this.map.removeControl(e)}catch(t){console.error(`Error removing control: ${t.message}`)}}removeLayer(e){try{this.map.removeLayer(e)}catch(t){console.error(`Error removing layer: ${t.message}`)}}removeSource(e){try{this.map.removeSource(e)}catch(t){console.error(`Error removing source: ${t.message}`)}}addLogo(e){try{const t=document.createElement("img");t.src=e.url,t.style.height="62px";const r=document.getElementById("logos"),n=document.createElement("a");n.id=e.id,n.href=e.href,n.target="_blank",n.style.position="relative",n.style.bottom="1px",n.appendChild(t),r.appendChild(n)}catch(t){console.error(`Error adding logo: ${t.message}`)}}addBasemapsICGC(e){try{const t=n=>{map.setStyle(n)},r=document.getElementById("basemap-group");for(const n of e)for(const o of Object.keys(rn.baseStyles)){const l=rn.baseStyles[o];if(n===l.url){const s=document.createElement("div");s.className="basemap-item",s.title=l.key,s.style.backgroundImage=`url('${l.image}')`,r.appendChild(s),s.addEventListener("click",()=>t(l.url))}}}catch(t){console.error(`Error adding basemaps: ${t.message}`)}}addBasemaps(e){try{const t=n=>{console.log("base",n),map.setStyle(n.url)},r=document.getElementById("basemap-group");e.forEach(n=>{const o=document.createElement("div");o.className="basemap-item",o.title=n.label,o.style.backgroundImage=`url('${n.image}')`,r.appendChild(o),o.addEventListener("click",()=>t(n))})}catch(t){console.error(`Error adding basemaps: ${t.message}`)}}addFeatureQuery(e,t,r){try{let n;console.log("layer",e,t,r),this.map.on("mouseenter",e,()=>{this.map.getCanvas().style.cursor="pointer"}),this.map.on("mouseleave",e,()=>{this.map.getCanvas().style.cursor=""}),this.map.on("click",o=>{let l=this.map.queryRenderedFeatures(o.point);if(l&&l[0].source.includes(e)){let s=[o.lngLat.lng,o.lngLat.lat];if(t!==void 0&&t.length>0&&t!=="all"){if(t!==null){let g="";t.forEach(v=>{let T=l[0].properties[v];g=g+`<h4>${T}</h4>`}),n=g,map.addPopup(s,n,r)}}else{let g="";for(const v in l[0].properties)g+="<b>"+v+"</b>:"+l[0].properties[v]+"<br>";n=g,map.addPopup(s,n,r)}}})}catch(n){console.error(`Error adding feature query: ${n.message}`)}}addScaleControl(e,t){try{var r=new nl.ScaleControl(e);this.map.addControl(r,t)}catch(n){console.error(`Error adding scale: ${n.message}`)}}addExportControl(e,t){try{typeof e=="string"&&(t=e,e=void 0),e===void 0&&(e={PageSize:Mg.A4,PageOrientation:Gy.Landscape,Format:bd.PNG,DPI:RC[300],Crosshair:!0,PrintableArea:!0},t="top-right"),map.addControl(new zre(e),t)}catch(r){console.error(`Error adding export control: ${r.message}`)}}addPopup(e,t){try{new nl.Popup().setLngLat(e).setHTML(t).addTo(this.map)}catch{}}addMarker(e){try{let t,r;return e.text===void 0?t=new nl.Marker(e.options).setLngLat(e.coord).addTo(this.map):(r=new nl.Popup({offset:e.textOffset}).setText(e.text),t=new nl.Marker().setLngLat(e.coord).setPopup(r).addTo(this.map)),t}catch(t){return console.error(`Error adding marker: ${t.message}`),null}}addPopup(e,t,r){try{return console.log("popupstyle",r),r.image===void 0?new nl.Popup().setLngLat(e).setHTML(`
|
|
3156
|
+
</svg>`,s=document.createElement("a");s.href=`data:application/xml,${encodeURIComponent(l)}`,s.download=t,s.click(),s.remove()}toPixels(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:96;return this.unit===Hy.mm&&(t/=25.4),`${t*e}px`}toBlob(e){const t=atob(e.replace(/^.*,/,"")),r=new Uint8Array(t.length);for(let n=0;n<t.length;n+=1)r[n]=t.charCodeAt(n);return new Blob([r.buffer],{type:"image/png"})}},Ire=class{constructor(e){Is(this,"map"),Is(this,"width"),Is(this,"height"),Is(this,"unit"),Is(this,"svgCanvas"),Is(this,"svgPath");var t,r,n;if(this.map=e,this.map===void 0)return;this.mapResize=this.mapResize.bind(this),this.map.on("resize",this.mapResize);const o=(t=this.map)==null?void 0:t.getCanvas().clientWidth,l=(r=this.map)==null?void 0:r.getCanvas().clientHeight,s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.setAttribute("width",`${o}px`),s.setAttribute("height",`${l}px`);const g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("style","fill:#888888;stroke-width:0"),g.setAttribute("fill-opacity","0.5"),s.append(g),(n=this.map)==null||n.getCanvasContainer().appendChild(s),this.svgCanvas=s,this.svgPath=g}mapResize(){this.generateCutOut()}updateArea(e,t){this.width=e,this.height=t,this.unit=Hy.mm,this.generateCutOut()}generateCutOut(){var e,t;if(this.map===void 0||this.svgCanvas===void 0||this.svgPath===void 0)return;const r=this.toPixels(this.width),n=this.toPixels(this.height),o=(e=this.map)==null?void 0:e.getCanvas().clientWidth,l=(t=this.map)==null?void 0:t.getCanvas().clientHeight,s=o/2-r/2,g=s+r,v=l/2-n/2,T=v+n;this.svgCanvas.setAttribute("width",`${o}px`),this.svgCanvas.setAttribute("height",`${l}px`),this.svgPath.setAttribute("d",`M 0 0 L ${o} 0 L ${o} ${l} L 0 ${l} M ${s} ${v} L ${s} ${T} L ${g} ${T} L ${g} ${v}`)}destroy(){this.svgCanvas!==void 0&&(this.svgCanvas.remove(),this.svgCanvas=void 0),this.map!==void 0&&(this.map=void 0)}toPixels(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:96;return this.unit===Hy.mm&&(t/=25.4),t*e}};const J4={PageSize:"Page Size",PageOrientation:"Page Orientation",Format:"Format",DPI:"DPI",Generate:"Generate"},Lre={PageSize:"Taille de page",PageOrientation:"Orientation de la page",Format:"Format",DPI:"DPI",Generate:"Générer"},Mre={PageSize:"Sivukoko",PageOrientation:"Sivun suunta",Format:"Muoto",DPI:"DPI",Generate:"Generoi"},Pre={PageSize:"Papierformat",PageOrientation:"Papierausrichtung",Format:"Dateiformat",DPI:"Druckauflösung",Generate:"Erstellen"},Fre={PageSize:"Sidstorlek",PageOrientation:"Sidorientering",Format:"Format",DPI:"DPI",Generate:"Generera"},Dre={PageSize:"Tamaño de página",PageOrientation:"Orientación de página",Format:"Formato",DPI:"DPI",Generate:"Generar"},Rre={PageSize:"Kích thước trang",PageOrientation:"Loại trang",Format:"Định dạng",DPI:"Mật độ điểm ảnh (DPI)",Generate:"Tạo"},kre={PageSize:"Розмір сторінки",PageOrientation:"Орієнтація сторінки",Format:"Формат",DPI:"DPI",Generate:"Згенерувати"},Ore={PageSize:"页面大小",PageOrientation:"页面方向",Format:"格式",DPI:"像素",Generate:"导出"},Ure={PageSize:"頁面大小",PageOrientation:"頁面方向",Format:"格式",DPI:"像素",Generate:"導出"},Nre={PageSize:"ページサイズ",PageOrientation:"ページ方向",Format:"フォーマット",DPI:"DPI(解像度)",Generate:"出力"};let zre=class{constructor(e){Is(this,"controlContainer"),Is(this,"exportContainer"),Is(this,"crosshair"),Is(this,"printableArea"),Is(this,"map"),Is(this,"exportButton"),Is(this,"options",{PageSize:Mg.A4,PageOrientation:Gy.Landscape,Format:bd.PDF,DPI:RC[300],Crosshair:!1,PrintableArea:!1,Local:"en",AllowedSizes:Object.keys(Mg),Filename:"map"}),e&&(this.options=Object.assign(this.options,e)),this.onDocumentClick=this.onDocumentClick.bind(this)}getDefaultPosition(){return"top-right"}getTranslation(){switch(this.options.Local){case"de":return Pre;case"en":return J4;case"fr":return Lre;case"fi":return Mre;case"sv":return Fre;case"es":return Dre;case"vi":return Rre;case"uk":return kre;case"zhHans":return Ore;case"zhHant":return Ure;case"ja":return Nre;default:return J4}}onAdd(e){var t;this.map=e,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("maplibregl-ctrl"),this.controlContainer.classList.add("maplibregl-ctrl-group"),this.exportContainer=document.createElement("div"),this.exportContainer.classList.add("maplibregl-export-list"),this.exportButton=document.createElement("button"),this.exportButton.classList.add("maplibregl-ctrl-icon"),this.exportButton.classList.add("maplibregl-export-control"),this.exportButton.type="button",this.exportButton.addEventListener("click",()=>{this.exportButton.style.display="none",this.exportContainer.style.display="block",this.toggleCrosshair(!0),this.togglePrintableArea(!0)}),document.addEventListener("click",this.onDocumentClick),this.controlContainer.appendChild(this.exportButton),this.controlContainer.appendChild(this.exportContainer);const r=document.createElement("TABLE");r.className="print-table";const n={};(t=this.options.AllowedSizes)==null||t.forEach(T=>{Mg[T]&&(n[T]=Mg[T])});const o=this.createSelection(n,this.getTranslation().PageSize,"page-size",this.options.PageSize,(T,F)=>JSON.stringify(T[F]));r.appendChild(o);const l=this.createSelection(Gy,this.getTranslation().PageOrientation,"page-orientation",this.options.PageOrientation,(T,F)=>T[F]);r.appendChild(l);const s=this.createSelection(bd,this.getTranslation().Format,"format-type",this.options.Format,(T,F)=>T[F]);r.appendChild(s);const g=this.createSelection(RC,this.getTranslation().DPI,"dpi-type",this.options.DPI,(T,F)=>T[F]);r.appendChild(g),this.exportContainer.appendChild(r);const v=document.createElement("button");return v.type="button",v.textContent=this.getTranslation().Generate,v.classList.add("generate-button"),v.addEventListener("click",()=>{const T=document.getElementById("mapbox-gl-export-page-size"),F=document.getElementById("mapbox-gl-export-page-orientation"),R=document.getElementById("mapbox-gl-export-format-type"),U=document.getElementById("mapbox-gl-export-dpi-type"),J=F.value;let te=JSON.parse(T.value);J===Gy.Portrait&&(te=te.reverse()),new Tre(e,te,Number(U.value),R.value,Hy.mm,this.options.Filename).generate()}),this.exportContainer.appendChild(v),this.controlContainer}createSelection(e,t,r,n,o){const l=document.createElement("label");l.textContent=t;const s=document.createElement("select");s.setAttribute("id",`mapbox-gl-export-${r}`),s.style.width="100%",Object.keys(e).forEach(F=>{const R=document.createElement("option");R.setAttribute("value",o(e,F)),R.appendChild(document.createTextNode(F)),R.setAttribute("name",r),n===e[F]&&(R.selected=!0),s.appendChild(R)}),s.addEventListener("change",()=>{this.updatePrintableArea()});const g=document.createElement("TR"),v=document.createElement("TD"),T=document.createElement("TD");return v.appendChild(l),T.appendChild(s),g.appendChild(v),g.appendChild(T),g}onRemove(){!this.controlContainer||!this.controlContainer.parentNode||!this.map||!this.exportButton||(this.exportButton.removeEventListener("click",this.onDocumentClick),this.controlContainer.parentNode.removeChild(this.controlContainer),document.removeEventListener("click",this.onDocumentClick),this.crosshair!==void 0&&(this.crosshair.destroy(),this.crosshair=void 0),this.map=void 0)}onDocumentClick(e){this.controlContainer&&!this.controlContainer.contains(e.target)&&this.exportContainer&&this.exportButton&&(this.exportContainer.style.display="none",this.exportButton.style.display="block",this.toggleCrosshair(!1),this.togglePrintableArea(!1))}toggleCrosshair(e){this.options.Crosshair===!0&&(e===!1?this.crosshair!==void 0&&(this.crosshair.destroy(),this.crosshair=void 0):(this.crosshair=new Lie(this.map),this.crosshair.create()))}togglePrintableArea(e){this.options.PrintableArea===!0&&(e===!1?this.printableArea!==void 0&&(this.printableArea.destroy(),this.printableArea=void 0):(this.printableArea=new Ire(this.map),this.updatePrintableArea()))}updatePrintableArea(){if(this.printableArea===void 0)return;const e=document.getElementById("mapbox-gl-export-page-size"),t=document.getElementById("mapbox-gl-export-page-orientation").value;let r=JSON.parse(e.value);t===Gy.Portrait&&(r=r.reverse()),this.printableArea.updateArea(r[0],r[1])}};var Y4=Vre,Qre=Object.prototype.hasOwnProperty;function Vre(){for(var i={},e=0;e<arguments.length;e++){var t=arguments[e];for(var r in t)Qre.call(t,r)&&(i[r]=t[r])}return i}var eD={exports:{}};(function(i,e){(function(){var t={};i.exports=t,t.simpleFilter=function(r,n){return n.filter(function(o){return t.test(r,o)})},t.test=function(r,n){return t.match(r,n)!==null},t.match=function(r,n,o){o=o||{};var l=0,s=[],g=n.length,v=0,T=0,F=o.pre||"",R=o.post||"",U=o.caseSensitive&&n||n.toLowerCase(),J;r=o.caseSensitive&&r||r.toLowerCase();for(var te=0;te<g;te++)J=n[te],U[te]===r[l]?(J=F+J+R,l+=1,T+=1+T):T=0,v+=T,s[s.length]=J;return l===r.length?(v=U===r?1/0:v,{rendered:s.join(""),score:v}):null},t.filter=function(r,n,o){return!n||n.length===0?[]:typeof r!="string"?n:(o=o||{},n.reduce(function(l,s,g,v){var T=s;o.extract&&(T=o.extract(s));var F=t.match(r,T,o);return F!=null&&(l[l.length]={string:F.rendered,score:F.score,index:g,original:s}),l},[]).sort(function(l,s){var g=s.score-l.score;return g||l.index-s.index}))}})()})(eD);var Hre=eD.exports,Rc=function(i){return this.component=i,this.items=[],this.active=i.options.noInitialSelection?-1:0,this.wrapper=document.createElement("div"),this.wrapper.className="suggestions-wrapper",this.element=document.createElement("ul"),this.element.className="suggestions",this.wrapper.appendChild(this.element),this.selectingListItem=!1,i.el.parentNode.insertBefore(this.wrapper,i.el.nextSibling),this};Rc.prototype.show=function(){this.element.style.display="block"},Rc.prototype.hide=function(){this.element.style.display="none"},Rc.prototype.add=function(i){this.items.push(i)},Rc.prototype.clear=function(){this.items=[],this.active=this.component.options.noInitialSelection?-1:0},Rc.prototype.isEmpty=function(){return!this.items.length},Rc.prototype.isVisible=function(){return this.element.style.display==="block"},Rc.prototype.draw=function(){if(this.element.innerHTML="",this.items.length===0){this.hide();return}for(var i=0;i<this.items.length;i++)this.drawItem(this.items[i],this.active===i);this.show()},Rc.prototype.drawItem=function(i,e){var t=document.createElement("li"),r=document.createElement("a");e&&(t.className+=" active"),r.innerHTML=i.string,t.appendChild(r),this.element.appendChild(t),t.addEventListener("mousedown",(function(){this.selectingListItem=!0}).bind(this)),t.addEventListener("mouseup",(function(){this.handleMouseUp.call(this,i)}).bind(this))},Rc.prototype.handleMouseUp=function(i){this.selectingListItem=!1,this.component.value(i.original),this.clear(),this.draw()},Rc.prototype.move=function(i){this.active=i,this.draw()},Rc.prototype.previous=function(){this.move(this.active<=0?this.items.length-1:this.active-1)},Rc.prototype.next=function(){this.move(this.active>=this.items.length-1?0:this.active+1)},Rc.prototype.drawError=function(i){var e=document.createElement("li");e.innerHTML=i,this.element.appendChild(e),this.show()};var Gre=Rc,jre=Y4,qre=Hre,$re=Gre,Rl=function(i,e,t){return t=t||{},this.options=jre({minLength:2,limit:5,filter:!0,hideOnBlur:!0,noInitialSelection:!0},t),this.el=i,this.data=e||[],this.list=new $re(this),this.query="",this.selected=null,this.list.draw(),this.el.addEventListener("keyup",(function(r){this.handleKeyUp(r.keyCode,r)}).bind(this),!1),this.el.addEventListener("keydown",(function(r){this.handleKeyDown(r)}).bind(this)),this.el.addEventListener("focus",(function(){this.handleFocus()}).bind(this)),this.el.addEventListener("blur",(function(){this.handleBlur()}).bind(this)),this.el.addEventListener("paste",(function(r){this.handlePaste(r)}).bind(this)),this.render=this.options.render?this.options.render.bind(this):this.render.bind(this),this.getItemValue=this.options.getItemValue?this.options.getItemValue.bind(this):this.getItemValue.bind(this),this};Rl.prototype.handleKeyUp=function(i,e){if(!(i===40||i===38||i===27||i===9)){if(i===13){this.list.items[this.list.active]&&(this.list.handleMouseUp(this.list.items[this.list.active]),e.stopPropagation());return}this.handleInputChange(this.el.value)}},Rl.prototype.handleKeyDown=function(i){switch(i.keyCode){case 13:this.list.active>=0&&(this.list.selectingListItem=!0);break;case 9:this.list.isEmpty()||(this.list.isVisible()&&i.preventDefault(),this.value(this.list.active>=0?this.list.items[this.list.active].original:null),this.list.hide());break;case 27:this.list.isEmpty()||this.list.hide();break;case 38:this.list.previous();break;case 40:this.list.next();break}},Rl.prototype.handleBlur=function(){!this.list.selectingListItem&&this.options.hideOnBlur&&this.list.hide()},Rl.prototype.handlePaste=function(i){if(i.clipboardData)this.handleInputChange(i.clipboardData.getData("Text"));else{var e=this;setTimeout(function(){e.handleInputChange(i.target.value)},100)}},Rl.prototype.handleInputChange=function(i){if(this.query=this.normalize(i),this.list.clear(),this.query.length<this.options.minLength){this.list.draw();return}this.getCandidates((function(e){for(var t=0;t<e.length&&(this.list.add(e[t]),t!==this.options.limit-1);t++);this.list.draw()}).bind(this))},Rl.prototype.handleFocus=function(){this.list.isEmpty()||this.list.show(),this.list.selectingListItem=!1},Rl.prototype.update=function(i){this.data=i,this.handleKeyUp()},Rl.prototype.clear=function(){this.data=[],this.list.clear()},Rl.prototype.normalize=function(i){return i=i.toLowerCase(),i},Rl.prototype.match=function(i,e){return i.indexOf(e)>-1},Rl.prototype.value=function(i){if(this.selected=i,this.el.value=this.getItemValue(i||{place_name:this.query}),document.createEvent){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.el.dispatchEvent(e)}else this.el.fireEvent("onchange")},Rl.prototype.getCandidates=function(i){var e={pre:"<strong>",post:"</strong>",extract:(function(r){return this.getItemValue(r)}).bind(this)},t;this.options.filter?(t=qre.filter(this.query,this.data,e),t=t.map((function(r){return{original:r.original,string:this.render(r.original,r.string)}}).bind(this))):t=this.data.map((function(r){var n=this.render(r);return{original:r,string:n}}).bind(this)),i(t)},Rl.prototype.getItemValue=function(i){return i},Rl.prototype.render=function(i,e){if(e)return e;for(var t=i.original?this.getItemValue(i.original):this.getItemValue(i),r=this.normalize(t),n=r.lastIndexOf(this.query);n>-1;){var o=n+this.query.length;t=t.slice(0,n)+"<strong>"+t.slice(n,o)+"</strong>"+t.slice(o),n=r.slice(0,n).lastIndexOf(this.query)}return t},Rl.prototype.renderError=function(i){this.list.drawError(i)};var Kre=Rl,tD=Kre,Wre=tD;typeof window<"u"&&(window.Suggestions=tD);var Zre="Expected a function",iD=NaN,Xre="[object Symbol]",Jre=/^\s+|\s+$/g,Yre=/^[-+]0x[0-9a-f]+$/i,ene=/^0b[01]+$/i,tne=/^0o[0-7]+$/i,ine=parseInt,rne=typeof cf=="object"&&cf&&cf.Object===Object&&cf,nne=typeof self=="object"&&self&&self.Object===Object&&self,sne=rne||nne||Function("return this")(),one=Object.prototype,ane=one.toString,lne=Math.max,cne=Math.min,kC=function(){return sne.Date.now()};function une(i,e,t){var r,n,o,l,s,g,v=0,T=!1,F=!1,R=!0;if(typeof i!="function")throw new TypeError(Zre);e=rD(e)||0,OC(t)&&(T=!!t.leading,F="maxWait"in t,o=F?lne(rD(t.maxWait)||0,e):o,R="trailing"in t?!!t.trailing:R);function U(je){var We=r,Ne=n;return r=n=void 0,v=je,l=i.apply(Ne,We),l}function J(je){return v=je,s=setTimeout(he,e),T?U(je):l}function te(je){var We=je-g,Ne=je-v,at=e-We;return F?cne(at,o-Ne):at}function Ae(je){var We=je-g,Ne=je-v;return g===void 0||We>=e||We<0||F&&Ne>=o}function he(){var je=kC();if(Ae(je))return pe(je);s=setTimeout(he,te(je))}function pe(je){return s=void 0,R&&r?U(je):(r=n=void 0,l)}function be(){s!==void 0&&clearTimeout(s),v=0,r=g=n=s=void 0}function Te(){return s===void 0?l:pe(kC())}function qe(){var je=kC(),We=Ae(je);if(r=arguments,n=this,g=je,We){if(s===void 0)return J(g);if(F)return s=setTimeout(he,e),U(g)}return s===void 0&&(s=setTimeout(he,e)),l}return qe.cancel=be,qe.flush=Te,qe}function OC(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function hne(i){return!!i&&typeof i=="object"}function Ane(i){return typeof i=="symbol"||hne(i)&&ane.call(i)==Xre}function rD(i){if(typeof i=="number")return i;if(Ane(i))return iD;if(OC(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=OC(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Jre,"");var t=ene.test(i);return t||tne.test(i)?ine(i.slice(2),t?2:8):Yre.test(i)?iD:+i}var dne=une,UC={exports:{}},Pg=typeof Reflect=="object"?Reflect:null,nD=Pg&&typeof Pg.apply=="function"?Pg.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},cv;Pg&&typeof Pg.ownKeys=="function"?cv=Pg.ownKeys:Object.getOwnPropertySymbols?cv=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:cv=function(e){return Object.getOwnPropertyNames(e)};function fne(i){console&&console.warn&&console.warn(i)}var sD=Number.isNaN||function(e){return e!==e};function xs(){xs.init.call(this)}UC.exports=xs,UC.exports.once=yne,xs.EventEmitter=xs,xs.prototype._events=void 0,xs.prototype._eventsCount=0,xs.prototype._maxListeners=void 0;var oD=10;function uv(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(xs,"defaultMaxListeners",{enumerable:!0,get:function(){return oD},set:function(i){if(typeof i!="number"||i<0||sD(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");oD=i}}),xs.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},xs.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||sD(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function aD(i){return i._maxListeners===void 0?xs.defaultMaxListeners:i._maxListeners}xs.prototype.getMaxListeners=function(){return aD(this)},xs.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var l;if(t.length>0&&(l=t[0]),l instanceof Error)throw l;var s=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw s.context=l,s}var g=o[e];if(g===void 0)return!1;if(typeof g=="function")nD(g,this,t);else for(var v=g.length,T=AD(g,v),r=0;r<v;++r)nD(T[r],this,t);return!0};function lD(i,e,t,r){var n,o,l;if(uv(t),o=i._events,o===void 0?(o=i._events=Object.create(null),i._eventsCount=0):(o.newListener!==void 0&&(i.emit("newListener",e,t.listener?t.listener:t),o=i._events),l=o[e]),l===void 0)l=o[e]=t,++i._eventsCount;else if(typeof l=="function"?l=o[e]=r?[t,l]:[l,t]:r?l.unshift(t):l.push(t),n=aD(i),n>0&&l.length>n&&!l.warned){l.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=i,s.type=e,s.count=l.length,fne(s)}return i}xs.prototype.addListener=function(e,t){return lD(this,e,t,!1)},xs.prototype.on=xs.prototype.addListener,xs.prototype.prependListener=function(e,t){return lD(this,e,t,!0)};function pne(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function cD(i,e,t){var r={fired:!1,wrapFn:void 0,target:i,type:e,listener:t},n=pne.bind(r);return n.listener=t,r.wrapFn=n,n}xs.prototype.once=function(e,t){return uv(t),this.on(e,cD(this,e,t)),this},xs.prototype.prependOnceListener=function(e,t){return uv(t),this.prependListener(e,cD(this,e,t)),this},xs.prototype.removeListener=function(e,t){var r,n,o,l,s;if(uv(t),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(o=-1,l=r.length-1;l>=0;l--)if(r[l]===t||r[l].listener===t){s=r[l].listener,o=l;break}if(o<0)return this;o===0?r.shift():gne(r,o),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,s||t)}return this},xs.prototype.off=xs.prototype.removeListener,xs.prototype.removeAllListeners=function(e){var t,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var o=Object.keys(r),l;for(n=0;n<o.length;++n)l=o[n],l!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this};function uD(i,e,t){var r=i._events;if(r===void 0)return[];var n=r[e];return n===void 0?[]:typeof n=="function"?t?[n.listener||n]:[n]:t?mne(n):AD(n,n.length)}xs.prototype.listeners=function(e){return uD(this,e,!0)},xs.prototype.rawListeners=function(e){return uD(this,e,!1)},xs.listenerCount=function(i,e){return typeof i.listenerCount=="function"?i.listenerCount(e):hD.call(i,e)},xs.prototype.listenerCount=hD;function hD(i){var e=this._events;if(e!==void 0){var t=e[i];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}xs.prototype.eventNames=function(){return this._eventsCount>0?cv(this._events):[]};function AD(i,e){for(var t=new Array(e),r=0;r<e;++r)t[r]=i[r];return t}function gne(i,e){for(;e+1<i.length;e++)i[e]=i[e+1];i.pop()}function mne(i){for(var e=new Array(i.length),t=0;t<e.length;++t)e[t]=i[t].listener||i[t];return e}function yne(i,e){return new Promise(function(t,r){function n(l){i.removeListener(e,o),r(l)}function o(){typeof i.removeListener=="function"&&i.removeListener("error",n),t([].slice.call(arguments))}dD(i,e,o,{once:!0}),e!=="error"&&_ne(i,n,{once:!0})})}function _ne(i,e,t){typeof i.on=="function"&&dD(i,"error",e,t)}function dD(i,e,t,r){if(typeof i.on=="function")r.once?i.once(e,t):i.on(e,t);else if(typeof i.addEventListener=="function")i.addEventListener(e,function n(o){r.once&&i.removeEventListener(e,n),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}var fD=UC.exports,vne={fr:{name:"France",bbox:[[-4.59235,41.380007],[9.560016,51.148506]]},us:{name:"United States",bbox:[[-171.791111,18.91619],[-66.96466,71.357764]]},ru:{name:"Russia",bbox:[[19.66064,41.151416],[190.10042,81.2504]]},ca:{name:"Canada",bbox:[[-140.99778,41.675105],[-52.648099,83.23324]]}},bne={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"},xne={placeholder:bne},pD={exports:{}};(function(i){(function(e,t,r){i.exports?i.exports=r():e[t]=r()})(cf,"subtag",function(){var e="",t=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function r(g){return g.match(t)||[]}function n(g){return r(g).filter(function(v,T){return v&&T})}function o(g){return g=r(g),{language:g[1]||e,extlang:g[2]||e,script:g[3]||e,region:g[4]||e}}function l(g,v,T){Object.defineProperty(g,v,{value:T,enumerable:!0})}function s(g,v,T){function F(R){return r(R)[g]||e}l(F,"pattern",v),l(o,T,F)}return s(1,/^[a-zA-Z]{2,3}$/,"language"),s(2,/^[a-zA-Z]{3}$/,"extlang"),s(3,/^[a-zA-Z]{4}$/,"script"),s(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),l(o,"split",n),o})})(pD);var wne=pD.exports,Bne=Wre,Cne=dne,au=Y4,Ene=fD.EventEmitter,gD=vne,Sne=xne,Tne=wne;function mD(i,e){this._eventEmitter=new Ene,this.options=au({},this.options,e),this.inputString="",this.fresh=!0,this.lastSelected=null,this.geocoderApi=i}mD.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,showResultsWhileTyping:!1,minLength:2,reverseGeocode:!1,limit:5,enableEventLogging:!0,marker:!0,popup:!1,maplibregl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,getItemValue:function(i){return i.text!==void 0?i.text:i.place_name},render:function(i){if(i.geometry){var s=i.place_name.split(",");return'<div class="mapboxgl-ctrl-geocoder--result maplibregl-ctrl-geocoder--result"><svg class="mapboxgl-ctrl-geocoder--result-icon maplibre-ctrl-geocoder--result-icon" viewBox="0 0 24 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.36571 0 0 5.38676 0 12.0471C0 21.0824 12 32 12 32C12 32 24 21.0824 24 12.0471C24 5.38676 18.6343 0 12 0ZM12 16.3496C9.63428 16.3496 7.71429 14.4221 7.71429 12.0471C7.71429 9.67207 9.63428 7.74454 12 7.74454C14.3657 7.74454 16.2857 9.67207 16.2857 12.0471C16.2857 14.4221 14.3657 16.3496 12 16.3496Z" fill="#687078"/></svg><div><div class="mapboxgl-ctrl-geocoder--result-title maplibregl-ctrl-geocoder--result-title">'+s[0]+'</div><div class="mapboxgl-ctrl-geocoder--result-address maplibregl-ctrl-geocoder--result-address">'+s.splice(1,s.length).join(",")+"</div></div></div>"}else{var e=i.text,t=e.toLowerCase().indexOf(this.query.toLowerCase()),r=this.query.length,n=e.substring(0,t),o=e.substring(t,t+r),l=e.substring(t+r);return'<div class="mapboxgl-ctrl-geocoder--suggestion maplibregl-ctrl-geocoder--suggestion"><svg class="mapboxgl-ctrl-geocoder--suggestion-icon maplibre-ctrl-geocoder--suggestion-icon" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M22.8702 20.1258H21.4248L20.9125 19.6318C22.7055 17.546 23.785 14.8382 23.785 11.8925C23.785 5.32419 18.4608 0 11.8925 0C5.32419 0 0 5.32419 0 11.8925C0 18.4608 5.32419 23.785 11.8925 23.785C14.8382 23.785 17.546 22.7055 19.6318 20.9125L20.1258 21.4248V22.8702L29.2739 32L32 29.2739L22.8702 20.1258ZM11.8925 20.1258C7.33676 20.1258 3.65923 16.4483 3.65923 11.8925C3.65923 7.33676 7.33676 3.65923 11.8925 3.65923C16.4483 3.65923 20.1258 7.33676 20.1258 11.8925C20.1258 16.4483 16.4483 20.1258 11.8925 20.1258Z" fill="#687078"/></svg><div class="mapboxgl-ctrl-geocoder--suggestion-info maplibregl-ctrl-geocoder--suggestion-info"><div class="mapboxgl-ctrl-geocoder--suggestion-title maplibregl-ctrl-geocoder--suggestion-title">'+n+'<span class="mapboxgl-ctrl-geocoder--suggestion-match maplibregl-ctrl-geocoder--suggestion-match">'+o+"</span>"+l+"</div></div></div>"}},popupRender:function(i){var e=i.place_name.split(",");return'<div class="mapboxgl-ctrl-geocoder--suggestion maplibre-ctrl-geocoder--suggestion popup-suggestion"><div class="mapboxgl-ctrl-geocoder--suggestion-title maplibre-ctrl-geocoder--suggestion-title popup-suggestion-title">'+e[0]+'</div><div class="mapboxgl-ctrl-geocoder--suggestion-address maplibre-ctrl-geocoder--suggestion-address popup-suggestion-address">'+e.splice(1,e.length).join(",")+"</div></div>"},showResultMarkers:!0,debounceSearch:200},addTo:function(i){function e(r,n){if(!document.body.contains(n))throw new Error("Element provided to #addTo() exists, but is not in the DOM");var o=r.onAdd();n.appendChild(o)}if(i._controlContainer)i.addControl(this);else if(i instanceof HTMLElement)e(this,i);else if(typeof i=="string"){var t=document.querySelectorAll(i);if(t.length===0)throw new Error("Element ",i,"not found.");if(t.length>1)throw new Error("Geocoder can only be added to a single html element");e(this,t[0])}else throw new Error("Error: addTo must be a maplibre-gl-js map, an html element, or a CSS selector query for a single html element")},onAdd:function(i){if(i&&typeof i!="string"&&(this._map=i),this.setLanguage(),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);var e=this.container=document.createElement("div");e.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl";var t=this.createIcon("search",'<path d="M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"/>');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input maplibregl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",Cne(this._onKeyDown,this.options.debounceSearch)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton);var r=document.createElement("div");r.classList.add("mapboxgl-ctrl-geocoder--pin-right","maplibregl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button maplibregl-ctrl-geocoder--button";var n=this.createIcon("close",'<path d="M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"/>');return this._clearEl.appendChild(n),this._loadingEl=this.createIcon("loading",'<path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"/><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"/>'),r.appendChild(this._clearEl),r.appendChild(this._loadingEl),e.appendChild(t),e.appendChild(this._inputEl),e.appendChild(r),this._typeahead=new Bne(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit,noInitialSelection:!0}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this.resultMarkers=[],this._handleMarker=this._handleMarker.bind(this),this._handleResultMarkers=this._handleResultMarkers.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._maplibregl=this.options.maplibregl,!this._maplibregl&&this.options.marker&&(console.error("No maplibregl detected in options. Map markers are disabled. Please set options.maplibregl."),this.options.marker=!1)),e},createIcon:function(i,e){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");if(t.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+i+" maplibregl-ctrl-geocoder--icon maplibregl-ctrl-geocoder--icon-"+i),t.setAttribute("viewBox","0 0 18 18"),t.setAttribute("xml:space","preserve"),t.setAttribute("width",18),t.setAttribute("height",18),"innerHTML"in t)t.innerHTML=e;else{var r=document.createElement("div");r.innerHTML="<svg>"+e.valueOf().toString()+"</svg>";var n=r.firstChild,o=n.firstChild;t.appendChild(o)}return t},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_onPaste:function(i){var e=(i.clipboardData||window.clipboardData).getData("text");e.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(e)},_onKeyDown:function(i){var e=27,t=9;if(i.keyCode===e&&this.options.clearAndBlurOnEsc)return this._clear(i),this._inputEl.blur();var r=i.target&&i.target.shadowRoot?i.target.shadowRoot.activeElement:i.target,n=r?r.value:"";if(!n)return this.fresh=!0,i.keyCode!==t&&this.clear(i),this._clearEl.style.display="none";if(!(i.metaKey||[t,e,37,39,38,40].indexOf(i.keyCode)!==-1)){if(i.keyCode===13)if(!this.options.showResultsWhileTyping)this._typeahead.selected||this._geocode(r.value);else{this._typeahead.selected==null&&this.geocoderApi.getSuggestions?this._geocode(r.value,!0):this._typeahead.selected==null&&this.options.showResultMarkers&&this._fitBoundsForMarkers();return}r.value.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(r.value)}},_showButton:function(){this._inputEl.value.length>0&&(this._clearEl.style.display="block")},_hideButton:function(){this._typeahead.selected&&(this._clearEl.style.display="none")},_onBlur:function(i){this.options.clearOnBlur&&this._clearOnBlur(i),this.options.collapsed&&this._collapse()},_onChange:function(){var i=this._typeahead.selected;if(i&&!i.geometry)i.placeId?this._geocode(i.placeId,!0,!0):this._geocode(i.text,!0);else if(i&&JSON.stringify(i)!==this.lastSelected){if(this._clearEl.style.display="none",this.options.flyTo){var e;if(this._removeResultMarkers(),i.properties&&gD[i.properties.short_code])e=au({},this.options.flyTo),this._map&&this._map.fitBounds(gD[i.properties.short_code].bbox,e);else if(i.bbox){var t=i.bbox;e=au({},this.options.flyTo),this._map&&this._map.fitBounds([[t[0],t[1]],[t[2],t[3]]],e)}else{var r={zoom:this.options.zoom};e=au({},r,this.options.flyTo),i.center?e.center=i.center:i.geometry&&i.geometry.type&&i.geometry.type==="Point"&&i.geometry.coordinates&&(e.center=i.geometry.coordinates),this._map&&this._map.flyTo(e)}}this.options.marker&&this._maplibregl&&this._handleMarker(i),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(i),this._typeahead.selected=null,this._eventEmitter.emit("result",{result:i})}},_getConfigForRequest:function(){var i=["bbox","limit","proximity","countries","types","language","reverseMode"],e=this,t=i.reduce(function(r,n){return e.options[n]&&(["countries","types","language"].indexOf(n)>-1?r[n]=e.options[n].split(/[\s,]+/):r[n]=e.options[n],n==="proximity"&&e.options[n]&&typeof e.options[n].longitude=="number"&&typeof e.options[n].latitude=="number"&&(r[n]=[e.options[n].longitude,e.options[n].latitude])),r},{});return t},_geocode:function(i,e,t){this._loadingEl.style.display="block",this._eventEmitter.emit("loading",{query:i}),this.inputString=i;var r=null,n=this._getConfigForRequest(),o;if(this.options.localGeocoderOnly)o=Promise.resolve();else if(this.options.reverseGeocode&&/(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/.test(i)){var l=i.split(/[\s(,)?]+/).map(function(v){return parseFloat(v,10)}).reverse();n.types&&n.types[0],n=au(n,{query:l,limit:1}),"proximity"in n&&delete n.proximity,o=this.geocoderApi.reverseGeocode(n)}else n=au(n,{query:i}),this.geocoderApi.getSuggestions?e?this.geocoderApi.searchByPlaceId&&t?o=this.geocoderApi.searchByPlaceId(n):o=this.geocoderApi.forwardGeocode(n):o=this.geocoderApi.getSuggestions(n):o=this.geocoderApi.forwardGeocode(n);var s=[];this.options.localGeocoder&&(s=this.options.localGeocoder(i),s||(s=[]));var g=[];return o.catch((function(v){r=v}).bind(this)).then((function(v){this._loadingEl.style.display="none";var T={};return v?T=v:T={type:"FeatureCollection",features:[]},T.config=n,this.fresh&&(this.fresh=!1),T.features=T.features?s.concat(T.features):s,this.options.externalGeocoder?(g=this.options.externalGeocoder(i,T.features,n)||[],g.then(function(F){return T.features=T.features?F.concat(T.features):F,T},function(){return T})):T}).bind(this)).then((function(v){if(r)throw r;this.options.filter&&v.features.length&&(v.features=v.features.filter(this.options.filter));var T=[];v.suggestions?T=v.suggestions:v.place?T=[v.place]:T=v.features,T.length?(this._clearEl.style.display="block",this._typeahead.update(T),(!this.options.showResultsWhileTyping||e)&&this.options.showResultMarkers&&(v.features.length>0||v.place)&&this._fitBoundsForMarkers(),this._eventEmitter.emit("results",v)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",v))}).bind(this)).catch((function(v){this._loadingEl.style.display="none",s.length&&this.options.localGeocoder||g.length&&this.options.externalGeocoder?(this._clearEl.style.display="block",this._typeahead.update(s)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:s}),this._eventEmitter.emit("error",{error:v})}).bind(this)),o},_clear:function(i){i&&i.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display="none",this._removeMarker(),this._removeResultMarkers(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(i){this._clear(i),this._inputEl.focus()},_clearOnBlur:function(i){var e=this;i.relatedTarget&&e._clear(i)},_onQueryResult:function(i){var e=i;if(e.features.length){var t=e.features[0];this._typeahead.selected=t,this._inputEl.value=t.place_name,this._onChange()}},_updateProximity:function(){if(this._map)if(this._map.getZoom()>9){var i=this._map.getCenter().wrap();this.setProximity({longitude:i.lng,latitude:i.lat})}else this.setProximity(null)},_collapse:function(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed","maplibregl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed","maplibregl-ctrl-geocoder--collapsed")},query:function(i){return this._geocode(i).then(this._onQueryResult),this},_renderError:function(){var i="<div class='mapbox-gl-geocoder--error maplibre-gl-geocoder--error'>There was an error reaching the server</div>";this._renderMessage(i)},_renderNoResults:function(){var i="<div class='mapbox-gl-geocoder--error mapbox-gl-geocoder--no-results maplibre-gl-geocoder--error maplibre-gl-geocoder--no-results'>No results found</div>";this._renderMessage(i)},_renderMessage:function(i){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(i)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var i=this.options.language.split(",")[0],e=Tne.language(i),t=Sne.placeholder[e];if(t)return t}return"Search"},_fitBoundsForMarkers:function(){if(!(this._typeahead.data.length<1)){var i=this._typeahead.data.filter(function(n){return typeof n!="string"}).slice(0,this.options.limit);if(this._clearEl.style.display="none",this.options.flyTo&&this._maplibregl&&this._map){var e={padding:100},t=au({},e,this.options.flyTo),r=new this._maplibregl.LngLatBounds;i.forEach(function(n){r.extend(n.geometry.coordinates)}),this._map.fitBounds(r.toArray(),t)}return i.length>0&&this._maplibregl&&this._handleResultMarkers(i),this}},setInput:function(i){return this._inputEl.value=i,this._typeahead.selected=null,this._typeahead.clear(),i.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(i),this},setProximity:function(i){return this.options.proximity=i,this},getProximity:function(){return this.options.proximity},setRenderFunction:function(i){return i&&typeof i=="function"&&(this._typeahead.render=i),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(i){var e=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=i||this.options.language||e,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(i){return this.options.zoom=i,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(i){return this.options.flyTo=i,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(i){return this.placeholder=i||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(i){return this.options.bbox=i,this},getCountries:function(){return this.options.countries},setCountries:function(i){return this.options.countries=i,this},getTypes:function(){return this.options.types},setTypes:function(i){return this.options.types=i,this},getMinLength:function(){return this.options.minLength},setMinLength:function(i){return this.options.minLength=i,this._typeahead&&(this._typeahead.options.minLength=i),this},getLimit:function(){return this.options.limit},setLimit:function(i){return this.options.limit=i,this._typeahead&&(this._typeahead.options.limit=i),this},getFilter:function(){return this.options.filter},setFilter:function(i){return this.options.filter=i,this},setGeocoderApi:function(i){return this.geocoderApi=i,this},getGeocoderApi:function(){return this.geocoderApi},_handleMarker:function(i){if(this._map){this._removeMarker();var e={color:"#4668F2"},t=au({},e,this.options.marker);this.mapMarker=new this._maplibregl.Marker(t);var r;if(this.options.popup){var n={},o=au({},n,this.options.popup);r=new this._maplibregl.Popup(o).setHTML(this.options.popupRender(i))}return i.center?(this.mapMarker.setLngLat(i.center).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(r)):i.geometry&&i.geometry.type&&i.geometry.type==="Point"&&i.geometry.coordinates&&(this.mapMarker.setLngLat(i.geometry.coordinates).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(r)),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},_handleResultMarkers:function(i){if(this._map){this._removeResultMarkers();var e={color:"#4668F2"},t=au({},e,this.options.showResultMarkers);return i.forEach((function(r){if(this.options.showResultMarkers&&this.options.showResultMarkers.element){var n=this.options.showResultMarkers.element.cloneNode(!0);t=au(t,{element:n})}var o=new this._maplibregl.Marker(au({},t,{element:n})),l;if(this.options.popup){var s={},g=au({},s,this.options.popup);l=new this._maplibregl.Popup(g).setHTML(this.options.popupRender(r))}r.center?(o.setLngLat(r.center).addTo(this._map),this.options.popup&&o.setPopup(l)):r.geometry&&r.geometry.type&&r.geometry.type==="Point"&&r.geometry.coordinates&&(o.setLngLat(r.geometry.coordinates).addTo(this._map),this.options.popup&&o.setPopup(l)),this.resultMarkers.push(o)}).bind(this)),this}},_removeResultMarkers:function(){this.resultMarkers&&this.resultMarkers.length>0&&(this.resultMarkers.forEach(function(i){i.remove()}),this.resultMarkers=[])},on:function(i,e){return this._eventEmitter.on(i,e),this},off:function(i,e){return this._eventEmitter.removeListener(i,e),this}};var Ine=mD;const Lne=Um(Ine),rn={limitsUrl:"https://tilemaps.icgc.cat/vt/limits-tilejsonV3.json",geocoder:{peliasUrl1:"https://eines.icgc.cat/geocodificador/autocompletar?text=",peliasUrl2:"&layers=topo1%2Ctopo2%2Caddress&size=5"},mapOptions:{container:"map",center:{0:1.537786,1:41.837539},zoom:7.5,bearing:0,pitch:0,hash:!1,style:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json.json",maxZoom:18,maxPitch:85},logoIcgcOptions:{logoUrlColor:"https://tilemaps.icgc.cat/cdn/logos/icgc_logo_color.png",logoUrlWhite:"https://tilemaps.icgc.cat/cdn/logos/icgc_logo_blanc.svg",logoLink:"https://www.icgc.cat",logoTitle:"Institut Cartogràfic i Geològic de Catalunya",logoWidth:100},logoGencatOptions:{logoUrlColor:"https://tilemaps.icgc.cat/cdn/logos/gencat_logo_color.png",logoUrlWhite:"https://tilemaps.icgc.cat/cdn/logos/gencat_logo_blanc.png",logoLink:"https://web.gencat.cat/",logoTitle:"Generalitat de Catalunya",logoWidth:100},map3dOptions:{spaceErrorFactor:2,exaggeration:1,zfactor:48,minZoomRange:15.5,maxZoomRange:22,urlTilesetCities:"https://tilemaps.icgc.cat/vector/3dtiles/ciutats/v1/tilesetV1.0.json",layerIdOrder:"place-isolated",sourceLayerFilterId:"place",minZoomFilter:14,layerId3d:"edificisMapboxLayer",terrainSource:"ICGC5M",style3dName:"orto3d",imageIcon:"https://tilemaps.icgc.cat/cdn/images/stick.png"},baseStyles:{0:{key:"TOPO",url:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_mapa_estandard.png"},1:{key:"ORTO",url:"https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_orto_hibrida.png"},2:{key:"ORTO3D",url:"https://tilemaps.icgc.cat/cdn/styles/icgc_orto_3d.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_orto_hibrida.png"},3:{key:"ADMIN",url:"https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_delimitacio_limits_administratius.png"},4:{key:"DARK",url:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_mapa_base_fosc.png"},5:{key:"LIGHT",url:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_mapa_base_gris.png"},6:{key:"GEOLOGY",url:"https://geoserveis.icgc.cat/contextmaps/icgc_geologic_informacio.json",image:"https://visors.icgc.cat/contextmaps/imatges_estil/icgc_geologic_informacio.png"}},urlTerrainICGC:{0:{name:"ICGC5M",url:"https://tilemaps.icgc.cat/tileserver/tileserver/terreny-5m-30m-rgb-extent/{z}/{x}/{y}.png"},1:{name:"WORLD30M",url:"https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png",encoding:"terrarium"}},ortoLayersICGC:{0:{name:"ortofotoColorProvisional",key:"ortofoto_color_provisional",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_provisional"},1:{name:"ortofotoColor2022",key:"ortofoto_color_2022",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2022"},2:{name:"ortofotoColor2021",key:"ortofoto_color_2021",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2021"},3:{name:"ortofotoColor2020",key:"ortofoto_color_2020",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2020"},4:{name:"ortofotoColor2019",key:"ortofoto_color_2019",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2019"},5:{name:"ortofotoColor2018",key:"ortofoto_color_2018",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2018"},6:{name:"ortofotoColor2017",key:"ortofoto_color_2017",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2017"},7:{name:"ortofotoColor2016",key:"ortofoto_color_2016",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2016"},8:{name:"ortofotoColor2015",key:"ortofoto_color_2015",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2015"},9:{name:"ortofotoColor2014",key:"ortofoto_color_2014",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2014"},10:{name:"ortofotoColor2013",key:"ortofoto_color_2013",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2013"},11:{name:"ortofotoColor2012",key:"ortofoto_color_2012",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2012"},12:{name:"ortofotoColor2011",key:"ortofoto_color_2011",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2011"},13:{name:"ortofotoColor2010",key:"ortofoto_color_2010",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2010"},14:{name:"ortofotoColor2009",key:"ortofoto_color_2009",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2009"},15:{name:"ortofotoColor2008",key:"ortofoto_color_2008",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2008"},16:{name:"ortofotoColor20062007",key:"ortofoto_color_2006-2007",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2006-2007"},17:{name:"ortofotoColor20042005",key:"ortofoto_color_2004-2005",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2004-2005"},18:{name:"ortofotoColor20002003",key:"ortofoto_color_2000-2003",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2000-2003"},19:{name:"ortofotoBlancINegre1998",key:"ortofoto_blanc_i_negre_1998",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1998"},20:{name:"ortofotoBlancINegre19941997",key:"ortofoto_blanc_i_negre_1994-1997",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1994-1997"},21:{name:"ortofotoColor1993",key:"ortofoto_color_1993",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_1993"},22:{name:"ortofotoBlancINegre19831992",key:"ortofoto_blanc_i_negre_1983-1992",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1983-1992"},23:{name:"ortofotoBlancINegre19701977",key:"ortofoto_blanc_i_negre_1970-1977",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1970-1977"},24:{name:"ortofotoBlancINegre1956",key:"ortofoto_blanc_i_negre_1956",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1956"},25:{name:"ortofotoBlancINegre1945",key:"ortofoto_blanc_i_negre_1945",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1945"},26:{name:"ortofotoColorSerieAnual",key:"ortofoto_color_serie_anual",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_serie_anual"},27:{name:"ortofotoInfraroigProvisional",key:"ortofoto_infraroig_provisional",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_provisional"},28:{name:"ortofotoInfraroig2022",key:"ortofoto_infraroig_2022",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2022"},29:{name:"ortofotoInfraroig2021",key:"ortofoto_infraroig_2021",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2021"},30:{name:"ortofotoInfraroig2020",key:"ortofoto_infraroig_2020",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2020"},31:{name:"ortofotoInfraroig2019",key:"ortofoto_infraroig_2019",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2019"},32:{name:"ortofotoInfraroig2018",key:"ortofoto_infraroig_2018",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2018"},33:{name:"ortofotoInfraroig2017",key:"ortofoto_infraroig_2017",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2017"},34:{name:"ortofotoInfraroig2016",key:"ortofoto_infraroig_2016",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2016"},35:{name:"ortofotoInfraroig2015",key:"ortofoto_infraroig_2015",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2015"},36:{name:"ortofotoInfraroig2014",key:"ortofoto_infraroig_2014",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2014"},37:{name:"ortofotoInfraroig2013",key:"ortofoto_infraroig_2013",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2013"},38:{name:"ortofotoInfraroig2012",key:"ortofoto_infraroig_2012",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2012"},39:{name:"ortofotoInfraroig2011",key:"ortofoto_infraroig_2011",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2011"},40:{name:"ortofotoInfraroig2010",key:"ortofoto_infraroig_2010",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2010"},41:{name:"ortofotoInfraroig2009",key:"ortofoto_infraroig_2009",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2009"},42:{name:"ortofotoInfraroig2008",key:"ortofoto_infraroig_2008",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2008"},43:{name:"ortofotoInfraroig20062007",key:"ortofoto_infraroig_2006-2007",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2006-2007"},44:{name:"ortofotoInfraroig19961997",key:"ortofoto_infraroig_1996-1997",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_1996-1997"},45:{name:"ortofotoInfraroigSerieAnual",key:"ortofoto_infraroig_serie_anual",url:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_serie_anual"}},vectorLayersICGC:{0:{name:"agrupacionsCensals2015",key:"agrupacions_censals_2015"},1:{name:"agrupacionsCensals2016",key:"agrupacions_censals_2016"},2:{name:"agrupacionsCensals2017",key:"agrupacions_censals_2017"},3:{name:"agrupacionsCensals2018",key:"agrupacions_censals_2018"},4:{name:"agrupacionsCensals2019",key:"agrupacions_censals_2019"},5:{name:"agrupacionsCensals2020",key:"agrupacions_censals_2020"},6:{name:"agrupacionsCensals2021",key:"agrupacions_censals_2021"},7:{name:"agrupacionsCensalsVigent",key:"agrupacions_censals_vigent"},8:{name:"agrupacionsCensalsVigentText",key:"agrupacions_censals_vigent_text"},9:{name:"areesBasiquesPolicials2019",key:"arees_basiques_policials_2019"},10:{name:"areesBasiquesPolicials2020",key:"arees_basiques_policials_2020"},11:{name:"areesBasiquesPolicials2022",key:"arees_basiques_policials_2022"},12:{name:"areesBasiquesPolicialsVigent",key:"arees_basiques_policials_vigent"},13:{name:"areesBasiquesPolicialsVigentText",key:"arees_basiques_policials_vigent_text"},14:{name:"areesBasiquesSalutVigent",key:"arees_basiques_salut_vigent"},15:{name:"areesBasiquesServeisSocialsVigent",key:"arees_basiques_serveis_socials_vigent"},16:{name:"areesBasiquesServeisSocialsVigentText",key:"arees_basiques_serveis_socials_vigent_text"},17:{name:"areesGestioAssistencialVigent",key:"arees_gestio_assistencial_vigent"},18:{name:"areesHidrogeologiquesAquifersVigent",key:"arees_hidrogeologiques_aquifers_vigent"},19:{name:"catalunyaVigent",key:"catalunya_vigent"},20:{name:"catalunyaVigentText",key:"catalunya_vigent_text"},21:{name:"comarques2022",key:"comarques_2022"},22:{name:"comarquesVigent",key:"comarques_vigent"},23:{name:"comarquesVigentText",key:"comarques_vigent_text"},24:{name:"districtesCensals2015",key:"districtes_censals_2015"},25:{name:"districtesCensals2016",key:"districtes_censals_2016"},26:{name:"districtesCensals2017",key:"districtes_censals_2017"},27:{name:"districtesCensals2018",key:"districtes_censals_2018"},28:{name:"districtesCensals2019",key:"districtes_censals_2019"},29:{name:"districtesCensals2020",key:"districtes_censals_2020"},30:{name:"districtesCensals2021",key:"districtes_censals_2021"},31:{name:"districtesCensals2022",key:"districtes_censals_2022"},32:{name:"districtesCensalsVigent",key:"districtes_censals_vigent"},33:{name:"districtesCensalsVigentText",key:"districtes_censals_vigent_text"},34:{name:"incendisForestalsVigent",key:"incendis_forestals_vigent"},35:{name:"incendisForestalsVigentText",key:"incendis_forestals_vigent_text"},36:{name:"municipis2022",key:"municipis_2022"},37:{name:"municipis2022Text",key:"municipis_2022_text"},38:{name:"municipisVigent",key:"municipis_vigent"},39:{name:"municipisVigentText",key:"municipis_vigent_text"},40:{name:"partitsJudicialsVigent",key:"partits_judicials_vigent"},41:{name:"partitsJudicialsVigentText",key:"partits_judicials_vigent_text"},42:{name:"plaTerritorial2015",key:"pla_territorial_2015"},43:{name:"plaTerritorialVigent",key:"pla_territorial_vigent"},44:{name:"plaTerritorialVigentText",key:"pla_territorial_vigent_text"},45:{name:"provinciesVigent",key:"provincies_vigent"},46:{name:"provinciesVigentText",key:"provincies_vigent_text"},47:{name:"regionsPolicialsVigent",key:"regions_policials_vigent"},48:{name:"regionsPolicialsVigentText",key:"regions_policials_vigent_text"},49:{name:"regionsSanitariesVigent",key:"regions_sanitaries_vigent"},50:{name:"regionsSanitariesVigentText",key:"regions_sanitaries_vigent_text"},51:{name:"seccionsCensals2015",key:"seccions_censals_2015"},52:{name:"seccionsCensals2016",key:"seccions_censals_2016"},53:{name:"seccionsCensals2017",key:"seccions_censals_2017"},54:{name:"seccionsCensals2018",key:"seccions_censals_2018"},55:{name:"seccionsCensals2019",key:"seccions_censals_2019"},56:{name:"seccionsCensals2020",key:"seccions_censals_2020"},57:{name:"seccionsCensals2021",key:"seccions_censals_2021"},58:{name:"seccionsCensals2022",key:"seccions_censals_2022"},59:{name:"seccionsCensalsVigent",key:"seccions_censals_vigent"},60:{name:"seccionsCensalsVigentText",key:"seccions_censals_vigent_text"},61:{name:"sectorsSanitarisVigent",key:"sectors_sanitaris_vigent"},62:{name:"vegueriesVigent",key:"vegueries_vigent"},63:{name:"vegueriesVigentText",key:"vegueries_vigent_text"}},vectorLayers:{0:{key:"cobertes2018",url:"https://tilemaps.icgc.cat/tileserver/cobertes_tilejson.json",legend:"https://tilemaps.icgc.cat/cdn/images/llegendaCobertesSol2018.jpg"}},wmsLayers:{0:{key:"espaisInteresGeologic",layer:"",url:"https://geoserveis.icgc.cat/servei/catalunya/espais-interes-geologic/wms/service?&service=WMS&request=GetMap&layers=espais-interes-geologic&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}"},1:{key:"gravimetriaBouguer500000",layer:"",url:"https://geoserveis.icgc.cat/servei/catalunya/gravimetria/wms/service?&service=WMS&request=GetMap&layers=anomalia_bouguer_500000&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}"},2:{key:"cobertesSol2018",layer:"",url:"https://geoserveis.icgc.cat/servei/catalunya/cobertes-sol/wms/service?&service=WMS&request=GetMap&layers=cobertes_2018&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}"},3:{key:"administratiu",layer:"",url:"http://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/administratiu/MON3857NW/{z}/{x}/{y}.png"},4:{key:"simplificat",layer:"",url:"http://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/simplificat/MON3857NW/{z}/{x}/{y}.png"},5:{key:"cims",layer:"",url:"https://geoserveis.icgc.cat/icc_100cims/wms/service?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=0&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:25831&BBOX=137118.923076923,4488408.75,650959.076923077,4749634.75&WIDTH=895&HEIGHT=455"},6:{key:"cobertesSol",layer:"",url:"http://geoserveis.icgc.cat/servei/catalunya/cobertes-sol/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=cobertes_2009&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&CRS=EPSG:25831&BBOX=374110.828167253,4639230.79853085,452621.120632226,4703578.45000215&WIDTH=1020&HEIGHT=836"}},fgbLayers:{0:{name:"agrupacionsCensalsVigent",key:"agrupacions_censals_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/agrupacions_censals_vigent.fgb"},1:{name:"agrupacionsCensalsVigentText",key:"agrupacions_censals_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/agrupacions_censals_vigent_text.fgb"},2:{name:"areesBasiquesPolicialsVigent",key:"arees_basiques_policials_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_policials_vigent.fgb"},3:{name:"areesBasiquesPolicialsVigentText",key:"arees_basiques_policials_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_policials_vigent_text.fgb"},4:{name:"areesBasiquesSalutVigent",key:"arees_basiques_salut_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_salut_vigent.fgb"},5:{name:"areesBasiquesServeisSocialsVigent",key:"arees_basiques_serveis_socials_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_serveis_socials_vigent.fgb"},6:{name:"areesBasiquesServeisSocialsVigentText",key:"arees_basiques_serveis_socials_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_serveis_socials_vigent_text.fgb"},7:{name:"areesGestioAssistencialVigent",key:"arees_gestio_assistencial_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_gestio_assistencial_vigent.fgb"},8:{name:"areesHidrogeologiquesAquifersVigent",key:"arees_hidrogeologiques_aquifers_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/arees_hidrogeologiques_aquifers_vigent.fgb"},9:{name:"catalunyaVigent",key:"catalunya_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/catalunya_vigent.fgb"},10:{name:"catalunyaVigentText",key:"catalunya_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/catalunya_vigent_text.fgb"},11:{name:"comarquesVigent",key:"comarques_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/comarques_vigent.fgb"},12:{name:"comarquesVigentText",key:"comarques_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/comarques_vigent_text.fgb"},13:{name:"districtesCensalsVigent",key:"districtes_censals_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/districtes_censals_vigent.fgb"},14:{name:"districtesCensalsVigentText",key:"districtes_censals_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/districtes_censals_vigent_text.fgb"},15:{name:"incendisForestalsVigent",key:"incendis_forestals_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/incendis_forestals_vigent.fgb"},16:{name:"incendisForestalsVigentText",key:"incendis_forestals_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/incendis_forestals_vigent_text.fgb"},17:{name:"municipisVigent",key:"municipis_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/municipis_vigent.fgb"},18:{name:"municipisVigentText",key:"municipis_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/municipis_vigent_text.fgb"},19:{name:"partitsJudicialsVigent",key:"partits_judicials_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/partits_judicials_vigent.fgb"},20:{name:"partitsJudicialsVigentText",key:"partits_judicials_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/partits_judicials_vigent_text.fgb"},21:{name:"plaTerritorialVigent",key:"pla_territorial_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/pla_territorial_vigent.fgb"},22:{name:"plaTerritorialVigentText",key:"pla_territorial_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/pla_territorial_vigent_text.fgb"},23:{name:"provinciesVigent",key:"provincies_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/provincies_vigent.fgb"},24:{name:"provinciesVigentText",key:"provincies_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/provincies_vigent_text.fgb"},25:{name:"regionsPolicialsVigent",key:"regions_policials_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/regions_policials_vigent.fgb"},26:{name:"regionsPolicialsVigentText",key:"regions_policials_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/regions_policials_vigent_text.fgb"},27:{name:"regionsSanitariesVigent",key:"regions_sanitaries_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/regions_sanitaries_vigent.fgb"},28:{name:"regionsSanitariesVigentText",key:"regions_sanitaries_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/regions_sanitaries_vigent_text.fgb"},29:{name:"seccionsCensalsVigent",key:"seccions_censals_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/seccions_censals_vigent.fgb"},30:{name:"seccionsCensalsVigentText",key:"seccions_censals_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/seccions_censals_vigent_text.fgb"},31:{name:"sectorsSanitarisVigent",key:"sectors_sanitaris_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/sectors_sanitaris_vigent.fgb"},32:{name:"vegueriesVigent",key:"vegueries_vigent",url:"https://tilemaps.icgc.cat/vector/fgb/vegueries_vigent.fgb"},33:{name:"vegueriesVigentText",key:"vegueries_vigent_text",url:"https://tilemaps.icgc.cat/vector/fgb/vegueries_vigent_text.fgb"}}};class Mne{constructor(e){this.options=e}onAdd(e){return this._map=e,this._img1=document.createElement("img"),this._img1.className="maplibregl-ctrl",this._img1.src=this.options.color?rn.logoIcgcOptions.logoUrlColor:rn.logoIcgcOptions.logoUrlWhite,this._img1.width=rn.logoIcgcOptions.logoWidth,this._img1.title=rn.logoIcgcOptions.logoTitle,this.link1=document.createElement("a"),this.link1.href=rn.logoIcgcOptions.logoLink,this.link1.target="_blank",this.link1.appendChild(this._img1),this._container1=document.createElement("div"),this._container1.className="maplibregl-ctrl",this._container1.style.width=`${rn.logoIcgcOptions.logoWidth}px`,this._container1.appendChild(this.link1),this._img2=document.createElement("img"),this._img2.className="maplibregl-ctrl",this._img2.src=this.options.color?rn.logoGencatOptions.logoUrlColor:rn.logoGencatOptions.logoUrlWhite,this._img2.width=rn.logoGencatOptions.logoWidth,this._img2.title=rn.logoGencatOptions.logoTitle,this.link2=document.createElement("a"),this.link2.href=rn.logoGencatOptions.logoLink,this.link2.target="_blank",this.link2.appendChild(this._img2),this._container2=document.createElement("div"),this._container2.className="maplibregl-ctrl",this._container2.style.width=`${rn.logoGencatOptions.logoWidth}px`,this._container2.appendChild(this.link2),this._mainContainer=document.createElement("div"),this._mainContainer.className="divLogos",this._mainContainer.style="display: flex",this._mainContainer.appendChild(this._container1),this._mainContainer.appendChild(this._container2),this._mainContainer}}var Fg=yD.prototype,NC="WGS 84";function yD(i){i!==void 0&&(NC=i),this.setEllipsoid(NC)}Fg.convertLatLngToUtm=function(i,e,t){var r;if(this.status)return"No ecclipsoid data associated with unknown datum: "+NC;if(!Number.isInteger(t))return"Precision is not integer number.";i=parseFloat(i),e=parseFloat(e);var n=e,o=this.toRadians(i),l=this.toRadians(n);n>=8&&n<=13&&i>54.5&&i<58||i>=56&&i<64&&n>=3&&n<12?r=32:(r=(n+180)/6+1,i>=72&&i<84&&(n>=0&&n<9?r=31:n>=9&&n<21?r=33:n>=21&&n<33?r=35:n>=33&&n<42&&(r=37))),r=parseInt(r);var s=(r-1)*6-180+3,g=this.toRadians(s),v=this.getUtmLetterDesignator(i),T=this.eccSquared/(1-this.eccSquared),F=this.a/Math.sqrt(1-this.eccSquared*Math.sin(o)*Math.sin(o)),R=Math.tan(o)*Math.tan(o),U=T*Math.cos(o)*Math.cos(o),J=Math.cos(o)*(l-g),te=this.a*((1-this.eccSquared/4-3*this.eccSquared*this.eccSquared/64-5*this.eccSquared*this.eccSquared*this.eccSquared/256)*o-(3*this.eccSquared/8+3*this.eccSquared*this.eccSquared/32+45*this.eccSquared*this.eccSquared*this.eccSquared/1024)*Math.sin(2*o)+(15*this.eccSquared*this.eccSquared/256+45*this.eccSquared*this.eccSquared*this.eccSquared/1024)*Math.sin(4*o)-35*this.eccSquared*this.eccSquared*this.eccSquared/3072*Math.sin(6*o)),Ae=parseFloat(.9996*F*(J+(1-R+U)*J*J*J/6+(5-18*R+R*R+72*U-58*T)*J*J*J*J*J/120)+5e5),he=parseFloat(.9996*(te+F*Math.tan(o)*(J*J/2+(5-R+9*U+4*U*U)*J*J*J*J/24+(61-58*R+R*R+600*U-330*T)*J*J*J*J*J*J/720)));return i<0&&(he+=1e7),he=_D(he,t),Ae=_D(Ae,t),{Easting:Ae,Northing:he,ZoneNumber:parseInt(r),ZoneLetter:v}},Fg.convertUtmToLatLng=function(i,e,t,r){var n=(1-Math.sqrt(1-this.eccSquared))/(1+Math.sqrt(1-this.eccSquared)),o=i-5e5,l=e,s=t,g=r;if(i===void 0)return"Please pass the UTMEasting!";if(e===void 0)return"Please pass the UTMNorthing!";if(t===void 0)return"Please pass the UTMZoneNumber!";if(r===void 0)return"Please pass the UTMZoneLetter!";["N","P","Q","R","S","T","U","V","W","X","Y","Z"].indexOf(g)!==-1||(l-=1e7);var v=(s-1)*6-180+3,T=this.eccSquared/(1-this.eccSquared),F=l/.9996,R=F/(this.a*(1-this.eccSquared/4-3*this.eccSquared*this.eccSquared/64-5*this.eccSquared*this.eccSquared*this.eccSquared/256)),U=R+(3*n/2-27*n*n*n/32)*Math.sin(2*R)+(21*n*n/16-55*n*n*n*n/32)*Math.sin(4*R)+151*n*n*n/96*Math.sin(6*R);this.toDegrees(U);var J=this.a/Math.sqrt(1-this.eccSquared*Math.sin(U)*Math.sin(U)),te=Math.tan(U)*Math.tan(U),Ae=T*Math.cos(U)*Math.cos(U),he=this.a*(1-this.eccSquared)/Math.pow(1-this.eccSquared*Math.sin(U)*Math.sin(U),1.5),pe=o/(J*.9996),be=U-J*Math.tan(U)/he*(pe*pe/2-(5+3*te+10*Ae-4*Ae*Ae-9*T)*pe*pe*pe*pe/24+(61+90*te+298*Ae+45*te*te-252*T-3*Ae*Ae)*pe*pe*pe*pe*pe*pe/720);be=this.toDegrees(be);var Te=(pe-(1+2*te+Ae)*pe*pe*pe/6+(5-2*Ae+28*te-3*Ae*Ae+8*T+24*te*te)*pe*pe*pe*pe*pe/120)/Math.cos(U);return Te=v+this.toDegrees(Te),{lat:be,lng:Te}},Fg.getUtmLetterDesignator=function(i){return i=parseFloat(i),84>=i&&i>=72?"X":72>i&&i>=64?"W":64>i&&i>=56?"V":56>i&&i>=48?"U":48>i&&i>=40?"T":40>i&&i>=32?"S":32>i&&i>=24?"R":24>i&&i>=16?"Q":16>i&&i>=8?"P":8>i&&i>=0?"N":0>i&&i>=-8?"M":-8>i&&i>=-16?"L":-16>i&&i>=-24?"K":-24>i&&i>=-32?"J":-32>i&&i>=-40?"H":-40>i&&i>=-48?"G":-48>i&&i>=-56?"F":-56>i&&i>=-64?"E":-64>i&&i>=-72?"D":-72>i&&i>=-80?"C":"Z"},Fg.setEllipsoid=function(i){switch(i){case"Airy":this.a=6377563,this.eccSquared=.00667054;break;case"Australian National":this.a=6378160,this.eccSquared=.006694542;break;case"Bessel 1841":this.a=6377397,this.eccSquared=.006674372;break;case"Bessel 1841 Nambia":this.a=6377484,this.eccSquared=.006674372;break;case"Clarke 1866":this.a=6378206,this.eccSquared=.006768658;break;case"Clarke 1880":this.a=6378249,this.eccSquared=.006803511;break;case"Everest":this.a=6377276,this.eccSquared=.006637847;break;case"Fischer 1960 Mercury":this.a=6378166,this.eccSquared=.006693422;break;case"Fischer 1968":this.a=6378150,this.eccSquared=.006693422;break;case"GRS 1967":this.a=6378160,this.eccSquared=.006694605;break;case"GRS 1980":this.a=6378137,this.eccSquared=.00669438;break;case"Helmert 1906":this.a=6378200,this.eccSquared=.006693422;break;case"Hough":this.a=6378270,this.eccSquared=.00672267;break;case"International":this.a=6378388,this.eccSquared=.00672267;break;case"Krassovsky":this.a=6378245,this.eccSquared=.006693422;break;case"Modified Airy":this.a=6377340,this.eccSquared=.00667054;break;case"Modified Everest":this.a=6377304,this.eccSquared=.006637847;break;case"Modified Fischer 1960":this.a=6378155,this.eccSquared=.006693422;break;case"South American 1969":this.a=6378160,this.eccSquared=.006694542;break;case"WGS 60":this.a=6378165,this.eccSquared=.006693422;break;case"WGS 66":this.a=6378145,this.eccSquared=.006694542;break;case"WGS 72":this.a=6378135,this.eccSquared=.006694318;break;case"ED50":this.a=6378388,this.eccSquared=.00672267;break;case"WGS 84":case"EUREF89":case"ETRS89":this.a=6378137,this.eccSquared=.00669438;break;default:this.status=!0}},Fg.toDegrees=function(i){return i/Math.PI*180},Fg.toRadians=function(i){return i*Math.PI/180};function _D(i,e){var t=Math.pow(10,e);return Math.round(i*t)/t}var Pne=yD;const Fne=Um(Pne);class Dne{constructor(e){this.options=e||{},this.options.utm=this.options.hasOwnProperty("utm")?this.options.utm:!0,this.options.lonlat=this.options.hasOwnProperty("lonlat")?this.options.lonlat:!0}onAdd(e){const t=new Fne;return this._map=e,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl coordControl",this._container.style.width=`${this.options.width||"225px"}`,this._map.on("mousemove",r=>{const n=r.lngLat.lat,o=r.lngLat.lng;let l="",s="";const g=t.convertLatLngToUtm(n,o,2),v=n>0?"N":"S";this.options.utm&&(l=`ETRS89 UTM ${g.ZoneNumber}${v} X:<b> ${g.Easting}</b> Y:<b> ${g.Northing}</b> <br>`),this.options.lonlat&&(s=`WGS 84 Lon:<b> ${o.toFixed(5)}</b> Lat:<b> ${n.toFixed(5)}</b>`);const T=`${l}${s}`;this._container.innerHTML=T}),this._container}_lookUTM31(e,t){var r=0,n=0,o=6,l=84;return e>=r&&e<=o&&t>=n&&t<=l}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}}const hv={ICGC5M:"https://tilemaps.icgc.cat/tileserver/tileserver/terreny-5m-30m-rgb-extent/{z}/{x}/{y}.png",WORLD30M:"https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"},Dg={TOPO:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",ORTO:"https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json",ORTO3D:"https://tilemaps.icgc.cat/cdn/styles/icgc_orto_3d.json",ADMIN:"https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json",DARK:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json",LIGHT:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json",GEOLOGY:"https://geoserveis.icgc.cat/contextmaps/icgc_geologic_informacio.json"},so={Orto:{ortofotoColorProvisional:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_provisional",ortofotoColor2022:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2022",ortofotoColor2021:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2021",ortofotoColor2020:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2020",ortofotoColor2019:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2019",ortofotoColor2018:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2018",ortofotoColor2017:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2017",ortofotoColor2016:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2016",ortofotoColor2015:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2015",ortofotoColor2014:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2014",ortofotoColor2013:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2013",ortofotoColor2012:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2012",ortofotoColor2011:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2011",ortofotoColor2010:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2010",ortofotoColor2009:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2009",ortofotoColor2008:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2008",ortofotoColor20062007:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2006-2007",ortofotoColor20042005:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2004-2005",ortofotoColor20002003:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2000-2003",ortofotoBlancINegre1998:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1998",ortofotoBlancINegre19941997:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1994-1997",ortofotoColor1993:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_1993",ortofotoBlancINegre19831992:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1983-1992",ortofotoBlancINegre19701977:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1970-1977",ortofotoBlancINegre1956:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1956",ortofotoBlancINegre1945:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1945",ortofotoColorSerieAnual:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_serie_anual",ortofotoInfraroigProvisional:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_provisional",ortofotoInfraroig2022:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2022",ortofotoInfraroig2021:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2021",ortofotoInfraroig2020:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2020",ortofotoInfraroig2019:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2019",ortofotoInfraroig2018:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2018",ortofotoInfraroig2017:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2017",ortofotoInfraroig2016:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2016",ortofotoInfraroig2015:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2015",ortofotoInfraroig2014:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2014",ortofotoInfraroig2013:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2013",ortofotoInfraroig2012:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2012",ortofotoInfraroig2011:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2011",ortofotoInfraroig2010:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2010",ortofotoInfraroig2009:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2009",ortofotoInfraroig2008:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2008",ortofotoInfraroig20062007:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2006-2007",ortofotoInfraroig19961997:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_1996-1997",ortofotoInfraroigSerieAnual:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_serie_anual"},VectorAdmin:{agrupacionsCensals2015:"agrupacions_censals_2015",agrupacionsCensals2016:"agrupacions_censals_2016",agrupacionsCensals2017:"agrupacions_censals_2017",agrupacionsCensals2018:"agrupacions_censals_2018",agrupacionsCensals2019:"agrupacions_censals_2019",agrupacionsCensals2020:"agrupacions_censals_2020",agrupacionsCensals2021:"agrupacions_censals_2021",agrupacionsCensalsVigent:"agrupacions_censals_vigent",agrupacionsCensalsVigentText:"agrupacions_censals_vigent_text",areesBasiquesPolicials2019:"arees_basiques_policials_2019",areesBasiquesPolicials2020:"arees_basiques_policials_2020",areesBasiquesPolicials2022:"arees_basiques_policials_2022",areesBasiquesPolicialsVigent:"arees_basiques_policials_vigent",areesBasiquesPolicialsVigentText:"arees_basiques_policials_vigent_text",areesBasiquesSalutVigent:"arees_basiques_salut_vigent",areesBasiquesServeisSocialsVigent:"arees_basiques_serveis_socials_vigent",areesBasiquesServeisSocialsVigentText:"arees_basiques_serveis_socials_vigent_text",areesGestioAssistencialVigent:"arees_gestio_assistencial_vigent",areesHidrogeologiquesAquifersVigent:"arees_hidrogeologiques_aquifers_vigent",catalunyaVigent:"catalunya_vigent",catalunyaVigentText:"catalunya_vigent_text",comarques2022:"comarques_2022",comarquesVigent:"comarques_vigent",comarquesVigentText:"comarques_vigent_text",districtesCensals2015:"districtes_censals_2015",districtesCensals2016:"districtes_censals_2016",districtesCensals2017:"districtes_censals_2017",districtesCensals2018:"districtes_censals_2018",districtesCensals2019:"districtes_censals_2019",districtesCensals2020:"districtes_censals_2020",districtesCensals2021:"districtes_censals_2021",districtesCensals2022:"districtes_censals_2022",districtesCensalsVigent:"districtes_censals_vigent",districtesCensalsVigentText:"districtes_censals_vigent_text",incendisForestalsVigent:"incendis_forestals_vigent",incendisForestalsVigentText:"incendis_forestals_vigent_text",municipis2022:"municipis_2022",municipis2022Text:"municipis_2022_text",municipisVigent:"municipis_vigent",municipisVigentText:"municipis_vigent_text",partitsJudicialsVigent:"partits_judicials_vigent",partitsJudicialsVigentText:"partits_judicials_vigent_text",plaTerritorial2015:"pla_territorial_2015",plaTerritorialVigent:"pla_territorial_vigent",plaTerritorialVigentText:"pla_territorial_vigent_text",provinciesVigent:"provincies_vigent",provinciesVigentText:"provincies_vigent_text",regionsPolicialsVigent:"regions_policials_vigent",regionsPolicialsVigentText:"regions_policials_vigent_text",regionsSanitariesVigent:"regions_sanitaries_vigent",regionsSanitariesVigentText:"regions_sanitaries_vigent_text",seccionsCensals2015:"seccions_censals_2015",seccionsCensals2016:"seccions_censals_2016",seccionsCensals2017:"seccions_censals_2017",seccionsCensals2018:"seccions_censals_2018",seccionsCensals2019:"seccions_censals_2019",seccionsCensals2020:"seccions_censals_2020",seccionsCensals2021:"seccions_censals_2021",seccionsCensals2022:"seccions_censals_2022",seccionsCensalsVigent:"seccions_censals_vigent",seccionsCensalsVigentText:"seccions_censals_vigent_text",sectorsSanitarisVigent:"sectors_sanitaris_vigent",vegueriesVigent:"vegueries_vigent",vegueriesVigentText:"vegueries_vigent_text"},WMS:{espaisInteresGeologic:"https://geoserveis.icgc.cat/servei/catalunya/espais-interes-geologic/wms/service?&service=WMS&request=GetMap&layers=espais-interes-geologic&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}",gravimetriaBouguer500000:"https://geoserveis.icgc.cat/servei/catalunya/gravimetria/wms/service?&service=WMS&request=GetMap&layers=anomalia_bouguer_500000&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}",cobertesSol2018:"https://geoserveis.icgc.cat/servei/catalunya/cobertes-sol/wms/service?&service=WMS&request=GetMap&layers=cobertes_2018&styles=&format=image%2Fpng&transparent=true&version=1.1.1&tipus=wms&width=512&height=512&srs=EPSG%3A3857&bbox={bbox-epsg-3857}",administratiu:"http://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/administratiu/MON3857NW/{z}/{x}/{y}.png",simplificat:"http://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/simplificat/MON3857NW/{z}/{x}/{y}.png",cims:"https://geoserveis.icgc.cat/icc_100cims/wms/service?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=0&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:25831&BBOX=137118.923076923,4488408.75,650959.076923077,4749634.75&WIDTH=895&HEIGHT=455",cobertesSol:"http://geoserveis.icgc.cat/servei/catalunya/cobertes-sol/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=cobertes_2009&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&CRS=EPSG:25831&BBOX=374110.828167253,4639230.79853085,452621.120632226,4703578.45000215&WIDTH=1020&HEIGHT=836"},FGBAdmin:{agrupacionsCensalsVigent:"https://tilemaps.icgc.cat/vector/fgb/agrupacions_censals_vigent.fgb",agrupacionsCensalsVigentText:"https://tilemaps.icgc.cat/vector/fgb/agrupacions_censals_vigent_text.fgb",areesBasiquesPolicialsVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_policials_vigent.fgb",areesBasiquesPolicialsVigentText:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_policials_vigent_text.fgb",areesBasiquesSalutVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_salut_vigent.fgb",areesBasiquesServeisSocialsVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_serveis_socials_vigent.fgb",areesBasiquesServeisSocialsVigentText:"https://tilemaps.icgc.cat/vector/fgb/arees_basiques_serveis_socials_vigent_text.fgb",areesGestioAssistencialVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_gestio_assistencial_vigent.fgb",areesHidrogeologiquesAquifersVigent:"https://tilemaps.icgc.cat/vector/fgb/arees_hidrogeologiques_aquifers_vigent.fgb",catalunyaVigent:"https://tilemaps.icgc.cat/vector/fgb/catalunya_vigent.fgb",catalunyaVigentText:"https://tilemaps.icgc.cat/vector/fgb/catalunya_vigent_text.fgb",comarquesVigent:"https://tilemaps.icgc.cat/vector/fgb/comarques_vigent.fgb",comarquesVigentText:"https://tilemaps.icgc.cat/vector/fgb/comarques_vigent_text.fgb",districtesCensalsVigent:"https://tilemaps.icgc.cat/vector/fgb/districtes_censals_vigent.fgb",districtesCensalsVigentText:"https://tilemaps.icgc.cat/vector/fgb/districtes_censals_vigent_text.fgb",incendisForestalsVigent:"https://tilemaps.icgc.cat/vector/fgb/incendis_forestals_vigent.fgb",incendisForestalsVigentText:"https://tilemaps.icgc.cat/vector/fgb/incendis_forestals_vigent_text.fgb",municipisVigent:"https://tilemaps.icgc.cat/vector/fgb/municipis_vigent.fgb",municipisVigentText:"https://tilemaps.icgc.cat/vector/fgb/municipis_vigent_text.fgb",partitsJudicialsVigent:"https://tilemaps.icgc.cat/vector/fgb/partits_judicials_vigent.fgb",partitsJudicialsVigentText:"https://tilemaps.icgc.cat/vector/fgb/partits_judicials_vigent_text.fgb",plaTerritorialVigent:"https://tilemaps.icgc.cat/vector/fgb/pla_territorial_vigent.fgb",plaTerritorialVigentText:"https://tilemaps.icgc.cat/vector/fgb/pla_territorial_vigent_text.fgb",provinciesVigent:"https://tilemaps.icgc.cat/vector/fgb/provincies_vigent.fgb",provinciesVigentText:"https://tilemaps.icgc.cat/vector/fgb/provincies_vigent_text.fgb",regionsPolicialsVigent:"https://tilemaps.icgc.cat/vector/fgb/regions_policials_vigent.fgb",regionsPolicialsVigentText:"https://tilemaps.icgc.cat/vector/fgb/regions_policials_vigent_text.fgb",regionsSanitariesVigent:"https://tilemaps.icgc.cat/vector/fgb/regions_sanitaries_vigent.fgb",regionsSanitariesVigentText:"https://tilemaps.icgc.cat/vector/fgb/regions_sanitaries_vigent_text.fgb",seccionsCensalsVigent:"https://tilemaps.icgc.cat/vector/fgb/seccions_censals_vigent.fgb",seccionsCensalsVigentText:"https://tilemaps.icgc.cat/vector/fgb/seccions_censals_vigent_text.fgb",sectorsSanitarisVigent:"https://tilemaps.icgc.cat/vector/fgb/sectors_sanitaris_vigent.fgb",vegueriesVigent:"https://tilemaps.icgc.cat/vector/fgb/vegueries_vigent.fgb",vegueriesVigentText:"https://tilemaps.icgc.cat/vector/fgb/vegueries_vigent_text.fgb"},Vector:{cobertes2018:"https://tilemaps.icgc.cat/tileserver/cobertes_tilejson.json"}};let Rne=class{constructor(e){if(!e)e=rn.mapOptions;else for(const t in rn.mapOptions){let r=[rn.mapOptions.center[0],rn.mapOptions.center[1]];rn.mapOptions.center=r,e.hasOwnProperty(t)||(e[t]=rn.mapOptions[t])}e.maxPitch=85,e.maplibreLogo=!1,e.attributionControl=!1,this.map=new nl.Map(e),this.map.options=e,this.map.addControl(new nl.AttributionControl({compact:!0})),this.map.on("load",async()=>{const t=this.map.getStyle().name,r=this.map.options.style;if(window.document.querySelector(".maplibregl-compact-show")){var n=window.document.querySelector(".maplibregl-compact-show");n.classList.remove("maplibregl-compact-show")}this.map.addControl(new Mne({color:r.indexOf("orto")===-1}),"bottom-left"),this._dealOrto3dStyle(t)})}addGeocoderICGC(e){try{e===void 0&&(e="top-right");let t={collapsed:!0,marker:!0,popup:!0,showResultMarkers:!0,maplibregl:nl,showResultsWhileTyping:!0,minLength:2};const r={forwardGeocode:async o=>{const l=[];try{const s=rn.geocoder.peliasUrl1+encodeURIComponent(o.query)+rn.geocoder.peliasUrl2,v=await(await fetch(s)).json();for(const T of v.features){const F=T.geometry.coordinates,R={type:"Feature",geometry:{type:"Point",coordinates:F},place_name:T.properties.label,properties:T.properties,text:T.properties.label,place_type:["place"],center:F};l.push(R)}}catch(s){console.error(`Failed to forwardGeocode with error: ${s}`)}return{features:l}}};this.map.addControl(new Lne(r,t),e);let n=document.getElementsByClassName("maplibregl-ctrl-geocoder--input");n[0].attributes[2].nodeValue="Cerca...",n[0].addEventListener("input",function(o){o.target.value.length>3})}catch(t){console.error(`Error adding ICGC geocoder: ${t.message}`)}}getStyle(){try{return this.map.getStyle()}catch(e){console.error(`Error getting style: ${e.message}`)}}async loadImage(e){try{return this.map.loadImage(e)}catch(t){console.error(`Error getting loadImage: ${t.message}`)}}addImage(e,t){try{return this.map.addImage(e,t)}catch(r){console.error(`Error getting addImage: ${r.message}`)}}getConfigStyles(){try{let e=[];for(const t of Dg)e.push(t.name);return e}catch(e){console.error(`Error retrieving base styles: ${e.message}`)}}getConfigWMSLayers(){try{let e=[];for(const t in so.WMS)so.WMS.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving WMS layers: ${e.message}`)}}getConfigOrtoLayers(){try{let e=[];for(const t in so.Orto)so.Orto.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving orto image layers: ${e.message}`)}}getConfigVectorLayers(){try{let e=[];for(const t in so.Vector)so.Vector.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving vector layers: ${e.message}`)}}getConfigVectorAdminLayers(){try{let e=[];for(const t in so.VectorAdmin)so.VectorAdmin.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving vectorAdmin layers: ${e.message}`)}}getConfigFGBAdminLayers(){try{let e=[];for(const t in so.FGBAdmin)so.FGBAdmin.hasOwnProperty(t)&&e.push(t);return e}catch(e){console.error(`Error retrieving FGBAdmin layers: ${e.message}`)}}async fetchData(e,t,r,n){try{if(e.includes(".fgb"))this.addFGBLayerICGC(e,r,null,n);else{const l=await(await fetch(e)).json();let s=t,g="";r==="labels"&&(g=this._firstSymbolLayer()),r==="lines"&&(g=this._firstLineLayer());let v=l.features[0].geometry.type;v.includes("ine")&&(n!==void 0?map.addLayer({id:s,type:"line",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:n},g):map.addLayer({id:s,type:"line",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:{"line-color":"black","line-width":2,"line-opacity":1}},g)),v.includes("olygon")&&(n!==void 0?map.addLayer({id:s,type:"fill",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:n},g):map.addLayer({id:s,type:"fill",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:{"fill-color":"blue","fill-opacity":.6}},g)),v.includes("oint")&&(n!==void 0?map.addLayer({id:s,type:"circle",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:n},g):map.addLayer({id:s,type:"circle",source:{type:"geojson",data:l},layout:{visibility:"visible"},paint:{"circle-color":"red","circle-opacity":.85}},g))}}catch(o){console.error(`Error fetching data: ${o.message}`)}}async fetchDataAndMenu(e,t,r,n,o){try{const l=document.getElementById("menu-group");let s="visible",g="";n==="labels"&&(g=this._firstSymbolLayer()),n==="lines"&&(g=this._firstLineLayer());let v;if(e.includes(".fgb")){let R=function(U){for(const J in so.FGBAdmin)if(so.FGBAdmin.hasOwnProperty(J)&&so.FGBAdmin[J]===U)return J;return null}(e);if(R===null)console.log("❌ %c The layer: %c%s%c does not exist in the ICGC DB. Consult the documentation.","font-weight: bold; font-style: italic;","font-weight: normal; font-style: normal; color: red;",R,"font-weight: bold; font-style: italic;");else{const U=await fetch(e),J={type:"FeatureCollection",features:[]};for await(const Ae of ZI(U.body))J.features.push(Ae);v=J;let te=R;if(this.map.addSource(te,{type:"geojson",data:J}),e.includes("text"))this.map.addLayer({id:R,type:"symbol",source:te,layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[8,0],[12,14],[15,15]]},"text-font":["FiraSans-Regular"],"text-field":["get","NOM_AC"],"text-transform":"none","text-max-width":25,visibility:s,"text-justify":"right","text-anchor":"top","text-allow-overlap":!1,"symbol-spacing":2,"text-line-height":1},paint:{"text-halo-blur":.5,"text-color":"rgba(90, 7, 7, 1)","text-halo-width":2,"text-halo-color":"rgba(255, 255, 255,0.8)"}},g);else{let Ae=R+"Text";this.map.addLayer({id:Ae,type:"symbol",source:te,layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[8,0],[12,14],[15,15]]},"text-font":["FiraSans-Regular"],"text-field":["get","NOM_AC"],"text-transform":"none","text-max-width":25,visibility:s,"text-justify":"right","text-anchor":"top","text-allow-overlap":!1,"symbol-spacing":2,"text-line-height":1},paint:{"text-halo-blur":.5,"text-color":"rgba(90, 7, 7, 1)","text-halo-width":2,"text-halo-color":"rgba(255, 255, 255,0.8)"}},g)}}}else v=await(await fetch(e)).json();if(r!=="all"){const F=document.createElement("div");F.id="titleDivMenu",F.textContent=t,l.appendChild(F);const R=document.createElement("div");R.id="titleDivMenuSub",R.textContent=`📂 ${r}`,l.appendChild(R)}let T=v.features[0].geometry.type;if(r==="all")T.includes("ine")&&(o!==void 0?map.addLayer({id:t,type:"line",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:o},g):map.addLayer({id:t,type:"line",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:{"line-color":"black","line-width":2,"line-opacity":1}},g)),T.includes("olygon")&&(o!==void 0?this.map.addLayer({id:t,type:"fill",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:o},g):this.map.addLayer({id:t,type:"fill",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:{"fill-color":"#0000FF","fill-opacity":0}},g)),T.includes("oint")&&(o!==void 0?map.addLayer({id:t,type:"circle",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:o},g):map.addLayer({id:t,type:"circle",source:{type:"geojson",data:v},layout:{visibility:"visible"},paint:{"circle-color":"red","circle-opacity":.85}},g)),console.log("itemSensefiltre",t),map.addMenuItem(t);else{let F=r;const R={};v.features.forEach(U=>{const J=U.properties[F],te=J+"-userFieldFilter-"+t;J!==null&&(R[te]||(T.includes("ine")&&(o!==void 0?map.addLayer({id:te,type:"line",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:o},g):map.addLayer({id:te,type:"line",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:{"line-color":"black","line-width":2,"line-opacity":1}},g)),T.includes("olygon")&&(o!==void 0?map.addLayer({id:te,type:"fill",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:o},g):map.addLayer({id:te,type:"fill",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:{"fill-color":"blue","fill-opacity":.6}},g)),T.includes("oint")&&(o!==void 0?map.addLayer({id:te,type:"circle",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:o},g):map.addLayer({id:te,type:"circle",source:{type:"geojson",data:v},layout:{visibility:"visible"},filter:["==",`${F}`,J],paint:{"circle-color":"red","circle-opacity":.85}},g)),R[te]=!0,map.addMenuItem(te)))})}}catch(l){console.error(`Error fetching data: ${l.message}`)}}on(e,t){try{this.map.on(e,t)}catch(r){console.error(`Error adding event listener: ${r.message}`)}}getSource(e){try{return this.map.getSource(e)}catch(t){console.error(`Error getting source: ${t.message}`)}}addSource(e,t){try{this.map.addSource(e,t)}catch(r){console.error(`Error adding source: ${r.message}`)}}setStyle(e,t){try{t!==void 0?this.map.setStyle(e,t):this.map.setStyle(e),this.map.on("styledata",()=>{if(window.document.querySelector(".maplibregl-compact-show")){var r=window.document.querySelector(".maplibregl-compact-show");r.classList.remove("maplibregl-compact-show")}this._dealOrto3dStyle(this.map.getStyle().name)})}catch(r){console.error(`Error setting style: ${r.message}`)}}getLayer(e){try{return this.map.getLayer(e)}catch(t){console.error(`Error getting layer: ${t.message}`)}}setFilter(e,t,r){try{return this.map.setFilter(e,t,r)}catch(n){console.error(`Error setting filter: ${n.message}`)}}jumpTo(e){try{this.map.jumpTo(e)}catch(t){console.error(`Error jumping to ${e}: ${t.message}`)}}setLayoutProperty(e,t,r){try{this.map.setLayoutProperty(e,t,r)}catch(n){console.error(`Error setting layout property: ${n.message}`)}}setPaintProperty(e,t,r){try{this.map.setPaintProperty(e,t,r)}catch(n){console.error(`Error setting paint property: ${n.message}`)}}addControl(e,t){try{t===void 0&&(t="top-right"),this.map.addControl(e,t)}catch(r){console.error(`Error adding control: ${r.message}`)}}getZoom(){try{return this.map.getZoom()}catch(e){console.error(`Error getting zoom level: ${e.message}`)}}addMouseCoordControl(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"bottom-left";try{this.map.addControl(new Dne(e),t)}catch(r){console.error(`Error adding mouse coordinate control: ${r.message}`)}}addGeolocateControl(e,t){try{t===void 0&&(t="top-right"),e===void 0?this.map.addControl(new nl.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0}),t):this.map.addControl(new nl.GeolocateControl(e),t)}catch(r){console.error(`Error adding geolocate control: ${r.message}`)}}addFullscreenControl(){try{this.map.addControl(new nl.FullscreenControl)}catch(e){console.error(`Error adding fullscreen control: ${e.message}`)}}getBounds(){try{return this.map.getBounds()}catch(e){console.error(`Error getting bounds: ${e.message}`)}}getCenter(){try{return this.map.getCenter()}catch(e){console.error(`Error getting center: ${e.message}`)}}setTerrain(e){try{return this.map.setTerrain(e)}catch(t){console.error(`Error setting terrain: ${t.message}`)}}setLayerZoomRange(e,t,r){try{return this.map.setLayerZoomRange(e,t,r)}catch(n){console.error(`Error setting terrain: ${n.message}`)}}getCanvas(){try{return this.map.getCanvas()}catch(e){console.error(`Error getting canvas: ${e.message}`)}}setCenter(e){try{return this.map.setCenter(e)}catch(t){console.error(`Error setting center: ${t.message}`)}}addLayer(e,t){try{this.map.addLayer(e,t)}catch(r){console.error(`Error adding layer: ${r.message}`)}}addLayerGeoJSON(e){try{this.map.addSource(`${e.id}`,{type:"geojson",data:e.data}),this.map.addLayer({id:`${e.id}-layerIcgcMap`,type:e.layerType,source:`${e.id}`,layout:e.layout,paint:e.paint},this._firstSymbolLayer())}catch(t){console.error(`Error adding GeoJSON layer: ${t.message}`)}}addLayerWMS(e,t){try{let r="";t==="labels"&&(r=this._firstSymbolLayer()),t==="lines"&&(r=this._firstLineLayer()),this.map.addSource(`${e.id}`,{type:"raster",tiles:[e.tiles],tileSize:256},r),this.map.addLayer({id:`${e.id}-layerIcgcMap`,type:"raster",source:`${e.id}`,paint:{}},r)}catch(r){console.error(`Error adding WMS layer: ${r.message}`)}}removeControl(e){try{this.map.removeControl(e)}catch(t){console.error(`Error removing control: ${t.message}`)}}removeLayer(e){try{this.map.removeLayer(e)}catch(t){console.error(`Error removing layer: ${t.message}`)}}removeSource(e){try{this.map.removeSource(e)}catch(t){console.error(`Error removing source: ${t.message}`)}}addLogo(e){try{const t=document.createElement("img");t.src=e.url,t.style.height="62px";const r=document.getElementById("logos"),n=document.createElement("a");n.id=e.id,n.href=e.href,n.target="_blank",n.style.position="relative",n.style.bottom="1px",n.appendChild(t),r.appendChild(n)}catch(t){console.error(`Error adding logo: ${t.message}`)}}addBasemapsICGC(e){try{const t=n=>{map.setStyle(n)},r=document.getElementById("basemap-group");for(const n of e)for(const o of Object.keys(rn.baseStyles)){const l=rn.baseStyles[o];if(n===l.url){const s=document.createElement("div");s.className="basemap-item",s.title=l.key,s.style.backgroundImage=`url('${l.image}')`,r.appendChild(s),s.addEventListener("click",()=>t(l.url))}}}catch(t){console.error(`Error adding basemaps: ${t.message}`)}}addBasemaps(e){try{const t=n=>{console.log("base",n),map.setStyle(n.url)},r=document.getElementById("basemap-group");e.forEach(n=>{const o=document.createElement("div");o.className="basemap-item",o.title=n.label,o.style.backgroundImage=`url('${n.image}')`,r.appendChild(o),o.addEventListener("click",()=>t(n))})}catch(t){console.error(`Error adding basemaps: ${t.message}`)}}addFeatureQuery(e,t,r){try{let n;this.map.on("mouseenter",e,()=>{this.map.getCanvas().style.cursor="pointer"}),this.map.on("mouseleave",e,()=>{this.map.getCanvas().style.cursor=""}),this.map.on("click",o=>{let l=this.map.queryRenderedFeatures(o.point);if(l&&l[0].source.includes(e)){let s=[o.lngLat.lng,o.lngLat.lat];if(t!==void 0&&t.length>0&&t!=="all"){if(t!==null){let g="";t.forEach(v=>{let T=l[0].properties[v];g=g+`<h4>${T}</h4>`}),n=g,map.addPopup(s,n,r)}}else{let g="";for(const v in l[0].properties)g+="<b>"+v+"</b>:"+l[0].properties[v]+"<br>";n=g,map.addPopup(s,n,r)}}})}catch(n){console.error(`Error adding feature query: ${n.message}`)}}addScaleControl(e,t){try{var r=new nl.ScaleControl(e);this.map.addControl(r,t)}catch(n){console.error(`Error adding scale: ${n.message}`)}}addExportControl(e,t){try{typeof e=="string"&&(t=e,e=void 0),e===void 0&&(e={PageSize:Mg.A4,PageOrientation:Gy.Landscape,Format:bd.PNG,DPI:RC[300],Crosshair:!0,PrintableArea:!0},t="top-right"),map.addControl(new zre(e),t)}catch(r){console.error(`Error adding export control: ${r.message}`)}}addPopup(e,t){try{new nl.Popup().setLngLat(e).setHTML(t).addTo(this.map)}catch{}}addMarker(e){try{let t,r;return e.text===void 0?t=new nl.Marker(e.options).setLngLat(e.coord).addTo(this.map):(r=new nl.Popup({offset:e.textOffset}).setText(e.text),t=new nl.Marker().setLngLat(e.coord).setPopup(r).addTo(this.map)),t}catch(t){return console.error(`Error adding marker: ${t.message}`),null}}addPopup(e,t,r){try{return r.image===void 0?new nl.Popup().setLngLat(e).setHTML(`
|
|
3157
3157
|
|
|
3158
3158
|
<div class="popupBody">
|
|
3159
3159
|
|