From 8ef76f90d02d18c44bc5c35a1e1098e525cf6d1b Mon Sep 17 00:00:00 2001 From: TianXuan Developer Date: Sat, 25 Jul 2026 10:05:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8L.svg=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E5=99=A8=E9=81=BF=E5=85=8DpreferCanvas=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Leaflet map使用preferCanvas:true时,所有polyline经canvas渲染, dashOffset动画可能不生效。为流量层显式指定L.svg()渲染器。 Co-Authored-By: Claude --- simple_analysis/templates/simple_analysis/simple_analysis.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simple_analysis/templates/simple_analysis/simple_analysis.html b/simple_analysis/templates/simple_analysis/simple_analysis.html index fbfef37..ac1eb34 100644 --- a/simple_analysis/templates/simple_analysis/simple_analysis.html +++ b/simple_analysis/templates/simple_analysis/simple_analysis.html @@ -2598,7 +2598,8 @@ function toggleTrafficPanel() { function _ensureFlowLayer() { if (!SA.map) return null; if (!_trafficFlowLayer) { - _trafficFlowLayer = L.layerGroup().addTo(SA.map); + const svgRenderer = L.svg({padding: 0.5}); + _trafficFlowLayer = L.layerGroup([], {renderer: svgRenderer}).addTo(SA.map); } return _trafficFlowLayer; }