✨ MAJOR FEATURES: • Auto-zoom intelligence với smart bounds fitting • Enhanced 3D GPS markers với pulsing effects • Professional route display với 6-layer rendering • Status-based parking icons với availability indicators • Production-ready build optimizations 🗺️ AUTO-ZOOM FEATURES: • Smart bounds fitting cho GPS + selected parking • Adaptive padding (50px) cho visual balance • Max zoom control (level 16) để tránh quá gần • Dynamic centering khi không có selection 🎨 ENHANCED VISUALS: • 3D GPS marker với multi-layer pulse effects • Advanced parking icons với status colors • Selection highlighting với animation • Dimming system cho non-selected items 🛣️ ROUTE SYSTEM: • OpenRouteService API integration • Multi-layer route rendering (glow, shadow, main, animated) • Real-time distance & duration calculation • Visual route info trong popup 📱 PRODUCTION READY: • SSR safe với dynamic imports • Build errors resolved • Global deployment via Vercel • Optimized performance 🌍 DEPLOYMENT: • Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app • Bundle size: 22.8 kB optimized • Global CDN distribution • HTTPS enabled 💾 VERSION CONTROL: • MapView-v2.0.tsx backup created • MAPVIEW_VERSIONS.md documentation • Full version history tracking
88 lines
2.6 KiB
JavaScript
88 lines
2.6 KiB
JavaScript
/* eslint-disable */
|
|
var jumpToCode = (function init() {
|
|
// Classes of code we would like to highlight in the file view
|
|
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
|
|
|
|
// Elements to highlight in the file listing view
|
|
var fileListingElements = ['td.pct.low'];
|
|
|
|
// We don't want to select elements that are direct descendants of another match
|
|
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
|
|
|
|
// Selecter that finds elements on the page to which we can jump
|
|
var selector =
|
|
fileListingElements.join(', ') +
|
|
', ' +
|
|
notSelector +
|
|
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
|
|
|
|
// The NodeList of matching elements
|
|
var missingCoverageElements = document.querySelectorAll(selector);
|
|
|
|
var currentIndex;
|
|
|
|
function toggleClass(index) {
|
|
missingCoverageElements
|
|
.item(currentIndex)
|
|
.classList.remove('highlighted');
|
|
missingCoverageElements.item(index).classList.add('highlighted');
|
|
}
|
|
|
|
function makeCurrent(index) {
|
|
toggleClass(index);
|
|
currentIndex = index;
|
|
missingCoverageElements.item(index).scrollIntoView({
|
|
behavior: 'smooth',
|
|
block: 'center',
|
|
inline: 'center'
|
|
});
|
|
}
|
|
|
|
function goToPrevious() {
|
|
var nextIndex = 0;
|
|
if (typeof currentIndex !== 'number' || currentIndex === 0) {
|
|
nextIndex = missingCoverageElements.length - 1;
|
|
} else if (missingCoverageElements.length > 1) {
|
|
nextIndex = currentIndex - 1;
|
|
}
|
|
|
|
makeCurrent(nextIndex);
|
|
}
|
|
|
|
function goToNext() {
|
|
var nextIndex = 0;
|
|
|
|
if (
|
|
typeof currentIndex === 'number' &&
|
|
currentIndex < missingCoverageElements.length - 1
|
|
) {
|
|
nextIndex = currentIndex + 1;
|
|
}
|
|
|
|
makeCurrent(nextIndex);
|
|
}
|
|
|
|
return function jump(event) {
|
|
if (
|
|
document.getElementById('fileSearch') === document.activeElement &&
|
|
document.activeElement != null
|
|
) {
|
|
// if we're currently focused on the search input, we don't want to navigate
|
|
return;
|
|
}
|
|
|
|
switch (event.which) {
|
|
case 78: // n
|
|
case 74: // j
|
|
goToNext();
|
|
break;
|
|
case 66: // b
|
|
case 75: // k
|
|
case 80: // p
|
|
goToPrevious();
|
|
break;
|
|
}
|
|
};
|
|
})();
|
|
window.addEventListener('keydown', jumpToCode);
|