✨ 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
68 lines
1.6 KiB
JavaScript
68 lines
1.6 KiB
JavaScript
var objectAssign = require('object-assign')
|
|
|
|
function arrayRemove (arr, item) {
|
|
var idx = arr.indexOf(item)
|
|
if (~idx) arr.splice(idx, 1)
|
|
}
|
|
|
|
function FileAppender (strategy, req) {
|
|
this.strategy = strategy
|
|
this.req = req
|
|
|
|
switch (strategy) {
|
|
case 'NONE': break
|
|
case 'VALUE': break
|
|
case 'ARRAY': req.files = []; break
|
|
case 'OBJECT': req.files = Object.create(null); break
|
|
default: throw new Error('Unknown file strategy: ' + strategy)
|
|
}
|
|
}
|
|
|
|
FileAppender.prototype.insertPlaceholder = function (file) {
|
|
var placeholder = {
|
|
fieldname: file.fieldname
|
|
}
|
|
|
|
switch (this.strategy) {
|
|
case 'NONE': break
|
|
case 'VALUE': break
|
|
case 'ARRAY': this.req.files.push(placeholder); break
|
|
case 'OBJECT':
|
|
if (this.req.files[file.fieldname]) {
|
|
this.req.files[file.fieldname].push(placeholder)
|
|
} else {
|
|
this.req.files[file.fieldname] = [placeholder]
|
|
}
|
|
break
|
|
}
|
|
|
|
return placeholder
|
|
}
|
|
|
|
FileAppender.prototype.removePlaceholder = function (placeholder) {
|
|
switch (this.strategy) {
|
|
case 'NONE': break
|
|
case 'VALUE': break
|
|
case 'ARRAY': arrayRemove(this.req.files, placeholder); break
|
|
case 'OBJECT':
|
|
if (this.req.files[placeholder.fieldname].length === 1) {
|
|
delete this.req.files[placeholder.fieldname]
|
|
} else {
|
|
arrayRemove(this.req.files[placeholder.fieldname], placeholder)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
FileAppender.prototype.replacePlaceholder = function (placeholder, file) {
|
|
if (this.strategy === 'VALUE') {
|
|
this.req.file = file
|
|
return
|
|
}
|
|
|
|
delete placeholder.fieldname
|
|
objectAssign(placeholder, file)
|
|
}
|
|
|
|
module.exports = FileAppender
|