Commit d69c23f3 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

fixed bug with setting forcingmodel

parent b10a4387
...@@ -134,16 +134,16 @@ ...@@ -134,16 +134,16 @@
"coordinates": coordinatesLangData "coordinates": coordinatesLangData
}; };
var forcing = { var forcingconfig = {
"model": "NEMO", "model": "GETM",
"configuration": "NORDIC", "configuration": "NORDIC",
"domain": "NS02" "domain": "HELCOM"
}; };
var domainname = "HELCOM"; var domainname = "HELCOM";
reqwest({ reqwest({
url: "forcing/config"+STWkit.jsonToQueryString(forcing), url: "forcing/config"+STWkit.jsonToQueryString(forcingconfig),
method: 'get', method: 'get',
type: 'json', type: 'json',
success: function (forcing) { success: function (forcing) {
...@@ -151,6 +151,7 @@ ...@@ -151,6 +151,7 @@
"domain" : domainname, "domain" : domainname,
"lang": language, "lang": language,
"langdata": langData, "langdata": langData,
"forcingmodel": forcingconfig.model,
calculationmode: true, calculationmode: true,
uncertainty: true uncertainty: true
}; };
......
...@@ -998,6 +998,10 @@ var STWkit; ...@@ -998,6 +998,10 @@ var STWkit;
if (options.domain) { if (options.domain) {
_this.domain = options.domain; _this.domain = options.domain;
} }
_this.forcingmodel = "NEMO";
if (options.forcingmodel) {
_this.forcingmodel = options.forcingmodel;
}
_this.lang = "en"; _this.lang = "en";
if (options.lang) { if (options.lang) {
_this.lang = options.lang; _this.lang = options.lang;
...@@ -1005,11 +1009,8 @@ var STWkit; ...@@ -1005,11 +1009,8 @@ var STWkit;
if (options.langdata) { if (options.langdata) {
_this.langData = options.langdata; _this.langData = options.langdata;
} }
_this.forcingmodel = "NEMO";
if (options.forcing) { if (options.forcing) {
_this.forcing = options.forcing; _this.forcing = options.forcing;
if ((_this.forcing.features.length > 0) && (_this.forcing.features[0].properties))
_this.forcingmodel = _this.forcing.features[0].properties.model;
} }
_this.showuncertainty = true; _this.showuncertainty = true;
if (typeof options.uncertainty !== "undefined") if (typeof options.uncertainty !== "undefined")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1113,6 +1113,10 @@ module STWkit { ...@@ -1113,6 +1113,10 @@ module STWkit {
if (options.domain) { if (options.domain) {
this.domain = options.domain; this.domain = options.domain;
} }
this.forcingmodel = "NEMO";
if (options.forcingmodel) {
this.forcingmodel = options.forcingmodel;
}
this.lang = "en"; this.lang = "en";
if (options.lang) { if (options.lang) {
this.lang = options.lang; this.lang = options.lang;
...@@ -1121,11 +1125,8 @@ module STWkit { ...@@ -1121,11 +1125,8 @@ module STWkit {
this.langData = options.langdata; this.langData = options.langdata;
} }
this.forcingmodel = "NEMO";
if (options.forcing) { if (options.forcing) {
this.forcing = options.forcing; this.forcing = options.forcing;
if ((this.forcing.features.length > 0) && (this.forcing.features[0].properties))
this.forcingmodel = this.forcing.features[0].properties.model;
} }
this.showuncertainty = true; this.showuncertainty = true;
if (typeof options.uncertainty !== "undefined") this.showuncertainty = options.uncertainty; if (typeof options.uncertainty !== "undefined") this.showuncertainty = options.uncertainty;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment