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

depth bugfix when missing forcingBoundary

parent c3c05c78
......@@ -153,7 +153,7 @@
calculationmode: true,
uncertainty: true
};
if (forcing.features.length > 0) properties["forcing"] = forcing;
// if (forcing.features.length > 0) properties["forcing"] = forcing;
class SimpleCardControl extends STWkit.CardControl {
constructor(options) {super(options);}
......
......@@ -257,8 +257,12 @@ var STWkit;
self.forcingBoundary.addListener(self.control.layers);
}
self.control.showTable();
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])]);
for (var i = 0; i < coordinates.length; i++) {
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.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 {
self.forcingBoundary.addListener(self.control.layers);
}
self.control.showTable();
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])]);
for (var i = 0; i < coordinates.length; i++) {
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.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