Files
Laca-City/backend/node_modules/webpack-sources/lib/CompatSource.js
PhongPham c65cc97a33 🎯 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
2025-07-20 19:52:16 +07:00

106 lines
2.5 KiB
JavaScript

/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Source = require("./Source");
/** @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 {object} SourceLike
* @property {() => SourceValue} source source
* @property {(() => Buffer)=} buffer buffer
* @property {(() => number)=} size size
* @property {((options?: MapOptions) => RawSourceMap | null)=} map map
* @property {((options?: MapOptions) => SourceAndMap)=} sourceAndMap source and map
* @property {((hash: HashLike) => void)=} updateHash hash updater
*/
class CompatSource extends Source {
/**
* @param {SourceLike} sourceLike source like
* @returns {Source} source
*/
static from(sourceLike) {
return sourceLike instanceof Source
? sourceLike
: new CompatSource(sourceLike);
}
/**
* @param {SourceLike} sourceLike source like
*/
constructor(sourceLike) {
super();
this._sourceLike = sourceLike;
}
/**
* @returns {SourceValue} source
*/
source() {
return this._sourceLike.source();
}
buffer() {
if (typeof this._sourceLike.buffer === "function") {
return this._sourceLike.buffer();
}
return super.buffer();
}
size() {
if (typeof this._sourceLike.size === "function") {
return this._sourceLike.size();
}
return super.size();
}
/**
* @param {MapOptions=} options map options
* @returns {RawSourceMap | null} map
*/
map(options) {
if (typeof this._sourceLike.map === "function") {
return this._sourceLike.map(options);
}
return super.map(options);
}
/**
* @param {MapOptions=} options map options
* @returns {SourceAndMap} source and map
*/
sourceAndMap(options) {
if (typeof this._sourceLike.sourceAndMap === "function") {
return this._sourceLike.sourceAndMap(options);
}
return super.sourceAndMap(options);
}
/**
* @param {HashLike} hash hash
* @returns {void}
*/
updateHash(hash) {
if (typeof this._sourceLike.updateHash === "function") {
return this._sourceLike.updateHash(hash);
}
if (typeof this._sourceLike.map === "function") {
throw new Error(
"A Source-like object with a 'map' method must also provide an 'updateHash' method",
);
}
hash.update(this.buffer());
}
}
module.exports = CompatSource;