✨ 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
157 lines
2.6 KiB
JavaScript
157 lines
2.6 KiB
JavaScript
/*!
|
|
* body-parser
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
* MIT Licensed
|
|
*/
|
|
|
|
'use strict'
|
|
|
|
/**
|
|
* Module dependencies.
|
|
* @private
|
|
*/
|
|
|
|
var deprecate = require('depd')('body-parser')
|
|
|
|
/**
|
|
* Cache of loaded parsers.
|
|
* @private
|
|
*/
|
|
|
|
var parsers = Object.create(null)
|
|
|
|
/**
|
|
* @typedef Parsers
|
|
* @type {function}
|
|
* @property {function} json
|
|
* @property {function} raw
|
|
* @property {function} text
|
|
* @property {function} urlencoded
|
|
*/
|
|
|
|
/**
|
|
* Module exports.
|
|
* @type {Parsers}
|
|
*/
|
|
|
|
exports = module.exports = deprecate.function(bodyParser,
|
|
'bodyParser: use individual json/urlencoded middlewares')
|
|
|
|
/**
|
|
* JSON parser.
|
|
* @public
|
|
*/
|
|
|
|
Object.defineProperty(exports, 'json', {
|
|
configurable: true,
|
|
enumerable: true,
|
|
get: createParserGetter('json')
|
|
})
|
|
|
|
/**
|
|
* Raw parser.
|
|
* @public
|
|
*/
|
|
|
|
Object.defineProperty(exports, 'raw', {
|
|
configurable: true,
|
|
enumerable: true,
|
|
get: createParserGetter('raw')
|
|
})
|
|
|
|
/**
|
|
* Text parser.
|
|
* @public
|
|
*/
|
|
|
|
Object.defineProperty(exports, 'text', {
|
|
configurable: true,
|
|
enumerable: true,
|
|
get: createParserGetter('text')
|
|
})
|
|
|
|
/**
|
|
* URL-encoded parser.
|
|
* @public
|
|
*/
|
|
|
|
Object.defineProperty(exports, 'urlencoded', {
|
|
configurable: true,
|
|
enumerable: true,
|
|
get: createParserGetter('urlencoded')
|
|
})
|
|
|
|
/**
|
|
* Create a middleware to parse json and urlencoded bodies.
|
|
*
|
|
* @param {object} [options]
|
|
* @return {function}
|
|
* @deprecated
|
|
* @public
|
|
*/
|
|
|
|
function bodyParser (options) {
|
|
// use default type for parsers
|
|
var opts = Object.create(options || null, {
|
|
type: {
|
|
configurable: true,
|
|
enumerable: true,
|
|
value: undefined,
|
|
writable: true
|
|
}
|
|
})
|
|
|
|
var _urlencoded = exports.urlencoded(opts)
|
|
var _json = exports.json(opts)
|
|
|
|
return function bodyParser (req, res, next) {
|
|
_json(req, res, function (err) {
|
|
if (err) return next(err)
|
|
_urlencoded(req, res, next)
|
|
})
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Create a getter for loading a parser.
|
|
* @private
|
|
*/
|
|
|
|
function createParserGetter (name) {
|
|
return function get () {
|
|
return loadParser(name)
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Load a parser module.
|
|
* @private
|
|
*/
|
|
|
|
function loadParser (parserName) {
|
|
var parser = parsers[parserName]
|
|
|
|
if (parser !== undefined) {
|
|
return parser
|
|
}
|
|
|
|
// this uses a switch for static require analysis
|
|
switch (parserName) {
|
|
case 'json':
|
|
parser = require('./lib/types/json')
|
|
break
|
|
case 'raw':
|
|
parser = require('./lib/types/raw')
|
|
break
|
|
case 'text':
|
|
parser = require('./lib/types/text')
|
|
break
|
|
case 'urlencoded':
|
|
parser = require('./lib/types/urlencoded')
|
|
break
|
|
}
|
|
|
|
// store to prevent invoking require()
|
|
return (parsers[parserName] = parser)
|
|
}
|