feat(workbench): add junction hotspot entry points
This commit is contained in:
1 parent
bd7b049930
commit
7d9b0f46d4
6 files changed
+288
-6
No files matched your search
@@ -53,6 +53,7 @@ import type {
|
||||
import { Button } from './ui/button';
|
||||
import type { GeoFeature, GeoJson, Road, WorkbenchState } from './types/state';
|
||||
import type { LayerName } from './map/layers';
|
||||
import type { JunctionRef } from './junction/hotspots';
|
||||
|
||||
const layerLabels: Array<[LayerName, string]> = [
|
||||
['osm', '方向道路参考线'],
|
||||
@@ -65,6 +66,7 @@ const layerLabels: Array<[LayerName, string]> = [
|
||||
['edgeLines', '道路外缘线'],
|
||||
['controls', '斑马线与停止线'],
|
||||
['signals', '红绿灯设施'],
|
||||
['junctionHotspots', '路口编辑热区'],
|
||||
];
|
||||
const defaultLayers = Object.fromEntries(layerLabels.map(([key]) => [key, key !== 'edgeLines'])) as Record<
|
||||
LayerName,
|
||||
@@ -78,6 +80,7 @@ function App() {
|
||||
const [selected, setSelected] = useState<Road | null>(null);
|
||||
const [layers, setLayers] = useState(defaultLayers);
|
||||
const [scene, setScene] = useState(false);
|
||||
const [junctionHotspots, setJunctionHotspots] = useState(true);
|
||||
const [status, setStatus] = useState('正在加载工作台...');
|
||||
const [filter, setFilter] = useState<'all' | 'candidates' | 'other'>('all');
|
||||
const [marking, setMarking] = useState<Record<string, unknown> | null>(null);
|
||||
@@ -802,6 +805,10 @@ function App() {
|
||||
selected={selected}
|
||||
visible={layers}
|
||||
scene={scene}
|
||||
junctionHotspots={junctionHotspots}
|
||||
onJunctionHotspot={(ref: JunctionRef) => {
|
||||
setStatus(ref.type === 'node' ? `已定位路口节点 ${ref.id}(可编辑)` : `已定位路口 ${ref.id}(只读)`);
|
||||
}}
|
||||
onSelectRoad={setSelected}
|
||||
onFeature={handleFeature}
|
||||
signalSelectionUid={typeof marking?.signal_uid === 'string' ? marking.signal_uid : null}
|
||||
|
||||
Reference in new issue
Block a user