const markerConfig={'finish':{className:'marker_finish',size:[58,58],offset:[0,-29],span:false,best:false,text:false,},'start':{className:'marker_start',size:[58,58],offset:[0,-29],span:false,best:false,text:false,},'star':{className:'marker_star',size:[58,58],offset:[0,-29],span:false,best:false,text:false,},'numbered':{className:'mapMarkerNum',size:false,offset:[0,0],span:true,best:true,text:false,},'star-plain':{className:'mapMarkerNum markerSpanRed',size:false,offset:[0,0],span:true,best:false,text:'☆',},'grey':{className:'mapMarkerNum markerSpanGrey',size:false,offset:[0,0],span:true,best:false,text:false,},};function addMarkersToMap(m,f=null){Object.values(markerData[m]).forEach((i,n)=>{if(f!==null&&n'+t+'';} if(mC.width&&mC.height){el.style.width=mC.width+'px';el.style.height=mC.height+'px';} var marker=new mapboxgl.Marker(el,{offset:mC.offset}).setLngLat(i.lonLat).addTo(window.contentMaps[m]);marker.markerType=i.iconType;if(f!==null){} i.marker=marker;window.bounds[m].extend(i.lonLat);if(i.c){marker.getElement().addEventListener('click',function(){event.stopPropagation();toggleMapIconClick(m,n,true);});}});}if(typeof window.contentMaps==='undefined'){window.contentMaps={};window.initialMapBounds={};} if(typeof window.bounds==='undefined'){window.bounds={};} if(typeof window.markerData==='undefined'){window.markerData={};} if(!markerData[1]){markerData[1]={};} function initMapbox_1(){mapboxgl.accessToken='pk.eyJ1IjoibGF6eXRyaXBzIiwiYSI6ImNsaTJ4anh2MTA5NDYzZW85ODJmMm45ZzcifQ.9u5pN47V7SsoFwF6_Pw5bQ';const contentMap_1=new mapboxgl.Map({container:'contentMap_1',style:'mapbox://styles/mapbox/streets-v11',center:[-7.67257453631433,53.36969828826685],zoom:6,cooperativeGestures:true});window.contentMaps[1]=contentMap_1;if(typeof window.bounds[1]==='undefined'){window.bounds[1]=new mapboxgl.LngLatBounds();} const contentStart_1_1=[-7.27123602489391,55.06786455032659];const contentStart_1_1_geoson={'type':'FeatureCollection','features':[{'type':'Feature','geometry':{'type':'Point','coordinates':contentStart_1_1},'properties':{'title':'Start','description':'Start point'}}]};for(const feature of contentStart_1_1_geoson.features){const el=document.createElement('div');el.className='marker_start';new mapboxgl.Marker(el,{offset:[0,-29]}).setLngLat(feature.geometry.coordinates).addTo(contentMap_1);} window.bounds[1].extend(contentStart_1_1);const contentFinish_1_2=[-8.522340356296061,51.70615856476314];const contentFinish_1_2_geoson={'type':'FeatureCollection','features':[{'type':'Feature','geometry':{'type':'Point','coordinates':contentFinish_1_2},'properties':{'title':'Finish','description':'Finish point'}}]};for(const feature of contentFinish_1_2_geoson.features){const el=document.createElement('div');el.className='marker_star';new mapboxgl.Marker(el,{offset:[0,-29]}).setLngLat(feature.geometry.coordinates).addTo(contentMap_1);} window.bounds[1].extend(contentFinish_1_2);async function getRoute_1_0(start,finish,via){const url=`https://api.mapbox.com/directions/v5/mapbox/driving/${start.join(',')};${via}${finish.join(',')}?alternatives=true&geometries=geojson&language=en&overview=full&steps=true&access_token=${mapboxgl.accessToken}`;const response=await fetch(url);const json=await response.json();const data=json.routes[0];const route=data.geometry.coordinates;const geojson={type:'Feature',properties:{},geometry:{type:'LineString',coordinates:route}};for(const coord of route){window.bounds[1].extend(coord);contentMap_1.fitBounds(window.bounds[1],{padding:{top:60,bottom:60,left:60,right:60}});} if(contentMap_1.getSource('route1_0')){contentMap_1.getSource('route1_0').setData(geojson);}else{contentMap_1.addLayer({id:'route1_0',type:'line',source:{type:'geojson',data:geojson},layout:{'line-join':'round','line-cap':'round'},paint:{'line-color':'#0b7192','line-width':5,'line-opacity':0.80}});}} const start_1_0=[-7.2712360248939,55.067864550327];const finish_1_0=[-8.62719797236,52.663689062987];const via_1_0='-7.076595255109,55.222517776149;-7.1748046607888,55.313563229758;-7.3737702434173,55.383096302063;-7.5343970458547,55.200567342218;-7.5279363108043,55.1318799408;-7.6118323172314,55.219200413907;-7.612986660434,55.219862517684;-7.9695641660614,55.182514415419;-8.3184476797578,54.992607373525;-8.6265865950122,54.660499200932;-8.9607157872319,54.285076622624;-9.5664037389142,54.288853573199;-9.7884051390481,53.947270154604;-9.7987264888054,53.695032596279;-10.025096693188,53.501358321882;-9.8068065000947,53.318545672758;-9.0567080810269,53.271150260074;-9.4242707181333,52.970740718108;-9.8471114049932,52.578000091821;-9.6393791877765,52.625134792777;-9.3980924849395,52.617473661064;-9.1661173857218,52.625875087733;';contentMap_1.on('load',async()=>{await getRoute_1_0(start_1_0,finish_1_0,via_1_0);});contentMap_1.fitBounds(window.bounds[1],{padding:{top:60,bottom:60,left:60,right:60}});async function getRoute_1_1(start,finish,via){const url=`https://api.mapbox.com/directions/v5/mapbox/driving/${start.join(',')};${via}${finish.join(',')}?alternatives=true&geometries=geojson&language=en&overview=full&steps=true&access_token=${mapboxgl.accessToken}`;const response=await fetch(url);const json=await response.json();const data=json.routes[0];const route=data.geometry.coordinates;const geojson={type:'Feature',properties:{},geometry:{type:'LineString',coordinates:route}};for(const coord of route){window.bounds[1].extend(coord);contentMap_1.fitBounds(window.bounds[1],{padding:{top:60,bottom:60,left:60,right:60}});} if(contentMap_1.getSource('route1_1')){contentMap_1.getSource('route1_1').setData(geojson);}else{contentMap_1.addLayer({id:'route1_1',type:'line',source:{type:'geojson',data:geojson},layout:{'line-join':'round','line-cap':'round'},paint:{'line-color':'#0b7192','line-width':5,'line-opacity':0.80}});}} const start_1_1=[-8.62719797236,52.663689062987];const finish_1_1=[-8.5223403562961,51.706158564763];const via_1_1='-10.161688182014,52.283358496454;-10.158073733271,52.215204678362;-10.450591814473,52.130148012397;-10.266003260913,52.141394143479;-10.113641110524,51.998348429752;-10.309097873988,51.915507374839;-10.368483724202,51.856709848899;-10.30035074995,51.823447354236;-10.099482203436,51.768998867083;-9.5839109344897,51.880261883599;-9.7085300858002,51.597440771732;-9.8187551379545,51.452954655629;-9.2621447676451,51.495833793774;-9.1827376139381,51.527411163859;-9.136281600749,51.544317170773;-9.0925726604722,51.565248630261;-8.9359182914207,51.552764686099;-8.5602068358892,51.638661553327;';contentMap_1.on('load',async()=>{await getRoute_1_1(start_1_1,finish_1_1,via_1_1);});contentMap_1.fitBounds(window.bounds[1],{padding:{top:60,bottom:60,left:60,right:60}});initialMapBounds[1]=new mapboxgl.LngLatBounds(window.bounds[1].getSouthWest(),window.bounds[1].getNorthEast());const visibleMapRoutes_1=[];contentMaps[1].on('click',(e)=>{resetMarkersAndCards(1);});addMarkersToMap(1);contentMap_1.fitBounds(window.bounds[1],{padding:{top:60,bottom:60,left:60,right:60}});} var mapScriptCreated = 0; var mapCssCreated = 0; var mapScriptLoaded = 0; var mapCssLoaded = 0; var mapLoadList = []; function showLazyMap(fname) { if (mapScriptLoaded == 1 && mapCssLoaded == 1) { if (!mapLoadList.includes(fname)) { window[fname](); mapLoadList.push(fname); } } } (function fn() { var pics = document.querySelectorAll('.no-js-hide'); pics.forEach(function(pic) { pic.classList.toggle('no-js-hide'); }); var lazyImages = [].slice.call(document.querySelectorAll(".lazeeload")); if ("IntersectionObserver" in window) { const config = { root: null, rootMargin: '1000px', threshold: 0 }; let lazyImageObserver = new IntersectionObserver(function(entries, observer) { entries.forEach(function(entry) { if (entry.isIntersecting) { let lazyImage = entry.target; if (lazyImage.dataset.src) {lazyImage.src = lazyImage.dataset.src;} if (lazyImage.dataset.srcset) {lazyImage.srcset = lazyImage.dataset.srcset;} if (lazyImage.dataset.map) { const fname = "initMapbox_"+lazyImage.dataset.map; if (mapScriptLoaded == 0) { let script = document.createElement('script'); script.async=true; script.defer=true; script.src = "https://api.mapbox.com/mapbox-gl-js/v3.0.0/mapbox-gl.js"; script.onload = function(){ mapScriptLoaded = 1; showLazyMap(fname); } document.head.appendChild(script); mapScriptCreated = 1; let css = document.createElement('link'); css.rel = "stylesheet"; css.href = "https://api.mapbox.com/mapbox-gl-js/v3.0.0/mapbox-gl.css"; css.onload = function(){ mapCssLoaded = 1; showLazyMap(fname); } document.head.appendChild(css); mapCssCreated = 1; } else { if (typeof window[fname] === 'function') { window[fname](); } showLazyMap(fname); } } lazyImage.classList.remove("no-js-hide"); lazyImage.classList.remove("lazeeload"); lazyImageObserver.unobserve(lazyImage); } }); }, config); lazyImages.forEach(function(lazyImage) { lazyImageObserver.observe(lazyImage); lazyImage.classList.add("lazeeload-activated"); }); } else { let active = false; const lazyLoad = function() { if (active === false) { active = true; setTimeout(function() { lazyImages.forEach(function(lazyImage) { if ((lazyImage.getBoundingClientRect().top <= window.innerHeight+1000 && lazyImage.getBoundingClientRect().bottom >= 0) && getComputedStyle(lazyImage).display !== "none") { if (lazyImage.dataset.src) lazyImage.src = lazyImage.dataset.src; if (lazyImage.dataset.srcset) lazyImage.srcset = lazyImage.dataset.srcset; if (lazyImage.dataset.onload) lazyImage.onload = lazyImage.dataset.onload; lazyImage.classList.remove("lazeeload"); lazyImages = lazyImages.filter(function(image) { return image !== lazyImage; }); if (lazyImages.length === 0) { document.removeEventListener("scroll", lazyLoad); window.removeEventListener("resize", lazyLoad); window.removeEventListener("orientationchange", lazyLoad); } } }); active = false; }, 200); } }; document.addEventListener("scroll", lazyLoad); window.addEventListener("resize", lazyLoad); window.addEventListener("orientationchange", lazyLoad); } var lazyImages = [].slice.call(document.querySelectorAll(".lazeeload")); i=1; lazyImages.forEach(function(lazyImage) { if (!(lazyImage.classList.contains("lazeeload-activated"))) { if (lazyImage.dataset.src) lazyImage.src = lazyImage.dataset.src; if (lazyImage.dataset.srcset) lazyImage.srcset = lazyImage.dataset.srcset; lazyImage.classList.remove("lazeeload"); } }); })(); document.addEventListener('DOMContentLoaded', () => { const h = document.querySelector('header.fixed-top'), o = getComputedStyle(h).right; ['show.bs.modal', 'hidden.bs.modal'].forEach(e => document.querySelectorAll('.fullScreenModal').forEach(m => m.addEventListener(e, ev => h.style.right = ev.type === 'show.bs.modal' ? `${window.innerWidth - document.documentElement.clientWidth}px` : o))); });