Commit 0ae297fc authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

depth bugfix when missing forcingBoundary

parent c3c05c78
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
calculationmode: true, calculationmode: true,
uncertainty: true uncertainty: true
}; };
if (forcing.features.length > 0) properties["forcing"] = forcing; // if (forcing.features.length > 0) properties["forcing"] = forcing;
class SimpleCardControl extends STWkit.CardControl { class SimpleCardControl extends STWkit.CardControl {
constructor(options) {super(options);} constructor(options) {super(options);}
......
...@@ -257,8 +257,12 @@ var STWkit; ...@@ -257,8 +257,12 @@ var STWkit;
self.forcingBoundary.addListener(self.control.layers); self.forcingBoundary.addListener(self.control.layers);
} }
self.control.showTable(); self.control.showTable();
for (var i = 0; i < coordinates.length; i++) for (var i = 0; i < coordinates.length; i++) {
self.positions.push([coordinates[i][1], coordinates[i][0], self.forcingBoundary.depth(coordinates[i][1], coordinates[i][0])]); var depth = 0;
if (self.forcingBoundary)
depth = self.forcingBoundary.depth(coordinates[i][1], coordinates[i][0]);
self.positions.push([coordinates[i][1], coordinates[i][0], depth]);
}
self.positionMaxDepth = Math.floor(self.positions[0][2]); self.positionMaxDepth = Math.floor(self.positions[0][2]);
self.validate(); self.validate();
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -282,8 +282,11 @@ module STWkit { ...@@ -282,8 +282,11 @@ module STWkit {
self.forcingBoundary.addListener(self.control.layers); self.forcingBoundary.addListener(self.control.layers);
} }
self.control.showTable(); self.control.showTable();
for (var i = 0; i < coordinates.length; i++) for (var i = 0; i < coordinates.length; i++) {
self.positions.push([coordinates[i][1], coordinates[i][0], self.forcingBoundary.depth(coordinates[i][1], coordinates[i][0])]); var depth = 0;
if (self.forcingBoundary) depth = self.forcingBoundary.depth(coordinates[i][1], coordinates[i][0])
self.positions.push([coordinates[i][1], coordinates[i][0], depth]);
}
self.positionMaxDepth = Math.floor(self.positions[0][2]); self.positionMaxDepth = Math.floor(self.positions[0][2]);
self.validate(); self.validate();
} }
......
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