fix: 地图拖动/缩放时流量边实时跟随

- moveend事件清空边坐标缓存+立即重绘
- 不每帧重复绑定handler

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
TianXuan Developer
2026-07-25 10:35:04 +08:00
parent b2b3fca9f2
commit 0c75d986c2
@@ -2672,6 +2672,7 @@ function loadTrafficData() {
document.getElementById('saTrafficSlider').value = 0;
document.getElementById('saTrafficInfo').textContent =
(d.windows||[]).length + ' 窗口 · ' + Object.keys(d.nodes_coords||{}).length + ' 节点 · 跨度' + ((maxTs-minTs)/60).toFixed(0) + 'min';
SA.map.off('moveend.flowCache').on('moveend.flowCache', () => { _trafficEdgeCache = {}; });
document.getElementById('saTrafficTime').textContent = tsToBJ(_trafficCurrentTime);
trafficStart();
})
@@ -2847,8 +2848,6 @@ function renderTrafficCrossfade() {
}
});
SA.map.off('moveend.flowCache').on('moveend.flowCache', () => { _trafficEdgeCache = {}; });
if (SA.pointLayer && !SA._clusterFocus) {
SA.pointLayer.getLayers().forEach(l => {
if (!l.setStyle) return;