diff --git a/scripts/lib/cesium-preview.js b/scripts/lib/cesium-preview.js index 97c2d6f..c73fe38 100644 --- a/scripts/lib/cesium-preview.js +++ b/scripts/lib/cesium-preview.js @@ -293,8 +293,9 @@ async function setBuildingGhost(enabled) { const roads = assets.find((asset) => asset.id === "roads"); const buildings = assets.find((asset) => asset.id === "buildings"); + const props = assets.find((asset) => asset.id === "vegetation"); const main = assets.find((asset) => asset.id === "main"); - if (!roads || !buildings || !main) { + if (!roads || !buildings || !props || !main) { toggleBuildingGhost.checked = false; toggleBuildingGhost.disabled = true; return; @@ -303,8 +304,9 @@ const loaded = await Promise.all([ loadAsset(viewer, roads, placement), loadAsset(viewer, buildings, placement), + loadAsset(viewer, props, placement), ]); - if (!loaded[0] || !loaded[1]) { + if (!loaded[0] || !loaded[1] || !loaded[2]) { toggleBuildingGhost.checked = false; setStatus("Building transparency unavailable"); return; @@ -312,6 +314,9 @@ main.model.show = false; roads.model.show = true; buildings.model.show = true; + // The semantic vegetation asset also owns the static traffic-signal + // poles/housings from the 05_Props collection. + props.model.show = true; buildings.model.color = Cesium.Color.WHITE.withAlpha(0.22); buildings.model.colorBlendMode = Cesium.ColorBlendMode.REPLACE; buildings.model.colorBlendAmount = 1.0; @@ -368,7 +373,8 @@ void setBuildingGhost(toggleBuildingGhost.checked); }); if (!semanticAssets(assets).some((asset) => asset.id === "roads") || - !semanticAssets(assets).some((asset) => asset.id === "buildings")) { + !semanticAssets(assets).some((asset) => asset.id === "buildings") || + !semanticAssets(assets).some((asset) => asset.id === "vegetation")) { toggleBuildingGhost.disabled = true; }