feat: add live V2X Cesium preview overlay

This commit is contained in:
2026-08-24 14:20:16 +08:00
parent 71ba536c7c
commit ee273c5cd6
20 changed files with 760 additions and 3 deletions

View File

@@ -127,12 +127,33 @@ function normalizeAreaConfig(raw, options = {}) {
officeOverrides: raw.blender?.officeOverrides || raw.blender?.office_overrides || "",
roadProvider: roadProviderOption(raw.blender?.roadProvider ?? "native"),
},
v2xPreview: normalizeV2xPreviewConfig(raw.v2xPreview),
compress,
budget,
outputs,
};
}
function normalizeV2xPreviewConfig(raw) {
if (raw !== undefined && (raw === null || typeof raw !== "object" || Array.isArray(raw))) {
throw new Error("v2xPreview must be an object");
}
const value = raw || {};
const text = (name, fallback) => {
const item = value[name] ?? fallback;
if (typeof item !== "string") throw new Error(`v2xPreview.${name} must be a string`);
return item.trim();
};
return {
enabled: booleanOption(value.enabled, false, "v2xPreview.enabled"),
// Relative defaults keep credentials and private service origins out of the
// generated preview. Production should reverse-proxy these prefixes.
apiBaseUrl: text("apiBaseUrl", "/api"),
wsBaseUrl: text("wsBaseUrl", "/websocket"),
crossCode: text("crossCode", ""),
};
}
function normalizeJunctionTemplates(raw, repoRoot) {
if (raw === undefined || raw === null) return { enabled: false, references: [] };
if (typeof raw !== "object" || Array.isArray(raw)) throw new Error("nativeRoad.junctionTemplates must be an object");