feat(web-ui): 添加历史轨迹功能与地图适配

- 在 web-ui 中新增历史轨迹查询与回放功能,允许用户查看历史数据。
- 更新 map-loader.js 和 history-map-adapter.js,支持历史轨迹的地图渲染与交互。
- 修改 CSS 文件以改善历史轨迹界面的样式,确保在不同主题下的视觉一致性。
- 在 receivers.js 中更新接收机配置,支持 UID 身份隔离与状态显示优化。
- 在 map_settings.rs 中设置默认经纬度,提升地图初始化体验。
This commit is contained in:
2026-11-02 15:28:01 +08:00
parent 87d0ec8352
commit 7af8fb32cf
43 changed files with 3107 additions and 302 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ export function attachTileBuffer(map,getKind,getRevision=()=>0){
function retry(){cooldownUntil=Date.now()+30000;lastSignature='';queue=[];wake(30000);}
function pump(token){
if(closed||token!==generation||Date.now()<cooldownUntil)return;
while(running<4&&queue.length){
while(running<1&&queue.length){
const item=queue.shift(),controller=new AbortController();controllers.add(controller);running++;metrics.requested++;
fetch(item,{signal:controller.signal,cache:'default',headers:{'x-rid-prefetch':'1'}}).then(async response=>{
if(response.status===429){if(token===generation){queue.unshift(item);cooldownUntil=Date.now()+500;clearTimeout(retryTimer);retryTimer=setTimeout(()=>{retryTimer=null;pump(token);},550);}return;}
@@ -43,7 +43,7 @@ export function attachTileBuffer(map,getKind,getRevision=()=>0){
const y0=Math.max(0,Math.floor(Math.min(...corners.map(p=>p[1])))),y1=Math.min(n-1,Math.floor(Math.max(...corners.map(p=>p[1]))));
const cells=[];for(let x=x0;x<=Math.min(x1,x0+n-1);x++)for(let y=y0;y<=y1;y++)cells.push([x,y,(x-center[0])**2+(y-center[1])**2]);
cells.sort((a,b)=>a[2]-b[2]);
for(const [x,y]of cells.slice(0,4096))for(const layer of layers){
for(const [x,y]of cells.slice(0,32))for(const layer of layers){
const key=url(layer,z,((x%n)+n)%n,y);if(unique.has(key))continue;unique.add(key);
if(Date.now()-(warmed.get(key)||0)<240000){metrics.hits++;continue;}queue.push(key);
}