From a1e74710d529cddd01107d83d120c370895e8d1c Mon Sep 17 00:00:00 2001 From: Dan Moran MBA15 Date: Tue, 26 Nov 2024 11:14:17 +0100 Subject: [PATCH 1/3] added support for .palettename.txt --- public/favicon.svg | 9 +++++++++ src/components/Map.astro | 7 ++++++- src/scripts/parseQGISColorfile.js | 21 +++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 public/favicon.svg diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..f157bd1 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,9 @@ + + + + diff --git a/src/components/Map.astro b/src/components/Map.astro index 7625093..88b1d7d 100644 --- a/src/components/Map.astro +++ b/src/components/Map.astro @@ -18,7 +18,7 @@ import { getInterpolateBand1AsColor } from '../scripts/palette.js'; import { transformExtent, Projection, get as getProjection, fromLonLat } from 'ol/proj'; import {register,fromEPSGCode} from 'ol/proj/proj4'; import proj4 from 'proj4' -import {getQGISColorfile} from '../scripts/parseQGISColorfile.js'; +import {getQGISColorfile, getPalettenameFile} from '../scripts/parseQGISColorfile.js'; let source : any = null; @@ -117,6 +117,11 @@ async function buildMapForGeotiff() { } }); + // Launch an async function to try and get a .palettename.txt for this URL + // This will trigger a "newpalette" event if found + getPalettenameFile(); + + // Launch an async function to try and get a QGIS colorfile for the palette // This will trigger a "newpalette" event if a QGIS colorfile is found getQGISColorfile(); diff --git a/src/scripts/parseQGISColorfile.js b/src/scripts/parseQGISColorfile.js index af7aff0..809698d 100644 --- a/src/scripts/parseQGISColorfile.js +++ b/src/scripts/parseQGISColorfile.js @@ -45,6 +45,27 @@ export async function getQGISColorfile(){ } } + +/** + * Try and get the .palettename.txt file for the URL + * This will trigger a "newpalette" event if found + * @returns + */ +export async function getPalettenameFile(){ + const url = localStorage.getItem('url'); + if (!url) return null; + try { + const palettenameurl = url.replace('.tif', '.palettename.txt'); + const response = await fetch(palettenameurl); + if (!response.ok) return null; + const text = await response.text(); + localStorage.setItem('palettename', text); + document.dispatchEvent(new Event('newpalette')); + } catch (e) { + } +} + + /** * Returns a function which accepts a value in the domain * of the QGISColorfile and returns a color. From f73520202ad220d6eacda8f5d44fce13a9c0af44 Mon Sep 17 00:00:00 2001 From: Dan Moran MBA15 Date: Tue, 26 Nov 2024 11:16:35 +0100 Subject: [PATCH 2/3] change logo to SVG --- public/Logo_FAIRiCUBE_RGB 1.svg | 331 +++++++++++++++++++++++++++ public/fairicubelogo2_108520563.jpeg | Bin 8077 -> 0 bytes src/style.css | 5 +- 3 files changed, 334 insertions(+), 2 deletions(-) create mode 100644 public/Logo_FAIRiCUBE_RGB 1.svg delete mode 100644 public/fairicubelogo2_108520563.jpeg diff --git a/public/Logo_FAIRiCUBE_RGB 1.svg b/public/Logo_FAIRiCUBE_RGB 1.svg new file mode 100644 index 0000000..da8257f --- /dev/null +++ b/public/Logo_FAIRiCUBE_RGB 1.svg @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/fairicubelogo2_108520563.jpeg b/public/fairicubelogo2_108520563.jpeg deleted file mode 100644 index 28fae355aecc53d4e26253cb6a8af7692822d8e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8077 zcmbW6cQjma*Y6Lbmk1$h^b)=IGD!3&(W8fm-lKP-Mi(Rq5=1A1(M$9eoe^b}8AOTR z8RmMP=dSmC@49Q<`#$ep>-+oX{MK3LbI$tiv-kd?f1?+H_W&La4lWKh9xg5}K0Y1+ z5jimtAt4bp*&`D2Co~N7PiW}q7+Lu^7@2uk=;)q`bMgoXiin6Xa7fBZ2+8mXiwI%h zXKoQwcHAF$w+Kf&K}Q;sJxeAP9pQz$C>0kz$~GF}?u+1~$e&1Nh&8feFIG z#=*tICm?(XU}Atkm{=feY%Hw%ox%6l04!2$GA2OAu09jxstMqs+zi>>V7v z-g*1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wN`Pom&uQc>%IhbZ63GN=+c|ZllEA6Y_MC zEc9n!z7NMDc|#EzaJH=0!t4v*?ka=$vO%V+>PLm1$c+h7w2{UlU;f6hkS+@1IQkwj zEtZaume!WWd`2q)Pe6kCn^C*7GMZJ}3u1|$7jqEPtT>p!=!viu(tanDU^R4&`^YF! zasJYz?=O!Wa!2^kZ#Qxx7)N`mTx2QZntH6#dasph{IH_WN-EOUhgLwAcHB{AfGcn zbbp(I2L3{K^>v@(s{cRE;FwyV5$E%J`>)l$ro5g~BC3?_su7wAqOH2*yE+TSQ9Usg z{B`{ms9e9<02~mZag(VK|&X)=`*T zdSKkLg38J#37reS(}N9s2%-Od89sWO9vo?;_=L|I>GdE7f*N31DfX|LS(d0j+WaEA zoa=g)W9kzPkFaGklUP<=MfwjR8$3)Elr@_=68@BN_B|c-HYr>>IOFE!nys#>{?-^C z(3SvP2M1UD+7I%o*v%f@=!|%G(R_l*ZK3|j_$W_a=0RuQl|c?kj7eU*UrSaZl(NNL zDD$Npscak-Xsh!}09#VN!}kTYs*EP|8J3?=l>U=SCn@E diff --git a/src/style.css b/src/style.css index c96d71b..0bfb58f 100644 --- a/src/style.css +++ b/src/style.css @@ -15,7 +15,7 @@ html { @keyframes shift-right { 0% { transform: translateX(0); } - 50% { transform: translateX(1rem); } + 50% { transform: translateX(0.7rem); } 100% { transform: translateX(0); } } @@ -49,11 +49,12 @@ details.stactreeview { cursor: pointer; display: inline-block; background-image: url('/fairicube_logo_400x297.jpg'); + background-image: url('/Logo_FAIRiCUBE_RGB 1.svg'); background-size: contain; background-repeat: no-repeat; background-position: center; vertical-align: middle; - mix-blend-mode: multiply; /* Set white as transparent */ + /*mix-blend-mode: multiply; /* Set white as transparent */ position: relative; transition: transform 0.4s ease-in-out; transform: translateX(0); From 142abd3134f3ed4cf5878986cedfcb3b58c169fe Mon Sep 17 00:00:00 2001 From: Dan Moran MBA15 Date: Tue, 26 Nov 2024 11:38:27 +0100 Subject: [PATCH 3/3] new error messages --- src/components/Colorbar.astro | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/Colorbar.astro b/src/components/Colorbar.astro index c98ac77..8f92d6a 100644 --- a/src/components/Colorbar.astro +++ b/src/components/Colorbar.astro @@ -23,9 +23,16 @@ function updateColorbar() { for (const value of stops){ const div = document.createElement('div'); // Creat a label that shows three significant digits + try { const label = value.toPrecision(3); div.innerHTML = label; colorbar.appendChild(div); + } catch (e) { + console.log(`Error in updateColorbar. E=`,e); + console.log(`Error in updateColorbar. value`,value); + console.log(`Error in updateColorbar. stops`,stops); + } + } colorbar.style.background = getPaletteAsGradient(); return;