✨ 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
61 lines
3.9 KiB
JavaScript
61 lines
3.9 KiB
JavaScript
export function linkGc() {
|
|
// TODO-APP: Remove this logic when Float has GC built-in in development.
|
|
if (process.env.NODE_ENV !== "production") {
|
|
const callback = (mutationList)=>{
|
|
for (const mutation of mutationList){
|
|
if (mutation.type === "childList") {
|
|
for (const node of mutation.addedNodes){
|
|
if ("tagName" in node && node.tagName === "LINK") {
|
|
var _link_dataset_precedence;
|
|
const link = node;
|
|
if ((_link_dataset_precedence = link.dataset.precedence) == null ? void 0 : _link_dataset_precedence.startsWith("next")) {
|
|
const href = link.getAttribute("href");
|
|
if (href) {
|
|
const [resource, version] = href.split("?v=", 2);
|
|
if (version) {
|
|
const currentOrigin = window.location.origin;
|
|
const allLinks = [
|
|
...document.querySelectorAll('link[href^="' + resource + '"]'),
|
|
// It's possible that the resource is a full URL or only pathname,
|
|
// so we need to remove the alternative href as well.
|
|
...document.querySelectorAll('link[href^="' + (resource.startsWith(currentOrigin) ? resource.slice(currentOrigin.length) : currentOrigin + resource) + '"]')
|
|
];
|
|
for (const otherLink of allLinks){
|
|
var _otherLink_dataset_precedence;
|
|
if ((_otherLink_dataset_precedence = otherLink.dataset.precedence) == null ? void 0 : _otherLink_dataset_precedence.startsWith("next")) {
|
|
const otherHref = otherLink.getAttribute("href");
|
|
if (otherHref) {
|
|
const [, otherVersion] = otherHref.split("?v=", 2);
|
|
if (!otherVersion || +otherVersion < +version) {
|
|
// Delay the removal of the stylesheet to avoid FOUC
|
|
// caused by `@font-face` rules, as they seem to be
|
|
// a couple of ticks delayed between the old and new
|
|
// styles being swapped even if the font is cached.
|
|
setTimeout(()=>{
|
|
otherLink.remove();
|
|
}, 5);
|
|
const preloadLink = document.querySelector('link[rel="preload"][as="style"][href="' + otherHref + '"]');
|
|
if (preloadLink) {
|
|
preloadLink.remove();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
// Create an observer instance linked to the callback function
|
|
const observer = new MutationObserver(callback);
|
|
observer.observe(document.head, {
|
|
childList: true
|
|
});
|
|
}
|
|
}
|
|
|
|
//# sourceMappingURL=app-link-gc.js.map
|