✨ 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
89 lines
3.6 KiB
JavaScript
89 lines
3.6 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
INTERCEPTION_ROUTE_MARKERS: null,
|
|
extractInterceptionRouteInformation: null,
|
|
isInterceptionRouteAppPath: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
INTERCEPTION_ROUTE_MARKERS: function() {
|
|
return INTERCEPTION_ROUTE_MARKERS;
|
|
},
|
|
extractInterceptionRouteInformation: function() {
|
|
return extractInterceptionRouteInformation;
|
|
},
|
|
isInterceptionRouteAppPath: function() {
|
|
return isInterceptionRouteAppPath;
|
|
}
|
|
});
|
|
const _apppaths = require("../../../shared/lib/router/utils/app-paths");
|
|
const INTERCEPTION_ROUTE_MARKERS = [
|
|
"(..)(..)",
|
|
"(.)",
|
|
"(..)",
|
|
"(...)"
|
|
];
|
|
function isInterceptionRouteAppPath(path) {
|
|
// TODO-APP: add more serious validation
|
|
return path.split("/").find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;
|
|
}
|
|
function extractInterceptionRouteInformation(path) {
|
|
let interceptingRoute, marker, interceptedRoute;
|
|
for (const segment of path.split("/")){
|
|
marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
|
|
if (marker) {
|
|
[interceptingRoute, interceptedRoute] = path.split(marker, 2);
|
|
break;
|
|
}
|
|
}
|
|
if (!interceptingRoute || !marker || !interceptedRoute) {
|
|
throw new Error(`Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);
|
|
}
|
|
interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed
|
|
;
|
|
switch(marker){
|
|
case "(.)":
|
|
// (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route
|
|
if (interceptingRoute === "/") {
|
|
interceptedRoute = `/${interceptedRoute}`;
|
|
} else {
|
|
interceptedRoute = interceptingRoute + "/" + interceptedRoute;
|
|
}
|
|
break;
|
|
case "(..)":
|
|
// (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route
|
|
if (interceptingRoute === "/") {
|
|
throw new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`);
|
|
}
|
|
interceptedRoute = interceptingRoute.split("/").slice(0, -1).concat(interceptedRoute).join("/");
|
|
break;
|
|
case "(...)":
|
|
// (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route
|
|
interceptedRoute = "/" + interceptedRoute;
|
|
break;
|
|
case "(..)(..)":
|
|
// (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route
|
|
const splitInterceptingRoute = interceptingRoute.split("/");
|
|
if (splitInterceptingRoute.length <= 2) {
|
|
throw new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`);
|
|
}
|
|
interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join("/");
|
|
break;
|
|
default:
|
|
throw new Error("Invariant: unexpected marker");
|
|
}
|
|
return {
|
|
interceptingRoute,
|
|
interceptedRoute
|
|
};
|
|
}
|
|
|
|
//# sourceMappingURL=interception-routes.js.map
|