feat(web-ui): 添加历史轨迹功能与地图适配
- 在 web-ui 中新增历史轨迹查询与回放功能,允许用户查看历史数据。 - 更新 map-loader.js 和 history-map-adapter.js,支持历史轨迹的地图渲染与交互。 - 修改 CSS 文件以改善历史轨迹界面的样式,确保在不同主题下的视觉一致性。 - 在 receivers.js 中更新接收机配置,支持 UID 身份隔离与状态显示优化。 - 在 map_settings.rs 中设置默认经纬度,提升地图初始化体验。
This commit is contained in:
@@ -148,7 +148,12 @@ func fetch(client *http.Client, r request, t tile, limiter <-chan time.Time) err
|
||||
}
|
||||
// Valid local tiles do not consume network rate-limit slots.
|
||||
<-limiter
|
||||
resp, err := client.Get(fmt.Sprintf("%s/%s/%d/%d/%d", strings.TrimRight(r.BaseURL, "/"), t.layer, t.z, t.x, t.y))
|
||||
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/%s/%d/%d/%d", strings.TrimRight(r.BaseURL, "/"), t.layer, t.z, t.x, t.y), nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req.Header.Set("x-rid-map-download", "1")
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -156,6 +161,9 @@ func fetch(client *http.Client, r request, t tile, limiter <-chan time.Time) err
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return fmt.Errorf("tile unavailable")
|
||||
}
|
||||
if resp.Header.Get("x-map-source") == "offline-parent" {
|
||||
return fmt.Errorf("parent preview is not a downloaded tile")
|
||||
}
|
||||
data, err := io.ReadAll(io.LimitReader(resp.Body, 2*1024*1024+1))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user