✨ 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
81 lines
1.5 KiB
JavaScript
81 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
var tape = require('tape');
|
|
var Buffer = require('safe-buffer').Buffer;
|
|
|
|
var Hash = require('../hash');
|
|
|
|
var hex = '0A1B2C3D4E5F6G7H';
|
|
|
|
function equal(t, a, b) {
|
|
t.equal(a.length, b.length);
|
|
t.equal(a.toString('hex'), b.toString('hex'));
|
|
}
|
|
|
|
var hexBuf = Buffer.from('0A1B2C3D4E5F6G7H', 'utf8');
|
|
var count16 = {
|
|
strings: ['0A1B2C3D4E5F6G7H'],
|
|
buffers: [
|
|
hexBuf,
|
|
Buffer.from('80000000000000000000000000000080', 'hex')
|
|
]
|
|
};
|
|
|
|
var empty = {
|
|
strings: [''],
|
|
buffers: [
|
|
Buffer.from('80000000000000000000000000000000', 'hex')
|
|
]
|
|
};
|
|
|
|
var multi = {
|
|
strings: ['abcd', 'efhijk', 'lmnopq'],
|
|
buffers: [
|
|
Buffer.from('abcdefhijklmnopq', 'ascii'),
|
|
Buffer.from('80000000000000000000000000000080', 'hex')
|
|
]
|
|
};
|
|
|
|
var long = {
|
|
strings: [hex + hex],
|
|
buffers: [
|
|
hexBuf,
|
|
hexBuf,
|
|
Buffer.from('80000000000000000000000000000100', 'hex')
|
|
]
|
|
};
|
|
|
|
function makeTest(name, data) {
|
|
tape(name, function (t) {
|
|
var h = new Hash(16, 8);
|
|
var hash = Buffer.alloc(20);
|
|
var n = 2;
|
|
var expected = data.buffers.slice();
|
|
// t.plan(expected.length + 1)
|
|
|
|
h._update = function (block) {
|
|
var e = expected.shift();
|
|
equal(t, block, e);
|
|
|
|
if (n < 0) {
|
|
throw new Error('expecting only 2 calls to _update');
|
|
}
|
|
};
|
|
h._hash = function () {
|
|
return hash;
|
|
};
|
|
|
|
data.strings.forEach(function (string) {
|
|
h.update(string, 'ascii');
|
|
});
|
|
|
|
equal(t, h.digest(), hash);
|
|
t.end();
|
|
});
|
|
}
|
|
|
|
makeTest('Hash#update 1 in 1', count16);
|
|
makeTest('empty Hash#update', empty);
|
|
makeTest('Hash#update 1 in 3', multi);
|
|
makeTest('Hash#update 2 in 1', long);
|