From ba6cd588788f805232e8cf9b363998bbed2aeb2b Mon Sep 17 00:00:00 2001 From: Florian Kotthoff <74312290+FlorianK13@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:13:07 +0100 Subject: [PATCH] Add solarIrradiance data via url #47 --- src/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.ts b/src/main.ts index 87f921d..6710758 100644 --- a/src/main.ts +++ b/src/main.ts @@ -105,6 +105,12 @@ export class ShadingScene { this.solarIrradiance = irradiance; } + async addSolarIrradianceFromURL(url: string): Promise { + const response = await fetch(url); + const data = await response.json(); + this.addSolarIrradiance(data); + } + /** * Change the Color Map that is used for the colors of the simulated Three.js mesh. This is * optional, the default colorMap is viridis (blue to green to yellow)