✨ 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
73 lines
1.7 KiB
JavaScript
73 lines
1.7 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.isPromise = isPromise;
|
|
exports.sleep = sleep;
|
|
exports.randomInt = randomInt;
|
|
exports.randomToken = randomToken;
|
|
exports.microSeconds = microSeconds;
|
|
exports.isNode = void 0;
|
|
|
|
/**
|
|
* returns true if the given object is a promise
|
|
*/
|
|
function isPromise(obj) {
|
|
if (obj && typeof obj.then === 'function') {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function sleep(time) {
|
|
if (!time) time = 0;
|
|
return new Promise(function (res) {
|
|
return setTimeout(res, time);
|
|
});
|
|
}
|
|
|
|
function randomInt(min, max) {
|
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
}
|
|
/**
|
|
* https://stackoverflow.com/a/8084248
|
|
*/
|
|
|
|
|
|
function randomToken() {
|
|
return Math.random().toString(36).substring(2);
|
|
}
|
|
|
|
var lastMs = 0;
|
|
var additional = 0;
|
|
/**
|
|
* returns the current time in micro-seconds,
|
|
* WARNING: This is a pseudo-function
|
|
* Performance.now is not reliable in webworkers, so we just make sure to never return the same time.
|
|
* This is enough in browsers, and this function will not be used in nodejs.
|
|
* The main reason for this hack is to ensure that BroadcastChannel behaves equal to production when it is used in fast-running unit tests.
|
|
*/
|
|
|
|
function microSeconds() {
|
|
var ms = new Date().getTime();
|
|
|
|
if (ms === lastMs) {
|
|
additional++;
|
|
return ms * 1000 + additional;
|
|
} else {
|
|
lastMs = ms;
|
|
additional = 0;
|
|
return ms * 1000;
|
|
}
|
|
}
|
|
/**
|
|
* copied from the 'detect-node' npm module
|
|
* We cannot use the module directly because it causes problems with rollup
|
|
* @link https://github.com/iliakan/detect-node/blob/master/index.js
|
|
*/
|
|
|
|
|
|
var isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';
|
|
exports.isNode = isNode; |