✨ 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
48 lines
1.5 KiB
JavaScript
48 lines
1.5 KiB
JavaScript
'use strict';
|
||
|
||
var $TypeError = require('es-errors/type');
|
||
|
||
var IsFixedLengthArrayBuffer = require('./IsFixedLengthArrayBuffer');
|
||
var IsViewOutOfBounds = require('./IsViewOutOfBounds');
|
||
|
||
var isDataViewWithBufferWitnessRecord = require('../helpers/records/data-view-with-buffer-witness-record');
|
||
|
||
var dataViewBuffer = require('data-view-buffer');
|
||
var dataViewByteLength = require('data-view-byte-length');
|
||
var dataViewByteOffset = require('data-view-byte-offset');
|
||
|
||
// https://262.ecma-international.org/15.0/#sec-getviewbytelength
|
||
|
||
module.exports = function GetViewByteLength(viewRecord) {
|
||
if (!isDataViewWithBufferWitnessRecord(viewRecord)) {
|
||
throw new $TypeError('Assertion failed: `viewRecord` must be a DataView with Buffer Witness Record');
|
||
}
|
||
|
||
if (IsViewOutOfBounds(viewRecord)) {
|
||
throw new $TypeError('Assertion failed: `viewRecord` is out of bounds'); // step 1
|
||
}
|
||
|
||
var view = viewRecord['[[Object]]']; // step 2
|
||
|
||
var isFixed = IsFixedLengthArrayBuffer(dataViewBuffer(view));
|
||
|
||
var viewByteLength = isFixed ? dataViewByteLength(view) : 'AUTO'; // view.[[ByteLength]]
|
||
if (viewByteLength !== 'AUTO') {
|
||
return viewByteLength; // step 3
|
||
}
|
||
|
||
if (isFixed) {
|
||
throw new $TypeError('Assertion failed: DataView’s ArrayBuffer is not fixed length'); // step 4
|
||
}
|
||
|
||
var byteOffset = dataViewByteOffset(view); // step 5
|
||
|
||
var byteLength = viewRecord['[[CachedBufferByteLength]]']; // step 6
|
||
|
||
if (byteLength === 'DETACHED') {
|
||
throw new $TypeError('Assertion failed: DataView’s ArrayBuffer is detached'); // step 7
|
||
}
|
||
|
||
return byteLength - byteOffset; // step 8
|
||
};
|