✨ 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
47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Tobias Koppers @sokra
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
/**
|
|
* Compare two arrays or strings by performing strict equality check for each value.
|
|
* @template T
|
|
* @param {ArrayLike<T>} a Array of values to be compared
|
|
* @param {ArrayLike<T>} b Array of values to be compared
|
|
* @returns {boolean} returns true if all the elements of passed arrays are strictly equal.
|
|
*/
|
|
module.exports.equals = (a, b) => {
|
|
if (a.length !== b.length) return false;
|
|
for (let i = 0; i < a.length; i++) {
|
|
if (a[i] !== b[i]) return false;
|
|
}
|
|
return true;
|
|
};
|
|
|
|
/**
|
|
* Partition an array by calling a predicate function on each value.
|
|
* @template T
|
|
* @param {Array<T>} arr Array of values to be partitioned
|
|
* @param {(value: T) => boolean} fn Partition function which partitions based on truthiness of result.
|
|
* @returns {[Array<T>, Array<T>]} returns the values of `arr` partitioned into two new arrays based on fn predicate.
|
|
*/
|
|
module.exports.groupBy = (
|
|
// eslint-disable-next-line default-param-last
|
|
arr = [],
|
|
fn
|
|
) =>
|
|
arr.reduce(
|
|
/**
|
|
* @param {[Array<T>, Array<T>]} groups An accumulator storing already partitioned values returned from previous call.
|
|
* @param {T} value The value of the current element
|
|
* @returns {[Array<T>, Array<T>]} returns an array of partitioned groups accumulator resulting from calling a predicate on the current value.
|
|
*/
|
|
(groups, value) => {
|
|
groups[fn(value) ? 0 : 1].push(value);
|
|
return groups;
|
|
},
|
|
[[], []]
|
|
);
|