feat: drag lane turn arrows along their lanes
This commit is contained in:
1 parent
5457f960ff
commit
9cb715a592
12 files changed
+335
-24
No files matched your search
@@ -28,7 +28,11 @@ export type LayerName =
|
||||
| 'connectors'
|
||||
| 'diagnostics'
|
||||
| 'selectedRoad';
|
||||
export function createLayers(onRoad: () => Road | null, scene: () => boolean) {
|
||||
export function createLayers(
|
||||
onRoad: () => Road | null,
|
||||
scene: () => boolean,
|
||||
hiddenMarkingIds: () => ReadonlySet<string> = () => new Set(),
|
||||
) {
|
||||
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>> = {
|
||||
@@ -66,7 +70,10 @@ export function createLayers(onRoad: () => Road | null, scene: () => boolean) {
|
||||
}),
|
||||
markings: new VectorLayer({
|
||||
source: source(),
|
||||
style: new Style({ fill: new Fill({ color: '#f5f6ee' }), stroke: new Stroke({ color: '#d9dacf', width: 1 }) }),
|
||||
style: (feature) =>
|
||||
hiddenMarkingIds().has(String(feature.get('native_id')))
|
||||
? undefined
|
||||
: new Style({ fill: new Fill({ color: '#f5f6ee' }), stroke: new Stroke({ color: '#d9dacf', width: 1 }) }),
|
||||
}),
|
||||
centerLines: new VectorLayer({
|
||||
source: source(),
|
||||
|
||||
Reference in new issue
Block a user