✨ 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
121 lines
3.1 KiB
JavaScript
121 lines
3.1 KiB
JavaScript
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Tobias Koppers @sokra
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
/** @typedef {import("./CachedSource").CachedData} CachedData */
|
|
/** @typedef {import("./CompatSource").SourceLike} SourceLike */
|
|
/** @typedef {import("./ConcatSource").Child} ConcatSourceChild */
|
|
/** @typedef {import("./ReplaceSource").Replacement} Replacement */
|
|
/** @typedef {import("./Source").HashLike} HashLike */
|
|
/** @typedef {import("./Source").MapOptions} MapOptions */
|
|
/** @typedef {import("./Source").RawSourceMap} RawSourceMap */
|
|
/** @typedef {import("./Source").SourceAndMap} SourceAndMap */
|
|
/** @typedef {import("./Source").SourceValue} SourceValue */
|
|
/** @typedef {import("./helpers/getGeneratedSourceInfo").GeneratedSourceInfo} GeneratedSourceInfo */
|
|
/** @typedef {import("./helpers/streamChunks").OnChunk} OnChunk */
|
|
/** @typedef {import("./helpers/streamChunks").OnName} OnName */
|
|
/** @typedef {import("./helpers/streamChunks").OnSource} OnSource */
|
|
/** @typedef {import("./helpers/streamChunks").Options} StreamChunksOptions */
|
|
|
|
/**
|
|
* @template T
|
|
* @param {() => T} fn memorized function
|
|
* @returns {() => T} new function
|
|
*/
|
|
const memoize = (fn) => {
|
|
let cache = false;
|
|
/** @type {T | undefined} */
|
|
let result;
|
|
return () => {
|
|
if (cache) {
|
|
return /** @type {T} */ (result);
|
|
}
|
|
|
|
result = fn();
|
|
cache = true;
|
|
// Allow to clean up memory for fn
|
|
// and all dependent resources
|
|
/** @type {(() => T) | undefined} */
|
|
(fn) = undefined;
|
|
return /** @type {T} */ (result);
|
|
};
|
|
};
|
|
|
|
/**
|
|
* @template A
|
|
* @template B
|
|
* @param {A} obj input a
|
|
* @param {B} exports input b
|
|
* @returns {A & B} merged
|
|
*/
|
|
const mergeExports = (obj, exports) => {
|
|
const descriptors = Object.getOwnPropertyDescriptors(exports);
|
|
for (const name of Object.keys(descriptors)) {
|
|
const descriptor = descriptors[name];
|
|
if (descriptor.get) {
|
|
const fn = descriptor.get;
|
|
Object.defineProperty(obj, name, {
|
|
configurable: false,
|
|
enumerable: true,
|
|
get: memoize(fn),
|
|
});
|
|
} else if (typeof descriptor.value === "object") {
|
|
Object.defineProperty(obj, name, {
|
|
configurable: false,
|
|
enumerable: true,
|
|
writable: false,
|
|
value: mergeExports({}, descriptor.value),
|
|
});
|
|
} else {
|
|
throw new Error(
|
|
"Exposed values must be either a getter or an nested object",
|
|
);
|
|
}
|
|
}
|
|
return /** @type {A & B} */ (Object.freeze(obj));
|
|
};
|
|
|
|
module.exports = mergeExports(
|
|
{},
|
|
{
|
|
get Source() {
|
|
return require("./Source");
|
|
},
|
|
get RawSource() {
|
|
return require("./RawSource");
|
|
},
|
|
get OriginalSource() {
|
|
return require("./OriginalSource");
|
|
},
|
|
get SourceMapSource() {
|
|
return require("./SourceMapSource");
|
|
},
|
|
get CachedSource() {
|
|
return require("./CachedSource");
|
|
},
|
|
get ConcatSource() {
|
|
return require("./ConcatSource");
|
|
},
|
|
get ReplaceSource() {
|
|
return require("./ReplaceSource");
|
|
},
|
|
get PrefixSource() {
|
|
return require("./PrefixSource");
|
|
},
|
|
get SizeOnlySource() {
|
|
return require("./SizeOnlySource");
|
|
},
|
|
get CompatSource() {
|
|
return require("./CompatSource");
|
|
},
|
|
util: {
|
|
get stringBufferUtils() {
|
|
return require("./helpers/stringBufferUtils");
|
|
},
|
|
},
|
|
},
|
|
);
|