✨ 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
93 lines
2.7 KiB
JavaScript
93 lines
2.7 KiB
JavaScript
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Tobias Koppers @sokra
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const ModuleNotFoundError = require("../ModuleNotFoundError");
|
|
const LazySet = require("../util/LazySet");
|
|
|
|
/** @typedef {import("../Compilation")} Compilation */
|
|
/** @typedef {import("../ResolverFactory").ResolveOptionsWithDependencyType} ResolveOptionsWithDependencyType */
|
|
|
|
/**
|
|
* @template T
|
|
* @typedef {object} MatchedConfigs
|
|
* @property {Map<string, T>} resolved
|
|
* @property {Map<string, T>} unresolved
|
|
* @property {Map<string, T>} prefixed
|
|
*/
|
|
|
|
/** @type {ResolveOptionsWithDependencyType} */
|
|
const RESOLVE_OPTIONS = { dependencyType: "esm" };
|
|
|
|
/**
|
|
* @template T
|
|
* @param {Compilation} compilation the compilation
|
|
* @param {[string, T][]} configs to be processed configs
|
|
* @returns {Promise<MatchedConfigs<T>>} resolved matchers
|
|
*/
|
|
module.exports.resolveMatchedConfigs = (compilation, configs) => {
|
|
/** @type {Map<string, T>} */
|
|
const resolved = new Map();
|
|
/** @type {Map<string, T>} */
|
|
const unresolved = new Map();
|
|
/** @type {Map<string, T>} */
|
|
const prefixed = new Map();
|
|
const resolveContext = {
|
|
/** @type {LazySet<string>} */
|
|
fileDependencies: new LazySet(),
|
|
/** @type {LazySet<string>} */
|
|
contextDependencies: new LazySet(),
|
|
/** @type {LazySet<string>} */
|
|
missingDependencies: new LazySet()
|
|
};
|
|
const resolver = compilation.resolverFactory.get("normal", RESOLVE_OPTIONS);
|
|
const context = compilation.compiler.context;
|
|
|
|
return Promise.all(
|
|
// eslint-disable-next-line array-callback-return
|
|
configs.map(([request, config]) => {
|
|
if (/^\.\.?(\/|$)/.test(request)) {
|
|
// relative request
|
|
return new Promise(resolve => {
|
|
resolver.resolve(
|
|
{},
|
|
context,
|
|
request,
|
|
resolveContext,
|
|
(err, result) => {
|
|
if (err || result === false) {
|
|
err = err || new Error(`Can't resolve ${request}`);
|
|
compilation.errors.push(
|
|
new ModuleNotFoundError(null, err, {
|
|
name: `shared module ${request}`
|
|
})
|
|
);
|
|
return resolve(null);
|
|
}
|
|
resolved.set(/** @type {string} */ (result), config);
|
|
resolve(null);
|
|
}
|
|
);
|
|
});
|
|
} else if (/^(\/|[A-Za-z]:\\|\\\\)/.test(request)) {
|
|
// absolute path
|
|
resolved.set(request, config);
|
|
} else if (request.endsWith("/")) {
|
|
// module request prefix
|
|
prefixed.set(request, config);
|
|
} else {
|
|
// module request
|
|
unresolved.set(request, config);
|
|
}
|
|
})
|
|
).then(() => {
|
|
compilation.contextDependencies.addAll(resolveContext.contextDependencies);
|
|
compilation.fileDependencies.addAll(resolveContext.fileDependencies);
|
|
compilation.missingDependencies.addAll(resolveContext.missingDependencies);
|
|
return { resolved, unresolved, prefixed };
|
|
});
|
|
};
|