@@ -6,6 +6,15 @@ import { ServiceState } from "../service/state";
66const DEFAULT_DARK_BG = "#000000" ;
77const DEFAULT_LIGHT_BG = "#FFFFFF" ;
88
9+ const GLOBE_MAP_URL_DARK =
10+ import . meta. env . VITE_GLOBE_MAP_URL_DARK || "assets/img/earth-night.jpg" ;
11+ const GLOBE_MAP_URL_LIGHT =
12+ import . meta. env . VITE_GLOBE_MAP_URL_LIGHT || "assets/img/earth-day.jpg" ;
13+ const GLOBE_BUMP_MAP_URL =
14+ import . meta. env . VITE_GLOBE_BUMP_MAP_URL || "assets/img/earth-topology.png" ;
15+ const COUNTRIES_GEOJSON_URL =
16+ import . meta. env . VITE_COUNTRIES_GEOJSON_URL || "assets/data/countries.geojson" ;
17+
918/**
1019 * UI elements related to settings
1120 */
@@ -187,11 +196,25 @@ export class Settings extends EventTarget {
187196 } else if ( settings . bgColor == DEFAULT_LIGHT_BG && newValue == false ) {
188197 settings . bgColor = DEFAULT_DARK_BG ;
189198 }
199+ if ( settings . globeMapUrl == GLOBE_MAP_URL_DARK && newValue == true ) {
200+ settings . globeMapUrl = GLOBE_MAP_URL_LIGHT ;
201+ } else if (
202+ settings . globeMapUrl == GLOBE_MAP_URL_LIGHT &&
203+ newValue == false
204+ ) {
205+ settings . globeMapUrl = GLOBE_MAP_URL_DARK ;
206+ }
190207 return newValue ;
191208 } )
192209 accessor lightMode : boolean = false ;
193210 @SettingsField ( )
194- accessor bgColor : string = "#000000" ;
211+ accessor bgColor : string = DEFAULT_DARK_BG ;
212+ @SettingsField ( )
213+ accessor globeMapUrl : string = GLOBE_MAP_URL_DARK ;
214+ @SettingsField ( )
215+ accessor globeBumpMapUrl : string = GLOBE_BUMP_MAP_URL ;
216+ @SettingsField ( )
217+ accessor countriesGeoJsonUrl : string = COUNTRIES_GEOJSON_URL ;
195218
196219 @SettingsField ( )
197220 accessor enableSettingsDialog : boolean = true ;
@@ -482,6 +505,9 @@ export function setupSettingsDialog(
482505 [ "#counterstitle" , "string" , "countersTitle" ] ,
483506 [ "#counterslabel" , "string" , "countersLabel" ] ,
484507 [ "#bgcolor" , "string" , "bgColor" ] ,
508+ [ "#globemapurl" , "string" , "globeMapUrl" ] ,
509+ [ "#globebumpmapurl" , "string" , "globeBumpMapUrl" ] ,
510+ [ "#countriesgeojsonurl" , "string" , "countriesGeoJsonUrl" ] ,
485511 [ "#maxscale" , "number" , "maximumScale" ] ,
486512 [ "#maxscalecounter" , "number" , "maximumScaleCounter" ] ,
487513 [ "#timezone" , "selectstring" , "timeZone" ] ,
@@ -848,6 +874,22 @@ function renderDialog(dialogContainer: HTMLElement) {
848874 <input type="checkbox" id="lightmode" name="lightmode" />
849875 <label for="bgcolor">Background color:</label>
850876 <input type="color" id="bgcolor" name="bgcolor" value="#000000" />
877+ <label for="globemapurl">Globe map url:</label>
878+ <input type="text" id="globemapurl" name="globemapurl" list="mapurls"/>
879+ <datalist id="mapurls">
880+ <option value="${ GLOBE_MAP_URL_DARK } ">Default dark</option>
881+ <option value="${ GLOBE_MAP_URL_LIGHT } ">Default light</option>
882+ </datalist>
883+ <label for="globebumpmapurl">Globe bump map url:</label>
884+ <input type="text" id="globebumpmapurl" name="globebumpmapurl" list="bumpmapurls"/>
885+ <datalist id="bumpmapurls">
886+ <option value="${ GLOBE_BUMP_MAP_URL } ">Default</option>
887+ </datalist>
888+ <label for="countriesgeojsonurl">Countries borders GeoJSON url:</label>
889+ <input type="text" id="countriesgeojsonurl" name="countriesgeojsonurl" list="countriesurls"/>
890+ <datalist id="countriesurls">
891+ <option value="${ COUNTRIES_GEOJSON_URL } ">Default</option>
892+ </datalist>
851893 <label for="showwebsocketui">Show websocket connection UI:</label>
852894 <input type="checkbox" id="showwebsocketui" name="showwebsocketui" />
853895 <label for="showwsstatus">Show websocket status:</label>
0 commit comments