feat(workbench): organize map editing panels

This commit is contained in:
que01 committed 2026-09-01 13:47:30 +08:00
1 parent 6d80597642
commit bb108267e3
8 files changed
+556 -242

No files matched your search

+3 -4
View File
@@ -14,7 +14,6 @@ import type { Road, WorkbenchState } from '../types/state';
const geojson = new GeoJSON();
const source = () => new VectorSource();
export type LayerName =
| 'reference'
| 'native'
| 'sidewalks'
| 'osm'
@@ -36,7 +35,6 @@ export function createLayers(
const simple = (color: string, width = 1) =>
new Style({ fill: new Fill({ color: `${color}55` }), stroke: new Stroke({ color, width }) });
const layers: Record<LayerName, VectorLayer<VectorSource>> = {
reference: new VectorLayer({ source: source(), visible: false, style: simple('#8999a0') }),
native: new VectorLayer({
source: source(),
style: () => (scene() ? new Style({ fill: new Fill({ color: '#3f4b50' }) }) : simple('#296956')),
@@ -83,7 +81,9 @@ export function createLayers(
const solid = feature.get('pattern') === 'solid';
return new Style({
fill: new Fill({ color }),
stroke: new Stroke({ color: solid ? color : white ? '#aeb0aa' : '#d29d16', width: solid ? 0.25 : 0.8 }),
// OpenLayers widths are screen pixels, not meters. The compiler's
// physical marking width therefore cannot be used here directly.
stroke: new Stroke({ color: solid ? color : white ? '#aeb0aa' : '#d29d16', width: solid ? 1.5 : 1.25 }),
});
},
}),
@@ -138,7 +138,6 @@ export function updateLayers(layers: ReturnType<typeof createLayers>, state: Wor
target.clear();
target.addFeatures(features(value));
};
put('reference', state.layers.osm2streetsRoadSurface);
put('native', state.layers.nativeRoadSurface);
get('native').addFeatures(features(state.layers.nativeIntersectionSurface));
put('sidewalks', state.layers.nativeSidewalkSurface);