From 676a4e6cc144d48b97d582374b7001eec0dafb27 Mon Sep 17 00:00:00 2001 From: Thomas Fuhrmann Date: Mon, 5 May 2025 10:12:13 +0200 Subject: [PATCH] Remove parallelization to retain layer order --- app/three/utils/build-meshes.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/three/utils/build-meshes.ts b/app/three/utils/build-meshes.ts index 1b06dd3..a5bbe37 100644 --- a/app/three/utils/build-meshes.ts +++ b/app/three/utils/build-meshes.ts @@ -22,16 +22,14 @@ export async function buildMeshes( mappedFeatures: MappedFeature[], model: Group ) { - const meshPromises = mappedFeatures.map(async (layerData) => { - const mesh = await buildMesh(layerData); - if (layerData.name === "Topography") { + for (const mappedFeature of mappedFeatures) { + const mesh = await buildMesh(mappedFeature); + if (mappedFeature.name === "Topography") { mesh.visible = false; } model.add(mesh); - }); - - await Promise.all(meshPromises); + } } async function buildMesh(layerData: MappedFeature) {