feat: publish independent carriageway edge handles
This commit is contained in:
1 parent
c77308c170
commit
f722cadf25
3 files changed
+29
-1
No files matched your search
@@ -1621,6 +1621,31 @@ function makeClusterCarriagewayHandles(model, junctionData, constraints, cluster
|
||||
editable: true,
|
||||
});
|
||||
}
|
||||
const edgeConstraint = constraintFor(constraints, 'cluster-carriageway-edge-offset', {
|
||||
clusterId,
|
||||
carriagewayKey: item.key,
|
||||
});
|
||||
const edgeValue = edgeConstraint?.value || {};
|
||||
for (const side of ['left', 'right']) {
|
||||
handles.push({
|
||||
handleId: `handle:cluster-carriageway-edge-offset:${side}:${item.key}`,
|
||||
kind: 'cluster-carriageway-edge-offset',
|
||||
anchor: {
|
||||
type: 'cluster-carriageway',
|
||||
clusterId,
|
||||
carriagewayKey: item.key,
|
||||
side,
|
||||
sourceNodeIds: item.sourceNodeIds,
|
||||
sourceRoadIds: item.sourceRoadIds,
|
||||
},
|
||||
position: point,
|
||||
axisAzimuth: (tangentAzimuth(line, station) + (side === 'left' ? 270 : 90)) % 360,
|
||||
value: { current: Number(edgeValue[`${side}OffsetMeters`]) || 0, min: -10, max: 10, unit: 'meter' },
|
||||
...(edgeConstraint ? { constraintId: edgeConstraint.id } : {}),
|
||||
affects: [`complex-junction:${clusterId}:carriageway:${item.approach.segmentId}`],
|
||||
editable: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return handles;
|
||||
|
||||
Reference in new issue
Block a user