✨ 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
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
'use strict';
|
|
|
|
import AxiosError from '../core/AxiosError.js';
|
|
import parseProtocol from './parseProtocol.js';
|
|
import platform from '../platform/index.js';
|
|
|
|
const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
|
|
/**
|
|
* Parse data uri to a Buffer or Blob
|
|
*
|
|
* @param {String} uri
|
|
* @param {?Boolean} asBlob
|
|
* @param {?Object} options
|
|
* @param {?Function} options.Blob
|
|
*
|
|
* @returns {Buffer|Blob}
|
|
*/
|
|
export default function fromDataURI(uri, asBlob, options) {
|
|
const _Blob = options && options.Blob || platform.classes.Blob;
|
|
const protocol = parseProtocol(uri);
|
|
|
|
if (asBlob === undefined && _Blob) {
|
|
asBlob = true;
|
|
}
|
|
|
|
if (protocol === 'data') {
|
|
uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
|
|
|
|
const match = DATA_URL_PATTERN.exec(uri);
|
|
|
|
if (!match) {
|
|
throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
|
|
}
|
|
|
|
const mime = match[1];
|
|
const isBase64 = match[2];
|
|
const body = match[3];
|
|
const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');
|
|
|
|
if (asBlob) {
|
|
if (!_Blob) {
|
|
throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
|
|
}
|
|
|
|
return new _Blob([buffer], {type: mime});
|
|
}
|
|
|
|
return buffer;
|
|
}
|
|
|
|
throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
|
|
}
|