function mapClickSim(m,i){new bootstrap.Modal(document.getElementById('contentMapModal_'+m)).show();function w(){if(window.contentMaps[m]!==undefined&&typeof toggleMapIconClick==="function"&&typeof resetMarkersAndCards==="function"){resetMarkersAndCards(m);setTimeout(()=>{toggleMapIconClick(m,i,true);},500);}else{setTimeout(w,100);}} w();} function handleActionClick(e){const target=e.target.closest('[data-action]');if(!target)return;const{action,actionArgs}=target.dataset;const fn={mapClickSim}[action];fn&&fn(...actionArgs.split(',').map(Number));} if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',()=>{document.querySelectorAll('[data-action]').forEach(b=>b.addEventListener('click',handleActionClick));});}else{document.querySelectorAll('[data-action]').forEach(b=>b.addEventListener('click',handleActionClick));}function genImgContent(p,m){p=JSON.parse(p);if(Array.isArray(p[0])){let d='carousel'+Math.random().toString(36).substr(2,9);b='';for(let i=0;i`;} let c=``;return c;}else{return genImg(p,m);}} function genImg(p,m){var c=m?'w-100 h-100 object-fit-cover':'img-fluid w-100';var a=p[0];var u=`https://cdn.lazytrips.com/photos/`+a.slice(0,2)+'/'+a.slice(2,4)+'/'+a;var r=``+p[1]+``;return r;} function getNewLngLat(m,o,f){var p=m.project(new mapboxgl.LngLat(o[0],o[1]));p.x+=f.x;p.y+=f.y;return m.unproject(p);} function onMapZoom(m){if(contentMaps[m]){contentMaps[m].on('zoom',function(){Object.keys(markerData[m]).forEach(function(i){var p=markerData[m][i];if(!mDev()&&p.cardInstance){var o={x:p.c.card.oX,y:p.c.card.oY};var n=getNewLngLat(contentMaps[m],p.lonLat,o);p.cardInstance.setLngLat([n.lng,n.lat]);}});});}} async function fetchRoute(d,m,i,c){const p={routeId:d};const r=await fetch('/api/request-route',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(p)});if(r.ok){const j=await r.json();if(j.response&&j.response.route){const d=JSON.parse(j.response.route);markerData[m][i].c.route.json=d;updateMapWithRoute(m,i,d,c);}}} function updateMapWithRoute(m,i,r,c){const l='iconRoute_'+m+'_'+i;const g={type:'Feature',properties:{},geometry:{type:'LineString',coordinates:r}};if(contentMaps[m].getLayer(l)){contentMaps[m].setLayoutProperty(l,'visibility','visible');contentMaps[m].getSource(l).setData(g);}else{contentMaps[m].addLayer({id:l,type:'line',source:{type:'geojson',data:g},layout:{'line-join':'round','line-cap':'round'},paint:{'line-color':c,'line-width':5,'line-opacity':0.8}});}} function hideRouteLayer(m,i){const l='iconRoute_'+m+'_'+i;if(contentMaps[m].getLayer(l)){contentMaps[m].setLayoutProperty(l,'visibility','none');}} window.toggleMapIconClick=function(m,i,e=true){if(markerData[m][i].a){return;} for(const[key,icon]of Object.entries(markerData[m])){if(parseInt(key)===i){continue;} if(icon.popupInstance){icon.popupInstance.remove();delete icon.popupInstance;} if(icon.c?.route&&contentMaps[m].getLayer('iconRoute_'+m+'_'+key)){hideRouteLayer(m,key);} if(icon.marker){icon.marker.getElement().classList.remove('markerSpanSelect');} if(icon.cardInstance){icon.cardInstance.remove();delete icon.cardInstance;} if(icon.cardOverlay){var o=icon.cardOverlay;if(o&&o.parentNode){o.parentNode.removeChild(o);delete icon.cardOverlay;}} icon.a=false;} if(!markerData[m][i].a){markerData[m][i].marker.getElement().classList.add('markerSpanSelect');if(markerData[m][i].c?.popup){const t=markerData[m][i].c.popup.title;const p=markerData[m][i].c.popup.text;let popupHTML='
';if(t){popupHTML+='

'+t+'

';} if(p){popupHTML+='

'+p+'

