From 967ae45fa99b08111c9cb0788ec7249a5c5ba00f Mon Sep 17 00:00:00 2001 From: ctwhome Date: Thu, 14 Mar 2024 15:50:58 +0100 Subject: [PATCH] Update path for map texture loading --- src/routes/viewer/sceneSetup/createPlaneMesh.ts | 3 ++- svelte.config.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/viewer/sceneSetup/createPlaneMesh.ts b/src/routes/viewer/sceneSetup/createPlaneMesh.ts index ae4e831..b296ae4 100644 --- a/src/routes/viewer/sceneSetup/createPlaneMesh.ts +++ b/src/routes/viewer/sceneSetup/createPlaneMesh.ts @@ -1,12 +1,13 @@ import * as THREE from 'three'; import { get } from 'svelte/store' import { scaleFactor } from '../stores/viewer.store'; +import { base } from '$app/paths'; // // Create and add plane mesh to the scene to hold the Map texture // export function createPlaneMesh(): THREE.Mesh { const textureLoader = new THREE.TextureLoader(); - const texture = textureLoader.load('/maps/nl_map 50m per pixel.webp'); + const texture = textureLoader.load(`${base}/maps/nl_map 50m per pixel.webp`); texture.colorSpace = THREE.SRGBColorSpace; // Scale factor: 50 meters per pixel diff --git a/svelte.config.js b/svelte.config.js index ee076a0..f9d6089 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -15,7 +15,7 @@ const config = { fallback: '404.html' }), paths: { - base: process.argv.includes('dev') ? '' : process.env.BASE_PATH + '/zarrviz' + base: process.argv.includes('dev') ? '' : process.env.BASE_PATH } } };