From 6bf87178039021aae0fb79b16bfd86ce5d48d229 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 27 Apr 2026 05:01:39 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20route=20polyline=20on=20first=20route=20?= =?UTF-8?q?=E2=80=94=20use=20idle=20event=20instead=20of=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The load event only fires once during map init. When route state changes before style is fully loaded, the once(load) handler never executes because load already fired. idle fires after every render cycle, ensuring the route draws once the style is ready. --- src/components/MapView.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MapView.jsx b/src/components/MapView.jsx index 6da9442..408d78d 100644 --- a/src/components/MapView.jsx +++ b/src/components/MapView.jsx @@ -1284,8 +1284,8 @@ const MapView = forwardRef(function MapView(_, ref) { if (!map) return if (!map.isStyleLoaded()) { const handler = () => updateRoute(map, route) - map.once('load', handler) - return () => map.off('load', handler) + map.once('idle', handler) + return () => map.off('idle', handler) } updateRoute(map, route) }, [route])