{const jR=await new Promise(resolve=>{const intervalId=setInterval(()=>{if(x.c.route.json&&Array.isArray(x.c.route.json)&&x.c.route.json.length>0){clearInterval(intervalId);resolve(true);}},100);});if(jR){const paddingRoutePixels=20;let extendWest=false,extendEast=false,extendNorth=false,extendSouth=false;x.c.route.json.forEach(coord=>{if(coord[0]R.getEast())extendEast=true;if(coord[1]>R.getNorth())extendNorth=true;if(coord[1]status)){T.extend(B.getSouthWest());T.extend(B.getNorthEast());T.extend(R.getSouthWest());T.extend(R.getNorthEast());map.fitBounds(T,{padding:0,duration:600,easing:(t)=>t*(2-t)});}}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:[-81.2149613149161,37.55765956944134],zoom:5,cooperativeGestures:false});window.contentMaps[1]=contentMap_1;if(typeof window.bounds[1]==='undefined'){window.bounds[1]=new mapboxgl.LngLatBounds();}
markerData[1][0]={"lonLat":[-71.0599214263338,42.359875171894636],"type":"star-plain"};markerData[1][1]={"lonLat":[-79.03775690146053,43.09632482013656],"best":1,"time":420,"distance":470,"type":"numbered","c":{"route":{"id":188,"color":"#fa5050"},"card":{"title":"Niagara Falls","d":"470 miles","t":420,"p":"[\"75caf8bf3f12f7b12a738a3c8480382e\",\"The amazing Niagara Falls is renowned for its beauty and is the collective name for three waterfalls that straddle the international border between Canada and the USA.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-niagara-falls","linkText":"Read more"}}};markerData[1][2]={"lonLat":[-74.00710307720708,40.71306730258164],"best":2,"time":240,"distance":215,"type":"numbered","c":{"route":{"id":623,"color":"#fa5050"},"card":{"title":"New York City","d":"215 miles","t":240,"p":"[\"a46153b1f9993b02aa8cd38ba2ced33c\",\"Times Square, New York at dusk \"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-new-york-city","linkText":"Read more"}}};markerData[1][3]={"lonLat":[-70.25688587228751,43.65911560384449],"best":3,"time":110,"distance":110,"type":"numbered","c":{"route":{"id":106,"color":"#fa5050"},"card":{"title":"Portland, Maine","d":"110 miles","t":110,"p":"[\"18e5233294ec733b3a6fcb823b992fa9\",\"A wonderful morning in Portland, Maine, with the sea and Portland Head Light view at sunrise.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-portland-maine","linkText":"Read more"}}};markerData[1][4]={"lonLat":[-68.30633682803175,44.36268052586348],"best":4,"time":390,"distance":320,"type":"numbered","c":{"route":{"id":39,"color":"#fa5050"},"card":{"title":"Acadia National Park and Bar Harbor","d":"320 miles","t":390,"p":"[\"ad33d751931122ee61103b96f8d23b51\",\"Panoramic view of the stunning fall colors and blue waters of the Bay in Acadia National Park\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-acadia-national-park-and-bar-harbor","linkText":"Read more"}}};markerData[1][5]={"lonLat":[-77.0369051070515,38.9072292484714],"best":5,"time":460,"distance":440,"type":"numbered","c":{"route":{"id":550,"color":"#fa5050"},"card":{"title":"Washington DC","d":"440 miles","t":460,"p":"[\"429300fb9d0786fa141d1c59b97f515a\",\"Washington DC, USA in spring season at the Tidal Basin and Jefferson Memorial.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-washington-dc","linkText":"Read more"}}};markerData[1][6]={"lonLat":[-70.18457165856738,42.05472175544807],"best":6,"time":140,"distance":120,"type":"numbered","c":{"route":{"id":2100,"color":"#fa5050"},"card":{"title":"Cape Cod and Provincetown, Massachusetts","d":"120 miles","t":140,"p":"[\"e4accbf71d935d109a8c18fd7901b546\",\"Wooden bridge across lagoon to small island with vibrant sunset\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-cape-cod-and-provincetown","linkText":"Read more"}}};markerData[1][7]={"lonLat":[-75.16522588641888,39.952625203577426],"best":7,"time":430,"distance":400,"type":"numbered","c":{"route":{"id":843,"color":"#fa5050"},"card":{"title":"Philadelphia","d":"400 miles","t":430,"p":"[\"5641ea5a582b2fbae6de0a360e275ee6\",\"Liberty Bell old symbol of American freedom in Philadelphia Pennsylvania, USA\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-philadelphia","linkText":"Read more"}}};markerData[1][8]={"lonLat":[-71.41265686605436,41.82386918658522],"best":8,"time":60,"distance":50,"type":"numbered","c":{"route":{"id":2099,"color":"#fa5050"},"card":{"title":"Providence","d":"50 miles","t":60,"p":"[\"1321e36db3b5f041d83f7320269fa397\",\"Skyling of Providence, Rhode Island from across the Providence River.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-providence-rhode-island","linkText":"Read more"}}};markerData[1][9]={"lonLat":[-71.20807706407393,46.817436333912575],"best":9,"time":460,"distance":390,"type":"numbered","c":{"route":{"id":2493,"color":"#fa5050"},"card":{"title":"Quebec City","d":"390 miles","t":460,"p":"[\"735d434387c815d6fc513e7eef4c4dbd\",\"Frontenac Castle in Old Quebec City in the beautiful sunrise light.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-quebec-city","linkText":"Read more"}}};markerData[1][10]={"lonLat":[-79.38274600037307,43.65323585635001],"best":10,"time":540,"distance":600,"type":"numbered","c":{"route":{"id":2495,"color":"#fa5050"},"card":{"title":"Toronto","d":"600 miles","t":540,"p":"[\"22ff62b450753c5007755b1845f75ec6\",\"Toronto, Canada skyline with purple light and the city in the background reflecting in the water in the foreground.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-toronto","linkText":"Read more"}}};markerData[1][11]={"lonLat":[-87.62982077532793,41.8782302080943],"best":11,"time":890,"distance":985,"type":"numbered","c":{"route":{"id":561,"color":"#fa5050"},"card":{"title":"Chicago","d":"985 miles","t":890,"p":"[\"38dd7b431be60bf1ac7fdeb46b94cffb\",\"Millennium Park, Chicago, Illinois\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-chicago","linkText":"Read more"}}};markerData[1][12]={"lonLat":[-73.56741022188457,45.50191600906266],"best":12,"time":285,"distance":300,"type":"numbered","c":{"route":{"id":619,"color":"#fa5050"},"card":{"title":"Montreal","d":"300 miles","t":285,"p":"[\"34ce8d86ec04d2a84879a4c10c9863ef\",\"High rise buildings with sunlight hitting at an angle and red and yellow fall colours on the trees in the foreground\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-montreal","linkText":"Read more"}}};markerData[1][13]={"lonLat":[-63.54574560201267,45.0776187763377],"best":13,"time":870,"distance":660,"type":"numbered","c":{"route":{"id":488,"color":"#fa5050"},"card":{"title":"Nova Scotia","d":"660 miles","t":870,"p":"[\"a1938ed6b91b26df89aeab1e7f829c2b\",\"Nova Scotia, Canada with coastline views from the Keltic Lodge in Ingonish on the Cabot Trail on Nova Scotia on a sunny day.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-nova-scotia","linkText":"Read more"}}};markerData[1][14]={"lonLat":[-78.880405,33.6957],"best":14,"time":1030,"distance":930,"type":"numbered","c":{"route":{"id":2497,"color":"#fa5050"},"card":{"title":"Myrtle Beach","d":"930 miles","t":1030,"p":"[\"17a86b849020839d7be61ffab86f4aa6\",\"Myrtle Beach in South Carolina at dusk with the city skyline and beach.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-myrtle-beach","linkText":"Read more"}}};markerData[1][15]={"lonLat":[-78.63831633405657,35.7796443335934],"best":15,"time":740,"distance":730,"type":"numbered","c":{"route":{"id":2105,"color":"#fa5050"},"card":{"title":"Raleigh","d":"730 miles","t":740,"p":"[\"1c0ebed24764e76ce7304018c4d38b42\",\"Raleigh, North Carolina, USA downtown as viewed from the Capitol Building grounds.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-raleigh-nc","linkText":"Read more"}}};initialMapBounds[1]=new mapboxgl.LngLatBounds(window.bounds[1].getSouthWest(),window.bounds[1].getNorthEast());const visibleMapRoutes_1=[];contentMaps[1].on('click',(e)=>{resetMarkersAndCards(1);});onMapZoom(1);markerData[1][18]={"lonLat":[-81.37916590937645,28.5384256551969],"time":1420,"distance":1400,"type":"grey","c":{"route":{"id":1215,"color":"#fa5050"},"card":{"title":"Orlando","d":"1,400 miles","t":1420,"p":"[\"0d2151513ce3f1893cb87cdb49e79e44\",\"Orlando, Florida, USA at Universal studios city walk with a view of the Lighthouse, entrance to Islands of Adventure.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-orlando","linkText":"Read more"}}};markerData[1][16]={"lonLat":[-80.19203744531521,25.761841840134185],"time":1500,"distance":1580,"type":"grey","c":{"route":{"id":508,"color":"#fa5050"},"card":{"title":"Miami","d":"1,580 miles","t":1500,"p":"[\"01cba2e8dbe59daac2c500d04c6c23df\",\"Miami, Florida, USA with a skyline view of the city, palm trees and sea in the foreground. \"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-miami","linkText":"Read more"}}};markerData[1][17]={"lonLat":[-118.24301602662825,34.055032656384576],"time":2880,"distance":3115,"type":"grey","c":{"route":{"id":728,"color":"#fa5050"},"card":{"title":"Los Angeles","d":"3,115 miles","t":2880,"p":"[\"00a0b391306adfb6d4751032da9495c5\",\"Beautiful sunset of Los Angeles downtown skyline and palm trees\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-boston-to-los-angeles","linkText":"Read more"}}};addMarkersToMap(1);contentMap_1.fitBounds(window.bounds[1],{padding:{top:60,bottom:60,left:60,right:60}});const sortByValue=document.querySelector('.cardListSortDropdown').value;sortMapMarkers(markerData,sortOptionsMap,sortByValue,1);}const sortOptionsMap={'best':'best','distance':'distanceSort',};function sortMapMarkers(markerData,sortOptionsMap,sortBy,listNum){const markersWithDistance=Object.values(markerData[listNum]).filter(marker=>marker.hasOwnProperty('distance')&&marker.hasOwnProperty('best'));const hasDistanceSort=markersWithDistance.some(marker=>marker.hasOwnProperty('distanceSort'));if(!hasDistanceSort){const sortedMarkers=markersWithDistance.sort((a,b)=>a.distance-b.distance);sortedMarkers.forEach((sortedMarker,index)=>{sortedMarker.distanceSort=index+1;});}
Object.keys(markerData[listNum]).forEach(n=>{const marker=markerData[listNum][n];if(marker.hasOwnProperty('distance')&&marker.hasOwnProperty('best')){const markerElement=document.getElementById('markerSpan-'+listNum+'-'+n);if(markerElement){const propertyToUse=sortOptionsMap[sortBy]||sortBy;const v=marker[propertyToUse];if(v!==undefined){markerElement.innerHTML=v;}else{markerElement.innerHTML='';}}}});document.querySelectorAll('.cardListSortDropdown').forEach(function(dropdownUpdate){dropdownUpdate.value=sortBy;});}
(function(){function iSort(){document.querySelectorAll('.cardListSortDropdown').forEach(function(dropdown){dropdown.addEventListener('change',function(){const sortBy=this.value;const listNum=this.getAttribute('data-listnum');const cardsContainer=document.querySelector('.row[data-listnum=\"'+listNum+'\"]');Array.from(cardsContainer.children).sort((a,b)=>{const aValue=parseFloat(a.getAttribute('data-'+sortBy)||Infinity);const bValue=parseFloat(b.getAttribute('data-'+sortBy)||Infinity);return aValue-bValue;}).forEach((card,index)=>{cardsContainer.appendChild(card);const titleElement=card.querySelector('.card-title');if(titleElement){const updatedTitle=titleElement.innerHTML.replace(/^\s*\d+/,index+1);titleElement.innerHTML=updatedTitle;}});sortMapMarkers(markerData,sortOptionsMap,sortBy,listNum);});});}
if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',iSort);}else{iSort();}})(); 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)));
});