feat: publish native road layer manifest

This commit is contained in:
2026-08-26 09:53:21 +08:00
parent 90400d967f
commit 82afafa294
6 changed files with 74 additions and 15 deletions

View File

@@ -11,6 +11,12 @@ assert.equal(typeof compiler.turnLaneArrows.buildCustomTurnLaneArrows, "function
assert.equal(typeof compiler.complexJunction.buildComplexJunctionGeometry, "function");
assert.equal(typeof compiler.nativeRoad.compileRoadModel, "function");
assert.equal(typeof compiler.check.checkOutput, "function");
assert.equal(typeof compiler.layerManifest.manifestForArea, "function");
const manifest = compiler.layerManifest.manifestForArea("fixture");
assert.equal(manifest.contract, "native-road-package/v1.1");
assert.equal(manifest.layers.length, 12);
assert.deepEqual(manifest.layers.filter((layer) => layer.role === "semantic").map((layer) => layer.source), ["lane_centerlines", "connectors"]);
assert.equal(manifest.layers.find((layer) => layer.source === "center_lines").splitBy.cases[0].match, "white");
const fixture = path.join(__dirname, "fixtures", "fengshu-er-road.osm");
assert.ok(fs.existsSync(fixture));
assert.throws(() => compiler.compiler.validateInput({ id: "area" }), /RoadCompilerInput/);