🎯 MapView v2.0 - Global Deployment Ready

 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
This commit is contained in:
2025-07-20 19:52:16 +07:00
parent 3203463a6a
commit c65cc97a33
64624 changed files with 7199453 additions and 6462 deletions

View File

@@ -0,0 +1,6 @@
import type { AbortSignal } from 'node-abort-controller';
declare class AbortError extends Error {
constructor(message?: string);
static throwIfAborted(signal: AbortSignal | undefined): void;
}
export { AbortError };

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AbortError = void 0;
class AbortError extends Error {
constructor(message = 'Task aborted.') {
super(message);
this.name = 'AbortError';
}
static throwIfAborted(signal) {
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
throw new AbortError();
}
}
}
exports.AbortError = AbortError;

View File

@@ -0,0 +1,6 @@
declare function createControlledPromise<T = unknown>(): {
promise: Promise<T>;
resolve: (value: T) => void;
reject: (error: unknown) => void;
};
export { createControlledPromise };

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createControlledPromise = void 0;
function createControlledPromise() {
let resolve = () => undefined;
let reject = () => undefined;
const promise = new Promise((aResolve, aReject) => {
resolve = aResolve;
reject = aReject;
});
return {
promise,
resolve,
reject,
};
}
exports.createControlledPromise = createControlledPromise;

View File

@@ -0,0 +1,2 @@
declare function isPending(promise: Promise<unknown>, timeout?: number): Promise<unknown>;
export { isPending };

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPending = void 0;
function isPending(promise, timeout = 100) {
return Promise.race([
promise.then(() => false).catch(() => false),
new Promise((resolve) => setTimeout(() => resolve(true), timeout)),
]);
}
exports.isPending = isPending;

View File

@@ -0,0 +1,10 @@
import type { AbortSignal } from 'node-abort-controller';
declare type Task<T> = (signal?: AbortSignal) => Promise<T>;
interface Pool {
submit<T>(task: Task<T>, signal?: AbortSignal): Promise<T>;
size: number;
readonly pending: number;
readonly drained: Promise<void>;
}
declare function createPool(size: number): Pool;
export { Pool, createPool };

View File

@@ -0,0 +1,47 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createPool = void 0;
const abort_error_1 = require("./abort-error");
function createPool(size) {
let pendingPromises = [];
const pool = {
submit(task, signal) {
return __awaiter(this, void 0, void 0, function* () {
while (pendingPromises.length >= pool.size) {
abort_error_1.AbortError.throwIfAborted(signal);
yield Promise.race(pendingPromises).catch(() => undefined);
}
abort_error_1.AbortError.throwIfAborted(signal);
const taskPromise = task(signal).finally(() => {
pendingPromises = pendingPromises.filter((pendingPromise) => pendingPromise !== taskPromise);
});
pendingPromises.push(taskPromise);
return taskPromise;
});
},
size,
get pending() {
return pendingPromises.length;
},
get drained() {
// eslint-disable-next-line no-async-promise-executor
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
while (pendingPromises.length > 0) {
yield Promise.race(pendingPromises).catch(() => undefined);
}
resolve(undefined);
}));
},
};
return pool;
}
exports.createPool = createPool;

View File

@@ -0,0 +1,2 @@
declare function wait(timeout: number): Promise<unknown>;
export { wait };

View File

@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.wait = void 0;
function wait(timeout) {
return new Promise((resolve) => setTimeout(resolve, timeout));
}
exports.wait = wait;

View File

@@ -0,0 +1,6 @@
/**
* Replaces backslashes with one forward slash
* @param input
*/
declare function forwardSlash(input: string): string;
export { forwardSlash };

View File

@@ -0,0 +1,15 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.forwardSlash = void 0;
const path_1 = __importDefault(require("path"));
/**
* Replaces backslashes with one forward slash
* @param input
*/
function forwardSlash(input) {
return path_1.default.normalize(input).replace(/\\+/g, '/');
}
exports.forwardSlash = forwardSlash;

View File

@@ -0,0 +1,2 @@
declare function isInsideAnotherPath(parent: string, directory: string): boolean;
export { isInsideAnotherPath };

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isInsideAnotherPath = void 0;
const path_1 = require("path");
function isInsideAnotherPath(parent, directory) {
const relativePart = (0, path_1.relative)(parent, directory);
// Tested folder is above parent.
if (relativePart.startsWith('..')) {
return false;
}
// Tested folder is the same as parent.
if (relativePart.length === 0) {
return false;
}
// Tested directory has nothing in common with parent.
if ((0, path_1.isAbsolute)(relativePart)) {
return false;
}
// Last option, must be subfolder.
return true;
}
exports.isInsideAnotherPath = isInsideAnotherPath;

View File

@@ -0,0 +1,2 @@
declare function relativeToContext(file: string, context: string): string;
export { relativeToContext };

View File

@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.relativeToContext = void 0;
const path_1 = __importDefault(require("path"));
const forward_slash_1 = require("./forward-slash");
function relativeToContext(file, context) {
let fileInContext = (0, forward_slash_1.forwardSlash)(path_1.default.relative(context, file));
if (!fileInContext.startsWith('../')) {
fileInContext = './' + fileInContext;
}
return fileInContext;
}
exports.relativeToContext = relativeToContext;