';} popupHTML+='
';var popup=new mapboxgl.Popup({anchor:'bottom',closeButton:false,closeOnClick:false,className:'pointer'}).setLngLat(markerData[m][i].lonLat).setHTML(popupHTML).addTo(contentMaps[m]);markerData[m][i].popupInstance=popup;popup._content.addEventListener('click',function(){toggleMapIconClick(m,i);});markerData[m][i].marker.getElement().style.display='none';} if(markerData[m][i].c?.route){const layerId='iconRoute_'+m+'_'+i;if(contentMaps[m].getLayer(layerId)){contentMaps[m].setLayoutProperty(layerId,'visibility','visible');}else{fetchRoute(markerData[m][i].c.route.id,m,i,markerData[m][i].c.route.color);}} if(markerData[m][i].c?.card){var cardContent={n:markerData[m][i].c.card.title,d:markerData[m][i].c.card.d,t:markerData[m][i].c.card.t,p:markerData[m][i].c.card.p,};if(markerData[m][i].c.card.hasOwnProperty('link')){cardContent.l=markerData[m][i].c.card.link;} if(markerData[m][i].c.card.hasOwnProperty('linkText')){cardContent.s=markerData[m][i].c.card.linkText;} if(!mDev()){var cardContentHtml=createCardContentHtml(cardContent,false);var offsets={x:markerData[m][i].c.card.oX,y:markerData[m][i].c.card.oY};var newLngLat=getNewLngLat(contentMaps[m],markerData[m][i]['lonLat'],offsets);var cardPopup=new mapboxgl.Popup({anchor:'bottom',closeButton:false,closeOnClick:false,className:'mapPopupCard'}).setHTML(cardContentHtml).setLngLat([newLngLat.lng,newLngLat.lat]).addTo(contentMaps[m]);markerData[m][i].cardInstance=cardPopup;setTimeout(()=>{if(markerData[m][i].cardInstance&&markerData[m][i].cardInstance.isOpen()){markerData[m][i].c.card.height=markerData[m][i].cardInstance.getElement().offsetHeight;}},10);}else{var cardMobile=document.createElement('div');cardMobile.className='mapPopupCardMobile';cardMobile.innerHTML=createCardContentHtml(cardContent,true);var mapContainer=contentMaps[m].getContainer();mapContainer.appendChild(cardMobile);markerData[m][i].cardOverlay=cardMobile;}} markerData[m][i].a=true;if(e){updateMapBounds(m,i);}}else{resetMarkersAndCards(m);}} window.resetMarkersAndCards=function(m){Object.keys(markerData[m]).forEach((i)=>{if(markerData[m][i].marker){markerData[m][i].marker.getElement().classList.remove('markerSpanSelect');} if(markerData[m][i].popupInstance){markerData[m][i].popupInstance.remove();delete markerData[m][i].popupInstance;} if(markerData[m][i].c&&markerData[m][i].c.route){if(contentMaps[m].getLayer('iconRoute_'+m+'_'+i)){hideRouteLayer(m,i);}} if(markerData[m][i].c&&markerData[m][i].c.card){if(markerData[m][i].cardInstance){markerData[m][i].cardInstance.remove();delete markerData[m][i].cardInstance;}} if(markerData[m][i].cardOverlay){var o=markerData[m][i].cardOverlay;if(o&&o.parentNode){o.parentNode.removeChild(o);delete markerData[m][i].cardOverlay;}} markerData[m][i].marker.getElement().style.display='block';markerData[m][i].a=false;});} function formatTime(t){const h=Math.floor(t / 60);const m=t%60;return`⏱️ ${h > 0 ? h + " hour" + (h > 1 ? "s" : "") : ""}${h > 0 && m > 0 ? ", " : ""}${m > 0 ? m + " minute" + (m > 1 ? "s" : "") : ""}`;} function createCardContentHtml(c,m){cC='';if(m){cC=' d-flex flex-row';} let h='
';if(c.p){p=genImgContent(c.p,m);h+='
'+p+'
';} if(c.n||c.d||c.t||c.l){h+='
';if(c.n){h+='
'+c.n+'
';} if(c.d){h+='
';} if(c.d){h+='
🚗 '+c.d+'
';} if(c.t){h+='
'+formatTime(c.t)+'
';} if(!m){h+='
';} if(c.l){var z=c.s||'Read more';p='';if(m){p=' pt-2';} h+='';}} if(m){h+='
';} h+='
';return h;} document.addEventListener('shown.bs.modal',function(e){if(e.target.id.startsWith('contentMapModal_')){let m=e.target.id.replace('contentMapModal_','');let t=window.contentMaps[m];if(t){setTimeout(()=>{e.target.style.borderBottom='1px solid #eee';setTimeout(()=>{e.target.style.borderBottom='';},1);},1);}}});window.addEventListener('resize',function(){document.querySelectorAll('[id^="contentMapModal_"]').forEach(p=>{if(p.classList.contains('show')){let m=p.id.replace('contentMapModal_','');let t=window.contentMaps[m];if(t){setTimeout(()=>{t.style.borderBottom='1px solid #eee';setTimeout(()=>{t.style.borderBottom='';},1);},1);}}});});function mDev(){return window.innerWidth<=768||window.innerHeight<=600;} async function updateMapBounds(m,n){const map=contentMaps[m];const oldBounds=contentMaps[m].getBounds();var T=contentMaps[m].getBounds();const D=contentMaps[m].getContainer().getBoundingClientRect();const x=markerData[m][n];const lngDiff=oldBounds.getNorthEast().lng-oldBounds.getSouthWest().lng;const latDiff=oldBounds.getNorthEast().lat-oldBounds.getSouthWest().lat;const lngPerPx=lngDiff / D.width;const latPerPx=latDiff / D.height;const U=[];var B=new mapboxgl.LngLatBounds(T.toArray());var R=new mapboxgl.LngLatBounds(T.toArray());if(!mDev()&&markerData[m][n].c.card&&markerData[m][n].a){const cP=new Promise(async(resolve)=>{const h=await new Promise(resolveHeight=>{const hInt=setInterval(()=>{let chk=markerData[m][n].c.card.height;if(chk){clearInterval(hInt);resolveHeight(chk);}},100);});const w=300;var p=15;const z=contentMaps[m].getZoom();var a=0;if(z<7){a=(8-z)*10;} const oX=markerData[m][n].c.card.oX;const oY=markerData[m][n].c.card.oY;const P=map.project(new mapboxgl.LngLat(x.lonLat[0],x.lonLat[1]));const tG=P.y+oY-h if(tG{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.48782425299109,28.548417808889436],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":[-81.371008,28.199123],"type":"star-plain"};markerData[1][1]={"lonLat":[-81.393145,25.851844],"best":1,"time":235,"distance":210,"type":"numbered","c":{"route":{"id":1741,"color":"#fa5050"},"card":{"title":"Orlando to Everglades National Park","d":"210 miles","t":235,"p":"[\"f1337986fae151aca1dfb2b2009a3ad6\",\"Aerial view of Everglades National Park, Florida, with stunning blue waters and lush green vegetation and sunset above\"]","oX":-175,"oY":0}}};markerData[1][2]={"lonLat":[-80.19933919796956,25.768671878320088],"best":2,"time":210,"distance":235,"type":"numbered","c":{"route":{"id":507,"color":"#fa5050"},"card":{"title":"Orlando to Miami","d":"235 miles","t":210,"p":"[\"8fff1bed5c4ab94be3d14ae2b8f8036d\",\"Miami Beach, Florida, USA on Ocean Drive at sunset.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-orlando-to-miami","linkText":"Read more"}}};markerData[1][3]={"lonLat":[-81.77427447863118,24.555201082736076],"best":3,"time":570,"distance":400,"type":"numbered","c":{"route":{"id":315,"color":"#fa5050"},"card":{"title":"Orlando to Key West","d":"400 miles","t":570,"p":"[\"edf31523b1513b9bb8ff6ed711f02d1f\",\"Key west florida Smathers beach palm trees in USA\"]","oX":-175,"oY":0,"link":"\/trip\/road-trip-from-orlando-florida-to-key-west","linkText":"Read more"}}};markerData[1][4]={"lonLat":[-82.206429,26.531864],"best":4,"time":210,"distance":185,"type":"numbered","c":{"route":{"id":1739,"color":"#fa5050"},"card":{"title":"Orlando to Sanibel Island and Captiva Island","d":"185 miles","t":210,"p":"[\"811d270d2b0e59faea9a8d55037828f6\",\"Aerial view of the road leading to Sanibel Island, FL, surrounded by turquoise waters\"]","oX":-175,"oY":0}}};markerData[1][5]={"lonLat":[-80.603886,28.394434],"best":5,"time":50,"distance":55,"type":"numbered","c":{"route":{"id":1730,"color":"#fa5050"},"card":{"title":"Orlando to Cape Canaveral","d":"55 miles","t":50,"p":"[\"df67e5ef850cadd14535477246fe8708\",\"Apollo rockets stand tall against a blue sky in the Rocket Garden at Kennedy Space Center, Cape Canaveral\"]","oX":175,"oY":0}}};markerData[1][6]={"lonLat":[-79.931083,32.776506],"best":6,"time":410,"distance":395,"type":"numbered","c":{"route":{"id":1207,"color":"#fa5050"},"card":{"title":"Orlando to Charleston","d":"395 miles","t":410,"p":"[\"c78733b5a4dae1b922aa2105b150306f\",\"Charleston, South Carolina, USA with a row of colorful buildings and palms trees in the French Quarter taken at early evening.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-orlando-to-charleston","linkText":"Read more"}}};markerData[1][7]={"lonLat":[-73.98533875,40.75708072],"best":7,"time":940,"distance":1070,"type":"numbered","c":{"route":{"id":1748,"color":"#fa5050"},"card":{"title":"Orlando to New York","d":"1,070 miles","t":940,"p":"[\"0e8091eadcfc6f197fa5191921ff0052\",\"View of Manhattan from the Top of the Rock at dusk, with the Empire State Building in the center\"]","oX":175,"oY":0}}};markerData[1][8]={"lonLat":[-80.148614753712,26.113624398537198],"best":8,"time":225,"distance":220,"type":"numbered","c":{"route":{"id":494,"color":"#fa5050"},"card":{"title":"Orlando to Fort Lauderdale","d":"220 miles","t":225,"p":"[\"40372464e01423395707e10ce0d54808\",\"Fort Lauderdale, Florida, USA skyline over Barrier Island.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-orlando-florida-to-fort-lauderdale","linkText":"Read more"}}};markerData[1][9]={"lonLat":[-90.07204045103737,29.95091635535043],"best":9,"time":570,"distance":640,"type":"numbered","c":{"route":{"id":514,"color":"#fa5050"},"card":{"title":"Orlando to New Orleans","d":"640 miles","t":570,"p":"[\"efb11e6639b1ffd737ceac5c2732a137\",\"New Orleans, Louisiana, USA Downtown Skyline Aerial\"]","oX":-175,"oY":0,"link":"\/trip\/road-trip-from-orlando-to-new-orleans","linkText":"Read more"}}};markerData[1][10]={"lonLat":[-81.09121216619221,32.081032598017956],"best":10,"time":290,"distance":290,"type":"numbered","c":{"route":{"id":1221,"color":"#fa5050"},"card":{"title":"Orlando to Savannah","d":"290 miles","t":290,"p":"[\"c7bbfa29891dff5fa4d294cf87a41f67\",\"Savannah, Georgia, USA at Forsyth Park Fountain.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-orlando-florida-to-savannah","linkText":"Read more"}}};markerData[1][11]={"lonLat":[-82.799021,27.970686],"best":11,"time":120,"distance":105,"type":"numbered","c":{"route":{"id":1734,"color":"#fa5050"},"card":{"title":"Orlando to Clearwater, Honeymoon and Caladesi Islands","d":"105 miles","t":120,"p":"[\"f42f9eca51cb77c87cd99eebf681e997\",\"Wooden bridge leading to pristine white sands on Honeymoon Island, FL\"]","oX":-175,"oY":0}}};markerData[1][12]={"lonLat":[-86.785082,36.18953],"best":12,"time":600,"distance":690,"type":"numbered","c":{"route":{"id":1746,"color":"#fa5050"},"card":{"title":"Orlando to Nashville","d":"690 miles","t":600,"p":"[\"11c27fc20b28595fc59f31686a403aa1\",\"A crowd of people enjoy some live music at a rooftop bar in Nashville, TN\"]","oX":-175,"oY":0}}};markerData[1][13]={"lonLat":[-81.371008,28.199123],"best":13,"time":30,"distance":20,"type":"numbered","c":{"route":{"id":1728,"color":"#fa5050"},"card":{"title":"Orlando to Kissimmee and Lake Tohopekaliga","d":"20 miles","t":30,"p":"[\"bd3d4b313fe7a69f291bccd7d9246f64\",\"Principal corner at Celebration Town in Kissimmee area of Florida. Historic buildings with blue skies above\"]","oX":175,"oY":0}}};markerData[1][14]={"lonLat":[-82.645726,27.77116],"best":14,"time":100,"distance":110,"type":"numbered","c":{"route":{"id":1732,"color":"#fa5050"},"card":{"title":"Orlando to St Petersburg","d":"110 miles","t":100,"p":"[\"906cceb530bca51ada618f756e096687\",\"Fisting Pier at sunset in St Petersburg, FL, with calm sea and a purple-hued sky\"]","oX":-175,"oY":0}}};markerData[1][15]={"lonLat":[-81.782421,29.174623],"best":15,"time":80,"distance":70,"type":"numbered","c":{"route":{"id":1729,"color":"#fa5050"},"card":{"title":"Orlando to Ocala National Forest","d":"70 miles","t":80,"p":"[\"deaffd7f6301ef1e95dc8c33a2bdba64\",\"Alligator by the water at Alexander Springs, Ocala National Forest, Florida\"]","oX":-175,"oY":0}}};markerData[1][16]={"lonLat":[-82.26369,26.729],"best":16,"time":170,"distance":175,"type":"numbered","c":{"route":{"id":1737,"color":"#fa5050"},"card":{"title":"Orlando to Gasparilla Island State Park","d":"175 miles","t":170,"p":"[\"73f5c5ef023d72adaffb9ea1d5827a45\",\"Sunset over the still waters at Gasparilla State Park, FL\"]","oX":175,"oY":0}}};markerData[1][17]={"lonLat":[-81.31211,29.893347],"best":17,"time":100,"distance":110,"type":"numbered","c":{"route":{"id":1733,"color":"#fa5050"},"card":{"title":"Orlando to St Augustine","d":"110 miles","t":100,"p":"[\"4a8b6209b55675172946c21af0709bf1\",\"Early twilight at Flagler College in downtown St Augustine, FL, with the grand building and park lit up\"]","oX":175,"oY":0}}};markerData[1][18]={"lonLat":[-82.689434,28.908758],"best":18,"time":90,"distance":90,"type":"numbered","c":{"route":{"id":1731,"color":"#fa5050"},"card":{"title":"Orlando to Crystal River and Three Sisters Spring","d":"90 miles","t":90,"p":"[\"c0835324ea64ce40e95f69b98fc9fa7d\",\"Manatee swims underwater in the clear turquoise water at Crystal River Hot Springs, Florida\"]","oX":-175,"oY":0}}};markerData[1][19]={"lonLat":[-81.26881668378294,28.803274652594844],"best":19,"time":35,"distance":35,"type":"numbered","c":{"route":{"id":2607,"color":"#fa5050"},"card":{"title":"Orlando to Sanford","d":"35 miles","t":35,"p":"[\"4e8ccc743f790b7060e534fa9f603e7e\",\"Aerial view of Lake Monroe in Sanford Florida.\"]","oX":-175,"oY":-60}}};markerData[1][20]={"lonLat":[-86.491974,30.390143],"best":20,"time":380,"distance":420,"type":"numbered","c":{"route":{"id":1743,"color":"#fa5050"},"card":{"title":"Orlando to Destin","d":"420 miles","t":380,"p":"[\"f6cde33fbc5b6f61b1bc658e26a18d36\",\"White sands and clear blue water on the beach on the Emerald Coast near Henderson Beach State Park and Destin, Florida\"]","oX":-175,"oY":0}}};markerData[1][21]={"lonLat":[-83.031441,29.148317],"best":21,"time":170,"distance":135,"type":"numbered","c":{"route":{"id":1736,"color":"#fa5050"},"card":{"title":"Orlando to Cedar Key and Waccasassa Bay Preserve State Park","d":"135 miles","t":170,"p":"[\"6a7755a4405a438232a4ac6c516e0c29\",\"\"]","oX":-175,"oY":0}}};markerData[1][22]={"lonLat":[-84.38824133585835,33.74901670170111],"best":22,"time":390,"distance":440,"type":"numbered","c":{"route":{"id":497,"color":"#fa5050"},"card":{"title":"Orlando to Atlanta","d":"440 miles","t":390,"p":"[\"746d58338ba4a32101ee8f65337487e1\",\"Atlanta, Georgia, USA skyline sunset.\"]","oX":-175,"oY":0,"link":"\/trip\/road-trip-from-orlando-florida-to-atlanta","linkText":"Read more"}}};markerData[1][23]={"lonLat":[-82.53758,27.337498],"best":23,"time":135,"distance":130,"type":"numbered","c":{"route":{"id":1735,"color":"#fa5050"},"card":{"title":"Orlando to Sarasota, Bradenton, and Anna Maria Island","d":"130 miles","t":135,"p":"[\"1a6495a1ce28a9785ccc768f0aefa4ee\",\"Mediterranean-style building at Ca' d'Zan in The Ringling in Sarasota, Florida\"]","oX":-175,"oY":0}}};markerData[1][24]={"lonLat":[-80.92768514811993,29.028736589879504],"best":24,"time":70,"distance":60,"type":"numbered","c":{"route":{"id":2608,"color":"#fa5050"},"card":{"title":"Orlando to New Smyrna Beach","d":"60 miles","t":70,"p":"[\"94da1f748a8f7dbf78a38d7984621d66\",\"Blue skies and waters along New Smyrna Beach Florida Coastline\"]","oX":175,"oY":0}}};markerData[1][25]={"lonLat":[-81.64499649534406,28.803266879895443],"best":25,"time":55,"distance":35,"type":"numbered","c":{"route":{"id":2609,"color":"#fa5050"},"card":{"title":"Orlando to Mount Dora","d":"35 miles","t":55,"p":"[\"eb24f694f5b52a8ddd305cd333cf65e8\",\"Aerial view of Mount Dora Lighthouse, Mount Dora, Florida\"]","oX":-175,"oY":0}}};initialMapBounds[1]=new mapboxgl.LngLatBounds(window.bounds[1].getSouthWest(),window.bounds[1].getNorthEast());const visibleMapRoutes_1=[];contentMaps[1].on('click',(e)=>{resetMarkersAndCards(1);});markerData[1][28]={"lonLat":[-79.15544374767644,43.1666255360686],"time":1200,"distance":1262,"type":"grey","c":{"route":{"id":419,"color":"#fa5050"},"card":{"title":"Orlando to Niagara Falls","d":"1,262 miles","t":1200,"p":"[\"6e974ff4a94496ace50ef4804945837e\",\"Niagara Falls, USA\\\/Canada with the amazing falls in the center, taken on a sunny day with a few clouds and water spray rising in the air.\"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-orlando-florida-to-niagara-falls","linkText":"Read more"}}};markerData[1][26]={"lonLat":[-77.03576222149096,38.902872338252074],"time":1020,"distance":1025,"type":"grey","c":{"route":{"id":500,"color":"#fa5050"},"card":{"title":"Orlando to Washington DC","d":"1,025 miles","t":1020,"p":"[\"de321f36a7be5a334a843c24ff87e1aa\",\"United States Capitol, Washington DC, USA with the dome lit up at night and reflected on the ground and taken at sunset. \"]","oX":175,"oY":0,"link":"\/trip\/road-trip-from-orlando-florida-to-washington-dc","linkText":"Read more"}}};markerData[1][27]={"lonLat":[-110.638816,44.467202],"time":2100,"distance":2325,"type":"grey","c":{"route":{"id":1750,"color":"#fa5050"},"card":{"title":"Orlando to Yellowstone National Park","d":"2,325 miles","t":2100,"p":"[\"3dbfe38860a2ac6971888a3cd978e52a\",\"Bison crossing a tree-flanked road at Mammoth Hot Springs in Yellowstone National Park\"]","oX":-175,"oY":0}}};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=(index+1)+titleElement.innerHTML.replace(/^\d+\./,'.');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))); });