MTR ETA

home

search

planner

status

正在載入車務狀況...
↗ 起點 ORIGIN
點擊地圖選取
↘ 終點 DEST
點擊地圖選取
載入實時車務狀況...
${timeStr} 分鐘 (預估)
${fareHtml} `; let html = ''; const segs = []; if (res.edges.length > 0) { let cl = res.edges[0].lineId, cc = res.edges[0].lineColor, cn = res.edges[0].lineName, cStas = [res.path[0]]; for(let i=0; i
${MtrData.stations[startId].name} 讀取班次中...
乘搭 ${seg.lineName}
`; else { const td = getTransferDetails(startId, segs[s-1].lineId, seg.lineId); html += `
${MtrData.stations[startId].name}
轉乘 ${seg.lineName}(步程 ${td.walk} min + 等候 0~${td.waitMax} min)
`; } const inters = seg.stations.slice(1, -1); if(inters.length>0) html += `
途經 ${inters.length} 個車站
${inters.map(id => `
${MtrData.stations[id].name}
`).join('')}
`; else html += `
`; if(s===segs.length-1) html += `
${MtrData.stations[seg.stations[seg.stations.length - 1]].name} (終點)
`; } document.getElementById('itinerary-list').innerHTML = html; const resultPanel = document.getElementById('route-result'); resultPanel.classList.remove('expanded-full'); resultPanel.classList.add('open'); } function toggleInter(el) { el.classList.toggle('open'); el.nextElementSibling.classList.toggle('open'); } function closeResult() { document.getElementById('route-result').classList.remove('open'); document.getElementById('route-drawer').classList.remove('slide-down'); highlightLayer.clearLayers(); resetStationVisuals(); updateMarkersVisuals(); map.flyTo([22.32, 114.17], 12, { duration: 0.8 }); } return { init, resizeMap, setFocus, swapStations, calculateRoute, closeResult, toggleInter }; })(); window.addEventListener('resize', () => { if (AppNav.currentIndex === 2) setTimeout(() => MtrApp.resizeMap(), 80); }); window.addEventListener('orientationchange', () => { if (AppNav.currentIndex === 2) setTimeout(() => MtrApp.resizeMap(), 250); }); // ========================================== // 啟動程序 // ========================================== document.addEventListener('DOMContentLoaded', () => { AppNav.init(); HomeManager.init(); SearchManager.reset(); MtrApp.init(); StatusManager.init(); });