Commit 9c677616 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

fixed depth bug

parent 721a1541
......@@ -49,6 +49,7 @@ var OSLocation = (function (_super) {
self.depthInput = L.DomUtil.create('input', 'uk-width-1-4', depthDiv);
self.depthInput.type = 'number';
self.depthInput.value = '0';
self.depthInput.step = '10';
self.depthInput.min = '0';
self.depthInput.onchange = function () {
self.validate();
......@@ -84,6 +85,7 @@ var OSLocation = (function (_super) {
self.obsDateInput.value = date;
var time = moment.utc(observation.date).format(self.timeFormat);
self.obsTimeInput.value = time;
self.depthInput.value = simulation.depth;
};
OSLocation.prototype.populateData = function (geojson) {
_super.prototype.populateData.call(this, geojson);
......@@ -99,6 +101,7 @@ var OSLocation = (function (_super) {
};
geojson.features[0].properties["observation"] = [];
geojson.features[0].properties["observation"].push(observation);
geojson.features[0].properties["simulation"]["depth"] = self.depthInput.value;
};
return OSLocation;
}(STWkit.LocationCard));
......
This diff is collapsed.
......@@ -50,6 +50,7 @@ class OSLocation extends STWkit.LocationCard {
self.depthInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-4', depthDiv);
self.depthInput.type = 'number';
self.depthInput.value = '0';
self.depthInput.step = '10';
self.depthInput.min = '0';
self.depthInput.onchange = function () {
......@@ -92,6 +93,7 @@ class OSLocation extends STWkit.LocationCard {
self.obsDateInput.value = date;
var time = moment.utc(observation.date).format(self.timeFormat);
self.obsTimeInput.value = time;
self.depthInput.value = simulation.depth;
}
public populateData(geojson) {
......@@ -109,6 +111,8 @@ class OSLocation extends STWkit.LocationCard {
};
geojson.features[0].properties["observation"] = [];
geojson.features[0].properties["observation"].push(observation);
geojson.features[0].properties["simulation"]["depth"] = self.depthInput.value;
}
}
......
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