Commit 72c1916b authored by Pettersson Tomas's avatar Pettersson Tomas

more fixes

parent a170a1cf
......@@ -359,7 +359,7 @@ var TrajectoryLineHandler = (function (_super) {
}(LineHandler));
var EXTrajectory = (function (_super) {
__extends(EXTrajectory, _super);
function EXTrajectory(id, parentDiv, lang, langData, map, type, initials) {
function EXTrajectory(id, parentDiv, lang, langData, map, domain, type, subtype, initials) {
var _this = this;
var trajectoryDiv = L.DomUtil.create('div', 'uk-width-1-1 uk-margin-top', parentDiv);
_this = _super.call(this, id, 'Trajectory', parentDiv, trajectoryDiv) || this;
......@@ -377,16 +377,38 @@ var EXTrajectory = (function (_super) {
if (key == 13)
e.preventDefault();
};
self.dateFormat = 'YYYY-MM-DD';
self.timeFormat = 'HH:mm';
self.positions = [];
var positionLabelGrid = L.DomUtil.create('div', 'uk-grid uk-margin-top', form);
var positionlabelDiv = L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid);
_super.prototype.addLabelDiv.call(_this, positionlabelDiv, "Position", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + initials + "-position' target='_blank'>here</a>");
var positionDiv = L.DomUtil.create('div', '', form);
positionDiv.id = 'guide' + initials + 'pos';
var fieldset = L.DomUtil.create('fieldset', 'uk-margin-top', form);
var endRowDiv = L.DomUtil.create('div', 'uk-form-row', fieldset);
_super.prototype.addLabelDiv.call(_this, endRowDiv, "End point date (UTC)", "See more information <a style='color:#faa732;' href='help/classic/?domain=" + domain.toLowerCase() + "#" + type + "-" + subtype + "-start' target='_blank'>here</a>");
var endDiv = L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', endRowDiv);
var endIcon = L.DomUtil.create('span', 'uk-icon-calendar', endDiv);
self.endDateInput = L.DomUtil.create('input', 'uk-width-1-2', endDiv);
self.endDateInput.type = 'text';
self.endDateInput.placeholder = self.dateFormat;
self.endTimeInput = L.DomUtil.create('input', 'uk-width-1-2', endDiv);
self.endTimeInput.type = 'text';
var positionButtonGrid = L.DomUtil.create('div', 'uk-grid uk-grid-small', positionDiv);
var drawDiv = L.DomUtil.create('div', 'uk-width-1-2', positionButtonGrid);
var drawButton = L.DomUtil.create('button', 'uk-button uk-button-small uk-align-left uk-margin-remove', drawDiv);
drawButton.textContent = 'Free hand draw';
self.endDateInput.onchange = function (evt) {
var date = moment.utc(self.endDateInput.value + ' ' + self.endTimeInput.value, self.datetimeFormat);
self.to = date.clone();
self.setTimeIncrement() && self.setTime() && self.updateTrajectoryLabelTimeValues();
};
self.endTimeInput.onchange = function (evt) {
var date = moment.utc(self.endDateInput.value + ' ' + self.endTimeInput.value, self.datetimeFormat);
self.to = date.clone();
self.setTimeIncrement() && self.setTime() && self.updateTrajectoryLabelTimeValues();
};
positionDiv.guideFn = function () {
var geojson = {};
geojson["type"] = "FeatureCollection";
......@@ -422,7 +444,7 @@ var EXTrajectory = (function (_super) {
_this.lineHandler.type = 'draw' + id;
map.on('zoomend', function () {
if (self.map.hasLayer(self.trajectoryLabelLayer)) {
self.updateTrajectoryLabelLayer();
self.updateTrajectoryLabelVisibility();
}
});
map.on('draw:created', function (e) {
......@@ -432,11 +454,8 @@ var EXTrajectory = (function (_super) {
if ((trajlinefeature.geometry) && (trajlinefeature.geometry.coordinates.length > 2)) {
self.trajlength = trajlinefeature.geometry.coordinates.length;
self.setTimeIncrement() && self.setTime();
console.log(self.trajlength);
console.log(self.time.length);
console.log(self.timeIncrement);
self.trajectoryLayer.addData(trajlinefeature);
var trajpointjson = STWkit.featurecollection();
self.trajpointfeaturecollection = STWkit.featurecollection();
for (var i = 0; i < self.time.length; i++) {
var trajpointfeature = STWkit.createFeature("Point");
trajpointfeature.geometry.coordinates = trajlinefeature.geometry.coordinates[i];
......@@ -445,10 +464,10 @@ var EXTrajectory = (function (_super) {
trajpointfeature.properties.start = true;
if (i == self.time.length - 1)
trajpointfeature.properties.end = true;
trajpointjson.features.push(trajpointfeature);
self.trajpointfeaturecollection.features.push(trajpointfeature);
}
self.trajectoryLabelLayer.addData(trajpointjson);
self.updateTrajectoryLabelLayer();
self.trajectoryLabelLayer.addData(self.trajpointfeaturecollection);
self.updateTrajectoryLabelVisibility();
}
var toggleevt = document.createEvent("CustomEvent");
toggleevt.initCustomEvent('container:toggleVisibility', false, false, {
......@@ -545,6 +564,8 @@ var EXTrajectory = (function (_super) {
(self.oncallback && self.oncallback(true));
};
UIkit.ready(function () {
var endDatePicker = UIkit.datepicker(self.endDateInput, { format: self.dateFormat });
var endTimePicker = UIkit.timepicker(self.endTimeInput, {});
self.defaults();
});
return _this;
......@@ -554,7 +575,11 @@ var EXTrajectory = (function (_super) {
if ((typeof changeCard.from !== 'undefined') && (typeof changeCard.to !== 'undefined')) {
self.from = changeCard.from.clone();
self.to = changeCard.to.clone();
self.setTimeIncrement() && self.setTime() && self.updateTrajectoryLabelLayer();
if (self.endDateInput) {
self.endDateInput.value = self.to.format(self.dateFormat);
self.endTimeInput.value = self.to.startOf('hour').format(self.timeFormat);
}
self.setTimeIncrement() && self.setTime() && self.updateTrajectoryLabelTimeValues();
}
};
EXTrajectory.prototype.setTimeIncrement = function () {
......@@ -581,7 +606,16 @@ var EXTrajectory = (function (_super) {
}
return false;
};
EXTrajectory.prototype.updateTrajectoryLabelLayer = function () {
EXTrajectory.prototype.updateTrajectoryLabelTimeValues = function () {
var self = this;
self.trajMarkerArray = [];
self.trajectoryLabelLayer.clearLayers();
for (var i = 0; i < self.time.length; i++)
self.trajpointfeaturecollection.features[i].properties.time = self.time[i];
self.trajectoryLabelLayer.addData(self.trajpointfeaturecollection);
self.updateTrajectoryLabelVisibility();
};
EXTrajectory.prototype.updateTrajectoryLabelVisibility = function () {
var self = this;
if (self.trajMarkerArray.length > 2) {
var occupied = new Array();
......
This diff is collapsed.
......@@ -420,10 +420,15 @@ class EXTrajectory extends STWkit.AccordionCard {
private from: any;
private to: any;
private trajlength: number;
private trajpointfeaturecollection: any;
private timeIncrement: number; // minutes
public nextButton: any;
endDateInput: HTMLInputElement;
endTimeInput: HTMLInputElement;
dateFormat: string;
timeFormat: string;
constructor(id, parentDiv, lang, langData, map, type, initials) {
constructor(id, parentDiv, lang, langData, map, domain, type, subtype, initials) {
var trajectoryDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1 uk-margin-top', parentDiv);
super(id, 'Trajectory', parentDiv, trajectoryDiv);
var self = this;
......@@ -439,18 +444,46 @@ class EXTrajectory extends STWkit.AccordionCard {
var key = e.charCode || e.keyCode || 0;
if (key == 13) e.preventDefault();
};
self.dateFormat = 'YYYY-MM-DD';
self.timeFormat = 'HH:mm';
self.positions = [];
var positionLabelGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-margin-top', form);
var positionlabelDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-1', positionLabelGrid);
super.addLabelDiv(positionlabelDiv, "Position", "See more information <a style='color:#faa732;' href='help/classic/#" + type + "-" + initials + "-position' target='_blank'>here</a>");
var positionDiv: any = <HTMLDivElement>L.DomUtil.create('div', '', form);
positionDiv.id = 'guide' + initials + 'pos';
var fieldset = <HTMLFieldSetElement>L.DomUtil.create('fieldset', 'uk-margin-top', form);
var endRowDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-row', fieldset);
super.addLabelDiv(endRowDiv, "End point date (UTC)", "See more information <a style='color:#faa732;' href='help/classic/?domain=" + domain.toLowerCase() + "#" + type + "-" + subtype + "-start' target='_blank'>here</a>");
var endDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-form-controls uk-form-icon uk-width-1-1', endRowDiv);
var endIcon = <HTMLSpanElement>L.DomUtil.create('span', 'uk-icon-calendar', endDiv);
self.endDateInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-2', endDiv);
self.endDateInput.type = 'text';
self.endDateInput.placeholder = self.dateFormat;
self.endTimeInput = <HTMLInputElement>L.DomUtil.create('input', 'uk-width-1-2', endDiv);
self.endTimeInput.type = 'text';
var positionButtonGrid = <HTMLDivElement>L.DomUtil.create('div', 'uk-grid uk-grid-small', positionDiv);
var drawDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-width-1-2', positionButtonGrid);
var drawButton = <HTMLButtonElement>L.DomUtil.create('button', 'uk-button uk-button-small uk-align-left uk-margin-remove', drawDiv);
drawButton.textContent = 'Free hand draw';
self.endDateInput.onchange = function (evt) {
var date = moment.utc(self.endDateInput.value + ' ' + self.endTimeInput.value, self.datetimeFormat);
self.to = date.clone();
self.setTimeIncrement() && self.setTime() && self.updateTrajectoryLabelTimeValues();
};
self.endTimeInput.onchange = function (evt) {
var date = moment.utc(self.endDateInput.value + ' ' + self.endTimeInput.value, self.datetimeFormat);
self.to = date.clone();
self.setTimeIncrement() && self.setTime() && self.updateTrajectoryLabelTimeValues();
};
positionDiv.guideFn = function () {
var geojson = {};
geojson["type"] = "FeatureCollection";
......@@ -490,7 +523,7 @@ class EXTrajectory extends STWkit.AccordionCard {
map.on('zoomend', function () {
if (self.map.hasLayer(self.trajectoryLabelLayer)) {
self.updateTrajectoryLabelLayer();
self.updateTrajectoryLabelVisibility();
}
});
......@@ -503,17 +536,18 @@ class EXTrajectory extends STWkit.AccordionCard {
self.trajlength = trajlinefeature.geometry.coordinates.length;
self.setTimeIncrement() && self.setTime();
self.trajectoryLayer.addData(trajlinefeature);
var trajpointjson: any = STWkit.featurecollection();
self.trajpointfeaturecollection = STWkit.featurecollection();
for (var i = 0; i < self.time.length; i++) {
var trajpointfeature: any = STWkit.createFeature("Point");
trajpointfeature.geometry.coordinates = trajlinefeature.geometry.coordinates[i];
trajpointfeature.properties.time = self.time[i];
if (i == 0) trajpointfeature.properties.start = true;
if (i == self.time.length - 1) trajpointfeature.properties.end = true;
trajpointjson.features.push(trajpointfeature);
self.trajpointfeaturecollection.features.push(trajpointfeature);
}
self.trajectoryLabelLayer.addData(trajpointjson);
self.updateTrajectoryLabelLayer();
self.trajectoryLabelLayer.addData(self.trajpointfeaturecollection);
self.updateTrajectoryLabelVisibility();
}
var toggleevt = document.createEvent("CustomEvent");
......@@ -621,6 +655,9 @@ class EXTrajectory extends STWkit.AccordionCard {
};
UIkit.ready(function () {
var endDatePicker = UIkit.datepicker(<any>self.endDateInput, {format: self.dateFormat });
var endTimePicker = UIkit.timepicker(<any>self.endTimeInput, {});
self.defaults();
});
}
......@@ -630,7 +667,11 @@ class EXTrajectory extends STWkit.AccordionCard {
if ((typeof changeCard.from !== 'undefined') && (typeof changeCard.to !== 'undefined')) {
self.from = changeCard.from.clone();
self.to = changeCard.to.clone();
self.setTimeIncrement() && self.setTime() && self.updateTrajectoryLabelLayer();
if (self.endDateInput) {
self.endDateInput.value = self.to.format(self.dateFormat);
self.endTimeInput.value = self.to.startOf('hour').format(self.timeFormat);
}
self.setTimeIncrement() && self.setTime() && self.updateTrajectoryLabelTimeValues();
}
}
......@@ -660,7 +701,18 @@ class EXTrajectory extends STWkit.AccordionCard {
return false;
}
private updateTrajectoryLabelLayer() {
private updateTrajectoryLabelTimeValues() {
var self = this;
self.trajMarkerArray = [];
self.trajectoryLabelLayer.clearLayers();
for (var i = 0; i < self.time.length; i++)
self.trajpointfeaturecollection.features[i].properties.time = self.time[i];
self.trajectoryLabelLayer.addData(self.trajpointfeaturecollection);
self.updateTrajectoryLabelVisibility();
}
private updateTrajectoryLabelVisibility() {
var self = this;
if (self.trajMarkerArray.length > 2) {
var occupied = new Array();
......
......@@ -23,6 +23,10 @@ var L;
__extends(Exercise, _super);
function Exercise(options) {
var _this = _super.call(this, options) || this;
_this.domain = "HELCOM";
if (options.domain) {
_this.domain = options.domain;
}
_this.type = 'exercise';
_this.subtype = 'instant';
_this.name = 'exercise';
......@@ -39,7 +43,7 @@ var L;
this.accordionDiv = L.DomUtil.create('div', 'uk-accordion', this.container);
var locationid = self.initials + 'locationCard';
self.cardMap[locationid] = new EXLocation(locationid, this.accordionDiv, self.lang, self.langData, map, self.forcing, self.obs, self.type, self.subtype, self.initials);
// self.cardMap[locationid].show();
self.cardMap[locationid].show();
var periodid = self.initials + 'periodCard';
var periodoptions = {};
periodoptions['type'] = this.type;
......@@ -56,13 +60,13 @@ var L;
self.cardMap[amountid] = new EXAmount(amountid, this.accordionDiv, self.lang, map, self.type, self.initials);
this.cardMap[locationid].addChangeFnListener(this.cardMap[periodid]);
var trajectoryid = self.initials + 'trajectoryCard';
self.cardMap[trajectoryid] = new EXTrajectory(trajectoryid, this.accordionDiv, self.lang, self.langData, map, self.type, self.initials);
self.cardMap[trajectoryid] = new EXTrajectory(trajectoryid, this.accordionDiv, self.lang, self.langData, map, self.domain, self.type, self.subtype, self.initials);
this.cardMap[periodid].addChangeFnListener(this.cardMap[trajectoryid]);
self.cardMap[trajectoryid].show(); // comment out
// self.cardMap[trajectoryid].show(); // comment out
_super.prototype.setup.call(this, map);
var chain = [];
// chain[locationid] = periodid;
chain[trajectoryid] = periodid; // comment out
chain[locationid] = periodid;
// chain[trajectoryid] = periodid; // comment out
chain[periodid] = oiltypeid;
chain[oiltypeid] = amountid;
chain[amountid] = trajectoryid;
......
{"version":3,"file":"leaflet-exercise-control.js","sourceRoot":"","sources":["leaflet-exercise-control.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,yCAAyC;AACzC,yCAAyC;AACzC,wCAAwC;AACxC,wCAAwC;AACxC,yCAAyC;AACzC,kDAAkD;;;;;;;;;;;AAKlD,IAAO,CAAC,CAgGP;AAhGD,WAAO,CAAC;IAAC,IAAA,OAAO,CAgGf;IAhGQ,WAAA,OAAO;QACZ;YAA8B,4BAAkB;YAgB5C,kBAAY,OAAO;gBAAnB,YACI,kBAAM,OAAO,CAAC,SASjB;gBARG,KAAI,CAAC,IAAI,GAAG,UAAU,CAAC;gBACvB,KAAI,CAAC,OAAO,GAAG,SAAS,CAAC;gBACzB,KAAI,CAAC,IAAI,GAAG,UAAU,CAAC;gBACvB,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;gBACrB,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;oBAChB,KAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAA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U,GAAG,UAAC,MAAM;oBAC3C,iBAAM,QAAQ,aAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;gBAChD,CAAC,CAAC;YAEN,CAAC;YAEM,wBAAK,GAAZ,UAAa,IAAI;gBACb,iBAAM,KAAK,YAAC,IAAI,CAAC,CAAC;YACtB,CAAC;YAEO,wBAAK,GAAb;gBACI,iBAAM,KAAK,WAAE,CAAC;YAClB,CAAC;YACO,uBAAI,GAAZ;YACA,CAAC;YACO,uBAAI,GAAZ;YACA,CAAC;YAEL,eAAC;QAAD,CAAC,AA9FD,CAA8B,MAAM,CAAC,WAAW,GA8F/C;QA9FY,gBAAQ,WA8FpB,CAAA;IACL,CAAC,EAhGQ,OAAO,GAAP,SAAO,KAAP,SAAO,QAgGf;AAAD,CAAC,EAhGM,CAAC,KAAD,CAAC,QAgGP"}
\ No newline at end of file
{"version":3,"file":"leaflet-exercise-control.js","sourceRoot":"","sources":["leaflet-exercise-control.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,yCAAyC;AACzC,yCAAyC;AACzC,wCAAwC;AACxC,wCAAwC;AACxC,yCAAyC;AACzC,kDAAkD;;;;;;;;;;;AAKlD,IAAO,CAAC,CAuGP;AAvGD,WAAO,CAAC;IAAC,IAAA,OAAO,CAuGf;IAvGQ,WAAA,OAAO;QACZ;YAA8B,4BAAkB;YAgB5C,kBAAY,OAAO;gBAAnB,YACI,kBAAM,OAAO,CAAC,SAcjB;gBAbG,KAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;gBACvB,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;oBACjB,KAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;gBACjC,CAAC;gBAED,KAAI,CAAC,IAAI,GAAG,UAAU,CAAC;gBACvB,KAAI,CAAC,OAAO,GAAG,SAAS,CAAC;gBACzB,KAAI,CAAC,IAAI,GAAG,UAAU,CAAC;gBACvB,KAAI,CAAC,QAA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AAG,UAAC,MAAM;oBACvC,iBAAM,QAAQ,aAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAC5C,CAAC,CAAC;gBACF,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,UAAU,GAAG,UAAC,MAAM;oBAC3C,iBAAM,QAAQ,aAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;gBAChD,CAAC,CAAC;YAIN,CAAC;YAEM,wBAAK,GAAZ,UAAa,IAAI;gBACb,iBAAM,KAAK,YAAC,IAAI,CAAC,CAAC;YACtB,CAAC;YAEO,wBAAK,GAAb;gBACI,iBAAM,KAAK,WAAE,CAAC;YAClB,CAAC;YACO,uBAAI,GAAZ;YACA,CAAC;YACO,uBAAI,GAAZ;YACA,CAAC;YAEL,eAAC;QAAD,CAAC,AArGD,CAA8B,MAAM,CAAC,WAAW,GAqG/C;QArGY,gBAAQ,WAqGpB,CAAA;IACL,CAAC,EAvGQ,OAAO,GAAP,SAAO,KAAP,SAAO,QAuGf;AAAD,CAAC,EAvGM,CAAC,KAAD,CAAC,QAuGP"}
\ No newline at end of file
......@@ -28,6 +28,11 @@ module L.Control {
constructor(options) {
super(options);
this.domain = "HELCOM";
if (options.domain) {
this.domain = options.domain;
}
this.type = 'exercise';
this.subtype = 'instant';
this.name = 'exercise';
......@@ -44,7 +49,7 @@ module L.Control {
this.accordionDiv = <HTMLDivElement>L.DomUtil.create('div', 'uk-accordion', this.container);
var locationid = self.initials+'locationCard';
self.cardMap[locationid] = new EXLocation(locationid, this.accordionDiv, self.lang, self.langData, map, self.forcing, self.obs, self.type, self.subtype, self.initials);
// self.cardMap[locationid].show();
self.cardMap[locationid].show();
var periodid = self.initials+'periodCard';
var periodoptions = {};
periodoptions['type'] = this.type;
......@@ -62,13 +67,13 @@ module L.Control {
this.cardMap[locationid].addChangeFnListener(this.cardMap[periodid]);
var trajectoryid = self.initials+'trajectoryCard';
self.cardMap[trajectoryid] = new EXTrajectory(trajectoryid, this.accordionDiv, self.lang, self.langData, map, self.type, self.initials);
self.cardMap[trajectoryid] = new EXTrajectory(trajectoryid, this.accordionDiv, self.lang, self.langData, map, self.domain, self.type, self.subtype, self.initials);
this.cardMap[periodid].addChangeFnListener(this.cardMap[trajectoryid]);
self.cardMap[trajectoryid].show(); // comment out
// self.cardMap[trajectoryid].show(); // comment out
super.setup(map);
var chain = [];
// chain[locationid] = periodid;
chain[trajectoryid] = periodid; // comment out
chain[locationid] = periodid;
// chain[trajectoryid] = periodid; // comment out
chain[periodid] = oiltypeid;
chain[oiltypeid] = amountid;
......@@ -90,6 +95,8 @@ module L.Control {
super.callback(chain, trajectoryid, gonext);
};
}
public ready(name) {
......
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