Files
Laca-City/frontend/node_modules/oblivious-set/dist/es/index.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

66 lines
1.9 KiB
JavaScript

/**
* this is a set which automatically forgets
* a given entry when a new entry is set and the ttl
* of the old one is over
*/
var ObliviousSet = /** @class */ (function () {
function ObliviousSet(ttl) {
this.ttl = ttl;
this.set = new Set();
this.timeMap = new Map();
}
ObliviousSet.prototype.has = function (value) {
return this.set.has(value);
};
ObliviousSet.prototype.add = function (value) {
var _this = this;
this.timeMap.set(value, now());
this.set.add(value);
/**
* When a new value is added,
* start the cleanup at the next tick
* to not block the cpu for more important stuff
* that might happen.
*/
setTimeout(function () {
removeTooOldValues(_this);
}, 0);
};
ObliviousSet.prototype.clear = function () {
this.set.clear();
this.timeMap.clear();
};
return ObliviousSet;
}());
export { ObliviousSet };
/**
* Removes all entries from the set
* where the TTL has expired
*/
export function removeTooOldValues(obliviousSet) {
var olderThen = now() - obliviousSet.ttl;
var iterator = obliviousSet.set[Symbol.iterator]();
/**
* Because we can assume the new values are added at the bottom,
* we start from the top and stop as soon as we reach a non-too-old value.
*/
while (true) {
var value = iterator.next().value;
if (!value) {
return; // no more elements
}
var time = obliviousSet.timeMap.get(value);
if (time < olderThen) {
obliviousSet.timeMap.delete(value);
obliviousSet.set.delete(value);
}
else {
// We reached a value that is not old enough
return;
}
}
}
export function now() {
return new Date().getTime();
}
//# sourceMappingURL=index.js.map