fix(junction): align complex crossing handles
This commit is contained in:
1 parent
48fd432266
commit
a98d170757
2 files changed
+69
-4
No files matched your search
@@ -330,6 +330,18 @@ assert.notDeepEqual(
|
||||
);
|
||||
const complexCrossingHandle = clusterState.handles.handles.find((handle) => handle.kind === 'cluster-crossing-inset');
|
||||
assert.ok(complexCrossingHandle, 'the complex fixture must publish grouped crossing handles');
|
||||
const renderedComplexCrosswalk = clusterPreview.layers.crosswalks.features.find(
|
||||
(feature) => feature.properties.crossing_key === complexCrossingHandle.anchor.crossingKey,
|
||||
);
|
||||
const crossingHandleLatitudeScale = 111320 * Math.cos((complexCrossingHandle.position[1] * Math.PI) / 180);
|
||||
assert.ok(
|
||||
Math.hypot(
|
||||
(complexCrossingHandle.position[0] - renderedComplexCrosswalk.properties.frame_center[0]) *
|
||||
crossingHandleLatitudeScale,
|
||||
(complexCrossingHandle.position[1] - renderedComplexCrosswalk.properties.frame_center[1]) * 111320,
|
||||
) < 2,
|
||||
'the complex crossing handle must remain on the rendered crossing frame',
|
||||
);
|
||||
const complexCrossingConstraint = {
|
||||
id: 'constraint:complex-crossing',
|
||||
kind: 'cluster-crossing-inset',
|
||||
|
||||
Reference in new issue
Block a user