✨ 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
107 lines
2.0 KiB
JavaScript
107 lines
2.0 KiB
JavaScript
"use strict";
|
|
|
|
const DoublyLinkedList = require("./DoublyLinkedList");
|
|
const DequeIterator = require("./DequeIterator");
|
|
/**
|
|
* DoublyLinkedList backed double ended queue
|
|
* implements just enough to keep the Pool
|
|
*/
|
|
class Deque {
|
|
constructor() {
|
|
this._list = new DoublyLinkedList();
|
|
}
|
|
|
|
/**
|
|
* removes and returns the first element from the queue
|
|
* @return {any} [description]
|
|
*/
|
|
shift() {
|
|
if (this.length === 0) {
|
|
return undefined;
|
|
}
|
|
|
|
const node = this._list.head;
|
|
this._list.remove(node);
|
|
|
|
return node.data;
|
|
}
|
|
|
|
/**
|
|
* adds one elemts to the beginning of the queue
|
|
* @param {any} element [description]
|
|
* @return {any} [description]
|
|
*/
|
|
unshift(element) {
|
|
const node = DoublyLinkedList.createNode(element);
|
|
|
|
this._list.insertBeginning(node);
|
|
}
|
|
|
|
/**
|
|
* adds one to the end of the queue
|
|
* @param {any} element [description]
|
|
* @return {any} [description]
|
|
*/
|
|
push(element) {
|
|
const node = DoublyLinkedList.createNode(element);
|
|
|
|
this._list.insertEnd(node);
|
|
}
|
|
|
|
/**
|
|
* removes and returns the last element from the queue
|
|
*/
|
|
pop() {
|
|
if (this.length === 0) {
|
|
return undefined;
|
|
}
|
|
|
|
const node = this._list.tail;
|
|
this._list.remove(node);
|
|
|
|
return node.data;
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
return new DequeIterator(this._list);
|
|
}
|
|
|
|
iterator() {
|
|
return new DequeIterator(this._list);
|
|
}
|
|
|
|
reverseIterator() {
|
|
return new DequeIterator(this._list, true);
|
|
}
|
|
|
|
/**
|
|
* get a reference to the item at the head of the queue
|
|
* @return {any} [description]
|
|
*/
|
|
get head() {
|
|
if (this.length === 0) {
|
|
return undefined;
|
|
}
|
|
const node = this._list.head;
|
|
return node.data;
|
|
}
|
|
|
|
/**
|
|
* get a reference to the item at the tail of the queue
|
|
* @return {any} [description]
|
|
*/
|
|
get tail() {
|
|
if (this.length === 0) {
|
|
return undefined;
|
|
}
|
|
const node = this._list.tail;
|
|
return node.data;
|
|
}
|
|
|
|
get length() {
|
|
return this._list.length;
|
|
}
|
|
}
|
|
|
|
module.exports = Deque;
|