Commit b9063c55 authored by Pettersson Tomas's avatar Pettersson Tomas

fixes with setting end point date and refreshing trajectory labels

parent df02cc1f
......@@ -408,9 +408,10 @@ var EXTrajectory = (function (_super) {
}
else {
var diff = Math.abs(self.from - newdate);
var nrofhours = Math.round(((diff / 1000) / 60) / 60);
var nrofhours = ((diff / 1000) / 60) / 60;
if (nrofhours <= 72) {
self.durationhours = nrofhours;
self.to = moment.utc(self.endDateInput.value + ' ' + self.endTimeInput.value, self.datetimeFormat);
self.refreshTrajectory();
self.fireChangeFn(self);
delete self.durationhours;
......@@ -735,6 +736,7 @@ var EXTrajectory = (function (_super) {
EXTrajectory.prototype.clear = function () {
var self = this;
_super.prototype.clear.call(this);
self.drawnfeature = null;
self.trajectoryLabelLayer.clearLayers();
self.trajectoryLayer.clearLayers();
self.trajMarkerArray = [];
......
This diff is collapsed.
......@@ -476,10 +476,11 @@ class EXTrajectory extends STWkit.AccordionCard {
STWkit.AccordionCard.warningMsg('End point date outside simulation period', 'End point date cannot be before simulation period start date');
} else {
var diff = Math.abs(self.from - newdate);
var nrofhours = Math.round(((diff/1000)/60)/60);
var nrofhours = ((diff/1000)/60)/60;
if (nrofhours <= 72) {
self.durationhours = nrofhours;
self.durationhours = nrofhours;
self.to = moment.utc(self.endDateInput.value + ' ' + self.endTimeInput.value, self.datetimeFormat);
self.refreshTrajectory();
self.fireChangeFn(self);
delete self.durationhours;
......@@ -842,6 +843,7 @@ class EXTrajectory extends STWkit.AccordionCard {
public clear() {
var self = this;
super.clear();
self.drawnfeature = null;
self.trajectoryLabelLayer.clearLayers();
self.trajectoryLayer.clearLayers()
self.trajMarkerArray = [];
......
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