PageSourceSearch

https://www.visitluxembourg.com/_assets/6d62c6bba06369fdc43580a1a9…/Components/Atoms/Map.js?1790574605

js visitluxembourg.com collected 2026-10-01 10:43:41 UTC 25,880 bytes, 1 lines download raw bytes

1(()=>{var e={839:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(29981),i=n(58611),a=n.n(i);class o{constructor(e,t,n){this.mapInstance=e,this.markerData=t,this.domElement=n,this.activeClassName="-js-listItem--active",this.markerId=t.id||t,this.mapMarkerObject=this._getOrCreateMarker(),this._registerEventsOnDomElement()}_getOrCreateMarker(){return window.mapInstance&&window.mapInstance.markers&&window.mapInstance.markers[this.markerId]?window.mapInstance.markers[this.markerId]:new s.A(this.markerId,this.markerData,this.mapInstance)}getMarkerObject(){return this.mapMarkerObject}_registerEventsOnDomElement(){this.domElement&&this.domElement.addEventListener("click",(async e=>{if(!window.matchMedia("(max-width: 1000px)").matches)return;if(!e.target.closest(".button--fakelink"))return;e.preventDefault();const t=this.domElement.closest(".fullscreenMap");await this.mapMarkerObject.loadInfoWindow(),t?.classList.remove("-js-fullscreenMap--list-active"),t?.classList.add("fullscreenMap--infoWindow")}))}scrollToDomElement(){if(!this.domElement)return;const e=window.innerHeight,t=a().offsetTop(this.domElement)-e/2+this.domElement.offsetHeight/2;window.scrollTo({top:t,behavior:"smooth"})}activate(){if(this.domElement){const e=this.domElement.parentElement;e&&(Array.from(e.children).forEach((e=>e.classList.remove(this.activeClassName))),this.domElement.classList.add(this.activeClassName))}window.mapInstance&&window.mapInstance.mapLegend&&(window.mapInstance.mapLegend.removeOverlays(),window.mapInstance.mapLegend.showMapMarker({[this.markerId]:this.markerData})),this.mapMarkerObject.setActive(),this.mapInstance.getView().setCenter(this.mapMarkerObject.getMapMarker().getPosition())}}},29510:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});class s{constructor(e,t){this.gpx=e,this.map=t,this.vector=this.buildVector()}buildVector(){var e={Point:new ol.style.Style({image:new ol.style.Circle({fill:new ol.style.Fill({color:"rgba(255,255,255,1)"}),radius:10,stroke:new ol.style.Stroke({color:"#0099FF",width:1})})}),LineString:new ol.style.Style({stroke:new ol.style.Stroke({color:"#0099FF",width:3})}),MultiLineString:new ol.style.Style({stroke:new ol.style.Stroke({color:"#0099FF",width:3})})};const t=new ol.layer.Vector({source:new ol.source.Vector({url:"//"+window.location.host+this.gpx,format:new ol.format.GPX}),style:function(t){return e[t.getGeometry().getType()]},visible:!1});return this.map.addLayer(t),t}showLayer(){this.vector.setVisible(!0);let e=this.vector.getSource().getExtent();if(e[0]===1/0){const e=this;this.vector.getSource().on("addfeature",(function(){e.map.getView().fit(e.vector.getSource().getExtent())}))}else this.map.getView().fit(e)}hideLayer(){this.vector.setVisible(!1)}}},29981:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(47134),i=n(29510);const a=n(58611);class o{static closeListener=null;static oldPosition=void 0;static oldZoom=void 0;static gpx={};constructor(e,t,n,s){this.id=e,this.coords=this._getCoords(t),this.map=n,this.defaultIcon="poiMarker_dot",this.title=this._getTitel(t),this.icon=this._getIcon(t),this.connector=s,this.active=!1,this.isLoadingInfoWindow=!1,this.gpx=this._checkForGpx(t);const i=document.getElementById("fullscreenmap");this.activeIcon=i.dataset.activeIcon,this.inactiveIcon=i.dataset.inactiveIcon,this.mapMarker=this._addMarkerToMap(n),this.infoWindowContainer=document.getElementById("infoWindowContainer"),document.addEventListener("location:updated",this._updateDistances.bind(this))}_getCoords(e){let t=e[1],n=e[0];return"NaN"!==t&&"NaN"!==n&&[parseFloat(n),parseFloat(t)]}_getTitel(e){return e[2]||""}_getIcon(e){return null===e[4]||""===e[4]?this.defaultIcon:e[4]}_checkForGpx(e){return!!(e.length>5&&e[5])&&e[5]}_addMarkerToMap(e){let t=this.coords,n=this.gpx;if(t){n&&void 0===o.gpx[n]&&(o.gpx[n]=new i.A(n,e));const s=this.connector?this.connector.handleMarkerClick?.bind(this.connector,this):this.loadInfoWindow.bind(this),a=e.showMarker({position:t,positionSrs:4326,positioning:"bottom-center",iconURL:this.inactiveIcon,click:!0,onClick:s,id:this.id});if(a&&a.element){a.element.id=`${this.id}`,a.element.classList.add("map-marker"),this.icon&&"undefined"!==this.icon||(this.icon=this.defaultIcon),a.element.innerHTML=`\n          <sp
1an class="marker-icon-wrapper">\n            <svg width="26" height="36" viewBox="0 0 26 36" fill="none" xmlns="http://www.w3.org/2000/svg">\n              <path d="M13 0C5.83176 0 0 5.84874 0 13.0378C0 21.9596 11.6337 35.0574 12.129 35.6106C12.5943 36.1303 13.4066 36.1294 13.871 35.6106C14.3663 35.0574 26 21.9596 26 13.0378C25.9999 5.84874 20.1682 0 13 0Z" fill="#575656"/>\n            </svg>\n            <span class="icon icon-${this.icon}"></span>\n          </span>\n        `;const e=this.connector?this.connector.handleMarkerClick?.bind(this.connector,this):this.loadInfoWindow.bind(this);a.element.querySelector(".marker-icon-wrapper").addEventListener("click",e)}return a}}async loadInfoWindow(){if(this.isLoadingInfoWindow)return;this.isLoadingInfoWindow=!0;const e=document.querySelector(".fullscreenMap");e&&(e.classList.remove("-js-fullscreenMap--filter-active"),window.innerWidth>=1001&&e.classList.add("-js-fullscreenMap--list-active"));const t=document.querySelector(".fullscreenMap__list");t&&window.innerWidth>=1001&&t.classList.add("is-active"),window.fullscreenMapList&&(window.fullscreenMapList.activateItem(this.id),setTimeout((()=>{let e=document.querySelector(`.fullscreenMap__list .listItem[data-identifier="${this.id}"]`);e||(e=document.querySelector(`.fullscreenMap__list [data-identifier="${this.id}"]`)),e&&(document.querySelectorAll(".fullscreenMap__list .listItem").forEach((e=>e.classList.remove("-js-listItem--active"))),e.classList.add("-js-listItem--active"),e.scrollIntoView({behavior:"smooth",block:"center"}))}),100));const n=document.getElementById("fullscreenmap");if(n&&n.parentElement&&n.parentElement.parentElement&&n.parentElement.parentElement.classList.add("fullscreenMap--infoWindow"),!self.closeListener){self.closeListener=!0;const e=document.querySelector(".fullscreenMap__infoWindowContainer .infoWindow__closer");e&&e.addEventListener("click",(()=>{this.map.getView().setZoom(self.oldZoom),self.oldZoom=void 0,self.oldPosition=void 0,this.setAllInactive(),window.dispatchEvent(new Event("resize"))}))}try{this.map.getView().setZoom(15);const e=this.mapMarker.getPosition();this.map.getView().setCenter(e);const t=new URLSearchParams;t.append("type",1200),t.append("infoId",this.id),this.fetchInfoWindow(t).then((t=>{if(this.setAllInactive(),this.infoWindowContainer){this.infoWindowContainer.innerHTML=t,this.infoWindowContainer.querySelectorAll("[data-ajax]").forEach(this.fetchAjaxContent);let e=this.infoWindowContainer.querySelector(".infoWindow"),n=a.accessDataset(e,"gpx");void 0!==n&&(this.map.getView().setZoom(12.5),void 0===o.gpx[n]&&(o.gpx[n]=new i.A(n,this.map)),o.gpx[n].showLayer()),this.map.updateSize(),(0,s.A)(e)}window.matchMedia("(max-width: 650px)").matches&&this.map.getView().centerOn(e,this.map.getSize(),[screen.availWidth/2,(screen.availHeight-document.querySelector(".fullscreenMap__infoWindowContainer").clientHeight)/2]),self.oldZoom=self.oldZoom||this.map.getView().getZoom(),self.oldPosition=self.oldPosition||this.map.getView().getCenter(),this.setActive()})).finally((()=>{this.isLoadingInfoWindow=!1}))}catch(e){console.log("Fetch error: ",e),this.isLoadingInfoWindow=!1,this.infoWindowContainer&&(this.infoWindowContainer.innerHTML="")}return!0}async fetchInfoWindow(e){const t=await fetch(window.location.origin+window.location.pathname+"?"+new URLSearchParams(e).toString());return await t.text()}async fetchAjaxContent(e){const t=e.dataset.ajax;try{const n=await fetch(t);e.outerHTML=await n.text()}catch(t){console.log("Fetch error: ",t),e.outerHTML=""}}getElement(){return this.mapMarker.element}setActive(){this.active=!0,this.mapMarker.element.classList.add("-js-marker-active"),this.mapMarker.element.querySelector(".marker-icon-wrapper").classList.add("-js-marker-active"),this.map.getView().setCenter(this.mapMarker.getPosition()),window.dispatchEvent(new Event("resize"))}setInactive(){this.active=!1,this.mapMarker.element.classList.remove("-js-marker-active"),this.mapMarker.element.querySelector(".marker-icon-wrapper").classList.remove("-js-marker-active")}setAllInactive(){for(let e in o.gpx)o.gpx[e].hideLayer();this.map.getTarget().querySelectorAll(".-js-marker-active").forEach((function(e){e.classList.remove("-js-marker-active"),e.querySelector(".marker-icon-wrapper")?.classList.remove("-js-marker-active")}))}getMapMarker(){return this.mapMarker}_updateDistances(){let e=this.infoWindowContainer.querySelector(".infoWindow");e&&(0,s.A)(e)}}},33140:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var s=n(29981);class i{constructor(e,t,n,s){this.mapInstance=s,this.activeIdent=e,this.allIdents=t,this.mapLayerIds=n,this.removeOverlays(),this.hideLegend(),this.showMapMarker(this.allIdents,this.activeIdent),this.addMapLayer(this.mapLayerIds)}hideLegend(){document.querySelector(".maplegend").style.display="none"}removeOverlays(){this.mapInstance.getOverlays().clear()}showMapMarker(e,t){let n=this;if(e&&!(Object.keys(e).length<2)){for(const[i,a]of Object.entries(e)){let e=new s.A(i,a,n.mapInstance);i===t&&(e.setActive(),e.loadInfoWindow())}this.fitView()}}fitView(){const e=this._getBounds();this.mapInstance.updateSize(),this.mapInstance.getView().fit(e,this.mapInstance.getSize())}_getBounds(){const e=this.mapInstance.getOverlays();let t=Number.MAX_VALUE,n=Number.MIN_VALUE,s=Number.MAX_VALUE,i=Number.MIN_VALUE;return e.forEach((e=>{let a=e.getPosition();t=Math.min(t,a[1]),n=Math.max(n,a[1]),s=Math.min(s,a[0]),i=Math.max(i,a[0])})),ol.extent.boundingExtent([[s,t],[i,n]])}addMapLayer(e){const t=JSON.parse(e);Array.isArray(t)&&t.forEach((e=>{this.mapInstance.addLayerById(e)}))}}},47134:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var s=n(79433);function i(e){const t=parseFloat(e.dataset.latitude),n=parseFloat(e.dataset.longitude);if(!isNaN(t)&&!isNaN(n)){const i=[n,t];!function(e,t){const n=e.querySelector(".iconList");if(n&&t){const e=n.querySelector("[data-icon-distance]");e?e.innerHTML=t?t+" km":"":n.appendChild(function(e){const t=document.createElement("div");
1return t.innerHTML=`\n      <span class="iconList__element">\n        <span class="icon-poi_marker iconList__element__icon" aria-hidden="true"></span>\n        <small class="iconList__element__text" aria-hidden="true" data-icon-distance>\n          ${e?e+" km":""}\n        </small>\n      </span>\n    `,t}(t))}}(e,(0,s.A)(i))}}},58611:e=>{e.exports={offsetTop:function(e){var t=document.querySelector("body");return e.getBoundingClientRect().top-t.getBoundingClientRect().top},offsetLeft:function(e){var t=document.querySelector("body");return e.getBoundingClientRect().left-t.getBoundingClientRect().left},scrollTo:function(e,t,n){var s=function(){return{x:window.pageXOffset,y:window.pageYOffset}},i=s(),a={x:(e-i.x)/(n/15),y:(t-i.y)/(n/15)},o=setInterval((function(){!function(){var n=s(),i={x:!1,y:!1};return a.x<0?n.x+a.x<=e&&(i.x=!0):n.x+a.x>=e&&(i.x=!0),a.y<0?n.y+a.y<=t&&(i.y=!0):n.y+a.y>=t&&(i.y=!0),!(!i.x||!i.y)}()?window.scrollBy(a.x,a.y):(clearInterval(o),window.scrollTo(e,t))}),15)},scrollElementTo:function(e,t,n,s){var i=function(){return{x:s.scrollLeft,y:s.scrollTop}},a=i(),o=(e-a.x)/(n/15),r=(t-a.y)/(n/15),c=setInterval((function(){!function(){var n=i(),s={x:!1,y:!1};return o<0?n.x+o<=e&&(s.x=!0):n.x+o>=e&&(s.x=!0),r<0?n.y+r<=t&&(s.y=!0):n.y+r>=t&&(s.y=!0),!(!s.x||!s.y)}()?(s.scrollLeft+=o,s.scrollTop+=r):(clearInterval(c),s.scrollLeft=e,s.scrollTop+=t)}),15)},accessDataset:function(e,t){return e.dataset?e.dataset[t]:e.getAttribute("data-"+t)},extendObject:function(e,t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n]);return e},documentReady:function(e){let t=!1;"undefined"!=typeof less&&"object"==typeof less.pageLoadFinished&&(t=!0);var n=function(){t?less.pageLoadFinished.then((()=>{setTimeout(e)})):setTimeout(e)},s=function(){document.removeEventListener("DOMContentLoaded",s),window.removeEventListener("load",s),n()};"complete"===document.readyState?n():(document.addEventListener("DOMContentLoaded",s),window.addEventListener("load",s))}}},60850:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var s=n(29981);class i{value;next;constructor(e){this.value=e}}class a{#e;#t;#n;constructor(){this.clear()}enqueue(e){const t=new i(e);this.#e?(this.#t.next=t,this.#t=t):(this.#e=t,this.#t=t),this.#n++}dequeue(){const e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,this.#e||(this.#t=void 0),e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}}function o(e){let t=!1;if("object"==typeof e&&({concurrency:e,rejectOnClear:t=!1}=e),r(e),"boolean"!=typeof t)throw new TypeError("Expected `rejectOnClear` to be a boolean");const n=new a;let s=0;const i=()=>{s<e&&n.size>0&&(s++,n.dequeue().run())},o=async(e,t,n)=>{const a=(async()=>e(...n))();t(a);try{await a}catch{}s--,i()},c=(t,...a)=>new Promise(((r,c)=>{((t,a,r,c)=>{const l={reject:r};new Promise((e=>{l.run=e,n.enqueue(l)})).then(o.bind(void 0,t,a,c)),s<e&&i()})(t,r,c,a)}));return Object.defineProperties(c,{activeCount:{get:()=>s},pendingCount:{get:()=>n.size},clearQueue:{value(){if(!t)return void n.clear();const e=AbortSignal.abort().reason;for(;n.size>0;)n.dequeue().reject(e)}},concurrency:{get:()=>e,set(t){r(t),e=t,queueMicrotask((()=>{for(;s<e&&n.size>0;)i()}))}},map:{async value(e,t){const n=Array.from(e,((e,n)=>c(t,e,n)));return Promise.all(n)}}}),c}function r(e){if(!Number.isInteger(e)&&e!==Number.POSITIVE_INFINITY||!(e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}class c{constructor(e){this.mapInstance=e,this.markers={},this.singleItemIdent=null;const t=new URLSearchParams(window.location.search);this.singleItemIdent=t.get("ident"),this.initLegend(),this.formData=null,this.pendingFetchOperation=null,window.mapInstance&&(window.mapInstance.mapLegend=this)}initLegend(){const e=document.querySelector(".maplegend");if(!e)return;this.singleItemIdent&&window.filterManager&&window.filterManager.reset(),this.setupFilterManagerListeners(e),this.setupMapLayerCheckboxes(e),this.setupSearchPillListeners();const t=o(10);if(e.addEventListener("singleItem:selected",(e=>{const n=e.detail.ident;this.removeOverlays(),this.pendingFetchOperation&&clearTimeout(this.pendingFetchOperation);const s=new URLSearchParams;s.append("type",1100),s.append("ident",n),t((()=>{fetch(window.location.pathname+"?"+s.toString()).then((e=>e.json())).then((e=>{0===Object.keys(e).length&&n?this.fetchSingleItem(n):(this.showMapMarker(e),this.updateResultsCount(Object.keys(e).length))})).catch((e=>{console.error("Failed to load single item:",e),n&&this.fetchSingleItem(n)}))}))})),this.singleItemIdent){const t=new CustomEvent("singleItem:selected",{detail:{ident:this.singleItemIdent}});e.dispatchEvent(t)}else window.filterManager?window.filterManager.applyFilters():console.warn("Warning: Filter manager not found")}fetchSingleItem(e){const t=new URLSearchParams;t.append("type",1112),t.append("ident",e),fetch(window.location.pathname+"?"+t.toString()).then((e=>e.text())).then((t=>{const n=document.createElement("div");n.innerHTML=t;const s=n.querySelector(".listItem");if(s){const t=s.dataset.latitude,n=s.dataset.longitude,i=s.dataset.icon;if(t&&n){const a={};a[e]=[n,t,s.querySelector(".listItem__title")?.textContent,null,i||null],this.showMapMarker(a),this.updateResultsCount(1),window.fullscreenMapList&&(window.fullscreenMapList.listItemsContainer.innerHTML="",window.fullscreenMapList.listItemsContainer.appendChild(s),this.markers[e]&&window.fullscreenMapInstance?.mapInstance&&window.fullscreenMapList.connectSingleMarkerToListItem(e,s),setTimeout((()=>{window.fullscreenMapList.activateItem(e)}),300))}}})).catch((e=>console.error("Failed to fetch single item details:",e)))}setupFilterManagerListeners(e){e.addEventListener("filters:applied",this.handleFiltersApplied.bind(this)),e.addEventListener("map:reset",this.handleMapReset.bind(this))}handleFiltersApplied(){this.preserveAndRefreshLayers()}handleMapReset(){for(const e in s.A.gpx){const t=s.A.gpx[e];t&&(t.hideLayer(),t.vector&&this.mapInstance.removeLayer(t.vector))}s.A.gpx={};const e=document.getElementById("fullscreenmap");if(!e)return;const t=e.dataset.bounds;if(t)try{const e=JSON.parse(t);if(e&&e.length>1){const t=e[1][0],n=e[0][0],s=e[1][1],i=e[0][1],a=ol.extent.boundingExtent([ol.proj.fromLonLat([s,t]),ol.proj.fromLonLat([i,n])]);return void this.mapInstance.getView().fit(a,{size:this.mapInstance.getSize(),duration:500})}}catch(e){}try{const t=JSON.parse(e.dataset.coords||"{}");t.lat&&t.lng&&this.mapInstance.getView().setCenter(ol.proj.fromLonLat([t.lng,t.lat]))}catch(e){}this.mapInstance.getView().setZoom(13)}setupMapLayerCheckboxes(e){e.querySelectorAll('.fullscreenMap__checkbox input[type="checkbox"][data-maplayer]').forEach((e=>{e.addEventListener("change",(t=>{t.stopPropagation();const n=e.dataset.maplayer;this.addOrRemoveLayer(n,e)}))}))}setupSearchPillListeners(){document.addEventListener("click",(e=>{if(e.target.classList.contains("fullscreenMap__pill__icon")||e.target.closest(".fullscreenMap__pill__icon")){const t=e.target.closest(".fullscreenMap__pill");t&&this.removeSearchPill(t)}}))}removeSearchPill(e){e.remove();const t=document.getElementById("fullscreenMap__search__input");t&&(t.value=""),window.filterManager&&(window.filterManager.searchFilter="",window.filterManager.applyFilters())}preserveAndRefreshLayers=async()=>{const e=document.querySelector(".maplegend");if(e){const t=e.querySelectorAll('.fullscreenMap__checkbox input[type="checkbox"][data-maplayer]'),n=[];t.forEach((e=>{const t=e.dataset.maplayer;this.removeLayerById(this.mapInstance,t),e.checked&&n.push({layerId:t,checkbox:e})}
1)),await this.refreshLayers(),n.forEach((e=>{this.mapInstance.addLayerById(e.layerId)}))}else await this.refreshLayers()};refreshLayers=async e=>{e&&e.preventDefault(),this.removeOverlays();const t=document.querySelector(".maplegend");if(!t)return void console.warn("No legend form found, refresh canceled");this.formData=new FormData(t);const n=new URLSearchParams([...this.formData.entries()]);this.singleItemIdent?([...n.keys()].forEach((e=>{"type"!==e&&n.delete(e)})),n.append("ident",this.singleItemIdent)):window.filterManager&&window.filterManager.searchFilter&&n.append("search",window.filterManager.searchFilter),n.append("type",1100),this.pendingFetchOperation&&clearTimeout(this.pendingFetchOperation);try{const e=await fetch(window.location.pathname+"?"+n.toString()),t=await e.json();this.showMapMarker(t),this.updateResultsCount(Object.keys(t).length),this.singleItemIdent&&Object.keys(t).length>0&&setTimeout((()=>{const e=document.querySelector(".fullscreenMap__list");if(e&&!e.classList.contains("is-active")){e.classList.add("is-active");const t=document.querySelector(".fullscreenMap");t&&t.classList.add("-js-fullscreenMap--list-active")}}),500)}catch(e){console.error("Failed to refresh layers:",e)}};updateResultsCount(e){const t=document.querySelector(".fullscreenMap__summary__title");t?(t.textContent=t.textContent.replace(/^\d+/,""),t.textContent=`${e} `+t.textContent):console.warn("Summary title element not found")}removeOverlays(){this.mapInstance.getOverlays().clear(),this.markers={},this.mapInstance.getLayers().getArray().filter((e=>"VECTOR"===e.type&&(!e.values_||void 0===e.values_.id))).forEach((e=>{this.mapInstance.removeLayer(e)}))}showMapMarker(e){for(const[t,n]of Object.entries(e))this.markers[t]=new s.A(t,n,this.mapInstance);const t=new CustomEvent("markers:updated",{detail:{markers:e,markerObjects:this.markers}});document.dispatchEvent(t),window.mapInstance=window.mapInstance||{},window.mapInstance.markers=this.markers,Object.keys(this.markers).length>0?(this.fitMapToMarkers(),this.singleItemIdent&&setTimeout((()=>{const e=document.querySelector(".fullscreenMap__list");if(e&&!e.classList.contains("is-active")){e.classList.add("is-active");const t=document.querySelector(".fullscreenMap");t&&t.classList.add("-js-fullscreenMap--list-active")}}),800)):console.warn("No markers to fit in view")}fitMapToMarkers(){const e=this.mapInstance.getOverlays();if(0===e.getLength())return void console.warn("No overlays to fit in view");let t=null;if(e.forEach((e=>{const n=e.getPosition();if(!n)return;const s=ol.extent.boundingExtent([n,n]);t?ol.extent.extend(t,s):t=s})),t){const e=[50,50,50,50];this.mapInstance.getView().fit(t,{padding:e,maxZoom:15,duration:500})}else console.warn("No valid extent calculated")}addOrRemoveLayer(e,t){e?!1===t.checked?this.removeLayerById(this.mapInstance,e):this.mapInstance.addLayerById(e):console.warn("No layer ID provided")}findLayerById(e,t){return t?e.getLayers().getArray().find((e=>e.values_&&void 0!==e.values_.id&&parseInt(e.values_.id)===parseInt(t))):(console.warn("No layer ID provided for lookup"),null)}removeLayerById(e,t){const n=this.findLayerById(e,t);n?e.removeLayer(n):console.warn(`Layer #${t} not found, cannot remove`)}}},67792:()=>{},67888:(e,t,n)=>{"use strict";var s=n(89254);n(58611).documentReady((()=>{const e=document.getElementById("fullscreenmap");e&&(window.fullscreenMapInstance=new s.K(e)),new URLSearchParams(window.location.search).has("ident")&&[".fullscreenMap__summary__wrap",".fullscreenMap__search"].forEach((e=>{const t=document.querySelector(e);t&&(t.style.display="none")}))}))},79433:(e,t,n)=>{"use strict";function s(e){return e*(Math.PI/180)}function i(e){if(!e||!window.filterManager||!window.filterManager.coordinates)return"";const t=window.filterManager.coordinates,n=s(t[1]),i=s(t[0]),a=s(e[1]),o=a-n,r=s(e[0])-i;return(2*Math.asin(Math.sqrt(Math.pow(Math.sin(o/2),2)+Math.cos(n)*Math.cos(a)*Math.pow(Math.sin(r/2),2)))*6371).toFixed(1)}n.d(t,{A:()=>i})},89254:(e,t,n)=>{"use strict";n.d(t,{K:()=>r});var s=n(839),i=n(60850),a=n(33140);const o=n(58611);class r{idents;constructor(e){this.connectors=[],this.rootNode=e,this.mapInstance=null,this.mapLegend=null,this.travelPlan=null,this.singleItemIdent=null,this.initializationComplete=!1;const t=new URLSearchParams(window.location.search);this.singleItemIdent=t.get("ident"),imxGeoPortalLoader.loadGeoPortal(),this.createMap()}async createMap(){const e=JSON.parse(o.accessDataset(this.rootNode,"coords")),t=JSON.parse(o.accessDataset(this.rootNode,"bounds")||"[]"),n=new Promise(((e,t)=>{const n=()=>
1{if("undefined"!=typeof lux&&lux instanceof Object)return e(lux),!0;setTimeout(n,1e3)};n()}));await n;let s={target:this.rootNode,bgLayer:"basemap_2015_global",zoom:13,positionSrs:4326,position:[e.lng,e.lat],callback:this._initMap,showLayerInfoPopup:this.singleItemIdent};this.rootNode.dataset.bgLayerStyle&&(s.bgLayerStyle=this.rootNode.dataset.bgLayerStyle),this.singleItemIdent||(s.layerInfoCallback=function(e){const t=document.getElementById("infoWindowContainer");this.rootNode.parentElement.parentElement.classList.add("fullscreenMap--infoWindow"),t.innerHTML="";let n=document.createElement("iframe");n.src="https://apiv4.geoportail.lu/getbuswidget?lang=en&id="+e[0].values_.extid,t.appendChild(n),n.classList.add("fullscreenMap__infoWindowContainer__departuresIframe")}),this.mapInstance=new lux.Map(s),this.rootNode.dataset.layerIds&&this.rootNode.dataset.layerIds.split(",").filter((e=>e)).forEach((e=>{this.mapInstance.addLayerById(e.trim())})),t.length>1&&this.mapInstance.getMapReadyPromise().then((()=>{this.fitView(t)})),this.mapInstance.getMapReadyPromise().then((()=>{setTimeout((()=>{this.initializationComplete=!0,this.fireInitializationCompleteEvent()}),2e3)}))}fireInitializationCompleteEvent(){if(!this.initializationComplete||this.singleItemIdent)return;if(window.mapInstance&&window.mapInstance.markers&&Object.keys(window.mapInstance.markers).length>0){const e=new CustomEvent("markers:updated",{detail:{markers:window.mapInstance.markers,markerObjects:window.mapInstance.markers,isInitialEvent:!0}});document.dispatchEvent(e),console.log("Markers found, dispatching markers event")}else{const e=new CustomEvent("markers:updated",{detail:{markers:{},markerObjects:{},isInitialEvent:!0}});document.dispatchEvent(e),console.log("No markers found, dispatching empty markers event")}const e=new CustomEvent("map:initialized",{detail:{map:this.mapInstance,fullscreenMap:this}});document.dispatchEvent(e)}createConnectors(e,t){if(this.connectors=[],t)for(const[n,i]of Object.entries(e)){const e=t.find((e=>e.dataset.id===n));if(e){const t=new s.A(this.mapInstance,{id:n,data:i},e);this.connectors.push(t)}}else for(const[t,n]of Object.entries(e)){const e=new s.A(this.mapInstance,{id:t,data:n},null);this.connectors.push(e)}}_inactivateAllMarkers(){this.connectors&&this.connectors.forEach((e=>e.getMarkerObject().setInactive()))}fitView(e){const t=this._getBounds(e);this.mapInstance.getView().fit(t,{size:this.mapInstance.getSize(),duration:1e3})}_getBounds(e){let t=e[1][0],n=e[0][0],s=e[1][1],i=e[0][1];return ol.extent.boundingExtent([ol.proj.fromLonLat([s,t]),ol.proj.fromLonLat([i,n])])}_initMap(){this.getView().setMinZoom(9.5),this.getView().setZoom(9.5),this.mapLegend=new i.A(this);let e=window.location.hash.split("#")[1];if(e){const t=atob(e);e=JSON.parse(t)}const t=new URLSearchParams(window.location.search),n=t.get("ident")??null,s=t.get("mapLayerIds")??null;return(n||e)&&(this.travelPlan=new a.A(n,e,s,this)),this}}}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(67792),n(89254),n(839),n(29510),n(60850),n(29981),n(33140),n(67888)})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.