fix: restore scene preview styles

This commit is contained in:
2026-08-26 15:09:27 +08:00
parent 89b402de7a
commit 4133a5244a
5 changed files with 46 additions and 1 deletions

View File

@@ -20,13 +20,15 @@ export function MapCanvas({ state, selected, visible, scene, onSelectRoad, onFea
const layersRef = useRef<ReturnType<typeof createLayers> | null>(null);
const selectedRef = useRef<Road | null>(selected);
const stateRef = useRef(state);
const sceneRef = useRef(scene);
selectedRef.current = selected;
stateRef.current = state;
sceneRef.current = scene;
useEffect(() => {
if (!target.current) return;
const layers = createLayers(
() => selectedRef.current,
() => scene,
() => sceneRef.current,
);
layersRef.current = layers;
const map = new Map({