From c925890848066dd9f60517fc6a51f137fc2b229d Mon Sep 17 00:00:00 2001 From: que01 Date: Tue, 11 Aug 2026 16:31:55 +0800 Subject: [PATCH] fix(preview): resolve package assets from manifest --- scripts/lib/cesium-preview.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/lib/cesium-preview.js b/scripts/lib/cesium-preview.js index dec6d65..9fce607 100644 --- a/scripts/lib/cesium-preview.js +++ b/scripts/lib/cesium-preview.js @@ -167,7 +167,16 @@ function normalizedAssets(metadata) { if (metadata.schema === "osm-asset-package/v1") { - const staticAssets = metadata.assets.map((asset) => ({ id: asset.id, label: asset.id, type: "model", url: asset.uri, enabled: asset.defaultLoad, category: asset.category, semantic: asset.role === "layer" })); + const staticAssets = metadata.assets.map((asset) => ({ + id: asset.id, + label: asset.id, + type: "model", + // Package URIs are relative to manifest.json, not the preview HTML. + url: new URL(asset.uri, new URL(config.metadataName, window.location.href)).href, + enabled: asset.defaultLoad, + category: asset.category, + semantic: asset.role === "layer", + })); return staticAssets.concat(metadata.previewAssets || []); } const assets = Array.isArray(metadata.assets) && metadata.assets.length