Closed ralfstrandell closed 1 year ago
This has been completed for domain defaults. Will tackle other settings (where appropriate) next.
I plan to develop a psgeoGlobalDefaults object to continue the speration of settings from code. Once we have this done, the next step might be to store settings alone in JSON.
psgeoSources moved.
psgeoDomainDefaults, psgeoSources, psgeoRange (range filter settings), Finnish topographic map API key etc. all moved from code to settings. Well not strictly speaking, as they reside in psgeosettings.js now, but these would go to a JSON file in /cfg in the next phase.
Subtype groups and stat lines might also benefit from a life in /cfg
Subtype groups and stat lines moved to psgeotables.js as recommend by lead developer.
Domain Default values (a.k.a customizable settings) are now stored in cfg/psgeoDomainDefaults.json and retrieved (async functions) with await fetch in psgeoInit. Due to the nature of Settings, we really must wait for them to load before proceeding. Not supported: IE (it's 2023!) and Opera Mini (can't do anything with that size screen anyway).
This concludes separation of settings from program code.
The domain defaults should be stored in a separate place (and not all distributed to everyone). Hence: psgeosettings.js: PsgeoSettings() returns an object with one method: initDomain. initDomain(host,path) will return domain default settings.