feat(junction): edit complex cutbacks and corners
This commit is contained in:
1 parent
d0e1f62f2b
commit
80f122be46
15 files changed
+354
-38
No files matched your search
@@ -769,6 +769,7 @@ function compileGeometry(model, overrides = { overrides: [] }, options = {}) {
|
||||
headingAtEndpoint,
|
||||
headingVector,
|
||||
circleRing,
|
||||
clusterCornerRadii: options.directEdit?.clusterCorners?.get(String(cluster.id)),
|
||||
});
|
||||
features.push(...generated.features);
|
||||
if (generated.crosswalks) generatedComplexCrosswalks.push(...generated.crosswalks);
|
||||
@@ -912,8 +913,14 @@ function applyDirectJunctionPlans(plans, directEdit) {
|
||||
}
|
||||
|
||||
function applyDirectClusterPlans(model, junctionPlans, directEdit, clusters) {
|
||||
if (!directEdit?.clusterPlans?.size) return;
|
||||
for (const [clusterId, widths] of directEdit.clusterPlans) {
|
||||
if (!directEdit?.clusterPlans?.size && !directEdit?.clusterCutbacks?.size) return;
|
||||
const clusterIds = new Set([
|
||||
...(directEdit.clusterPlans || new Map()).keys(),
|
||||
...(directEdit.clusterCutbacks || new Map()).keys(),
|
||||
]);
|
||||
for (const clusterId of clusterIds) {
|
||||
const widths = directEdit.clusterPlans?.get(clusterId) || new Map();
|
||||
const cutbacks = directEdit.clusterCutbacks?.get(clusterId) || new Map();
|
||||
const cluster = clusters.find((item) => String(item.id) === String(clusterId));
|
||||
if (!cluster || cluster.template !== 'complex-junction-v1') continue;
|
||||
const topology = resolveComplexJunctionTopology(model, cluster, {
|
||||
@@ -925,6 +932,8 @@ function applyDirectClusterPlans(model, junctionPlans, directEdit, clusters) {
|
||||
for (const item of topology.carriageways) {
|
||||
const width = widths.get(item.key);
|
||||
if (Number.isFinite(width)) item.approach.widthMeters = width;
|
||||
const cutback = cutbacks.get(item.key);
|
||||
if (Number.isFinite(cutback)) item.approach.cutback = cutback;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user