- 在 web-ui 中新增历史轨迹查询与回放功能,允许用户查看历史数据。 - 更新 map-loader.js 和 history-map-adapter.js,支持历史轨迹的地图渲染与交互。 - 修改 CSS 文件以改善历史轨迹界面的样式,确保在不同主题下的视觉一致性。 - 在 receivers.js 中更新接收机配置,支持 UID 身份隔离与状态显示优化。 - 在 map_settings.rs 中设置默认经纬度,提升地图初始化体验。
28 lines
2.0 KiB
JavaScript
28 lines
2.0 KiB
JavaScript
// Load the map engine only for the approved realtime workspace.
|
|
|
|
// A separate, lazy map keeps configuration independent of the live receiver map.
|
|
let settings, generation=0;
|
|
window.ridMapSettings={
|
|
async open(p){const token=++generation;settings??=await import('./map-settings-adapter.js');if(token===generation)settings.open(p);},
|
|
close(){generation++;settings?.close();},refresh(){settings?.refresh();window.ridMap?.refresh();},
|
|
configure(p){settings?.configure(p);},setBasemap(v){settings?.setBasemap(v);},
|
|
tool(v){settings?.tool(v);},bounds(v){settings?.bounds(v);},current(){settings?.current();},metrics(){return settings?.metrics();}
|
|
};
|
|
|
|
let fences,fenceGeneration=0;
|
|
window.ridGeofences={
|
|
async open(p){const token=++fenceGeneration;try{fences??=await import('./geofence-map-adapter.js');if(token===fenceGeneration){fences.open(p);window.dispatchEvent(new Event('rid-fence-map-ready'));}}catch{window.dispatchEvent(new CustomEvent('rid-fence-map-error',{detail:{message:'围栏地图模块加载失败,可继续使用坐标编辑。'}}));}},
|
|
close(){fenceGeneration++;fences?.close();},render(p){fences?.render(p);},targets(p){fences?.targets(p);},tool(v){fences?.tool(v);},locate(){fences?.locate();},setBasemap(v){fences?.setBasemap(v);},metrics(){return fences?.metrics();}
|
|
};
|
|
|
|
let history,historyGeneration=0,historyPoints=[],historyIndex=0;
|
|
window.ridHistory={
|
|
async open(p){const token=++historyGeneration;try{history??=await import('./history-map-adapter.js');if(token===historyGeneration){history.open(p);history.setPoints(historyPoints);history.setIndex(historyIndex);}}catch{window.dispatchEvent(new Event('rid-history-map-error'));}},
|
|
close(){historyGeneration++;history?.close();},
|
|
setPoints(value){historyPoints=Array.isArray(value)?value:[];historyIndex=0;history?.setPoints(historyPoints);},
|
|
setIndex(value){historyIndex=value;history?.setIndex(value);},
|
|
metrics(){return history?.metrics();}
|
|
};
|
|
|
|
if (location.pathname === '/realtime') await import('./map-adapter.js');
|