Commit bcaa3321 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

first test

parent 774c0fbe
......@@ -127,14 +127,14 @@ app.get('/demo/availableTimes/ms/HELCOM_NEMO', function (req, res) {
);
});
app.post('/demo/startoo', function (req, res) {
app.post('/demo/startex', function (req, res) {
var result = {};
console.log(req.body.features[0].properties);
result["id"] = "uuid";
res.send(result);
});
app.get('/demo/guide/oo',
app.get('/demo/guide/ex',
function (req, res) {
res.send(
{
......
......@@ -52,6 +52,18 @@
width: 100px
}
.trajLabel {
position:absolute;
top: 28px;
left: 40px;
display: inline-block;
white-space: pre;
background: white;
color: black;
font-weight: bold;
}
.exercise-control .form-label {
display: inline-block;
padding-right: 5px;
......
This diff is collapsed.
......@@ -169,6 +169,7 @@ var EXLocation = (function (_super) {
"type": "MANUAL",
"date": moment.utc(self.obsDateInput.value + ' ' + self.obsTimeInput.value, self.datetimeFormat).valueOf()
};
geojson.features[0].properties["primary"] = 'PADM';
geojson.features[0].properties["observation"] = [];
geojson.features[0].properties["observation"].push(observation);
};
......@@ -422,8 +423,8 @@ var EXTrajectory = (function (_super) {
var type = e.layerType, layer = e.layer;
if (type == 'draw' + id) {
var trajlinefeature = layer.toGeoJSON();
self.trajectoryLayer.addData(trajlinefeature);
if ((trajlinefeature.geometry) && (trajlinefeature.geometry.coordinates.length == self.time.length)) {
self.trajectoryLayer.addData(trajlinefeature);
var trajpointjson = STWkit.featurecollection();
for (var i = 0; i < self.time.length; i++) {
var trajpointfeature = STWkit.createFeature("Point");
......@@ -543,8 +544,6 @@ var EXTrajectory = (function (_super) {
var from = changeCard.from;
var to = changeCard.to;
if (from.isBefore(to)) {
console.log(from.format('YYYY-MM-DD HH:mm'));
console.log(to.format('YYYY-MM-DD HH:mm'));
self.time = [];
self.time.push(from.valueOf());
var t = from;
......@@ -616,6 +615,17 @@ var EXTrajectory = (function (_super) {
};
EXTrajectory.prototype.populateData = function (geojson) {
var self = this;
var feature = STWkit.createFeature('LineString');
var props = feature.properties;
props['auxiliary'] = 'exercise';
props['time'] = self.time;
var coords = feature.geometry.coordinates;
var latlngs = self.getLatLngArray()[0];
for (var i = 0; i < latlngs.length; i++) {
var latlng = latlngs[i];
coords.push([latlng.lng, latlng.lat]);
}
geojson.features.push(feature);
};
EXTrajectory.prototype.clear = function () {
var self = this;
......
This diff is collapsed.
......@@ -183,6 +183,7 @@ class EXLocation extends STWkit.LocationCard {
"date": moment.utc(self.obsDateInput.value + ' ' + self.obsTimeInput.value, self.datetimeFormat).valueOf()
};
geojson.features[0].properties["primary"] = 'PADM';
geojson.features[0].properties["observation"] = [];
geojson.features[0].properties["observation"].push(observation);
}
......@@ -485,8 +486,8 @@ class EXTrajectory extends STWkit.AccordionCard {
layer = e.layer;
if (type == 'draw'+id) {
var trajlinefeature = layer.toGeoJSON();
self.trajectoryLayer.addData(trajlinefeature);
if ((trajlinefeature.geometry) && (trajlinefeature.geometry.coordinates.length == self.time.length)) {
self.trajectoryLayer.addData(trajlinefeature);
var trajpointjson: any = STWkit.featurecollection();
for (var i = 0; i < self.time.length; i++) {
var trajpointfeature: any = STWkit.createFeature("Point");
......@@ -615,8 +616,6 @@ class EXTrajectory extends STWkit.AccordionCard {
var from = changeCard.from;
var to = changeCard.to;
if (from.isBefore(to)) {
console.log(from.format('YYYY-MM-DD HH:mm'));
console.log(to.format('YYYY-MM-DD HH:mm'));
self.time = [];
self.time.push(from.valueOf());
var t = from;
......@@ -689,6 +688,18 @@ class EXTrajectory extends STWkit.AccordionCard {
public populateData(geojson) {
var self = this;
var feature = STWkit.createFeature('LineString');
var props = feature.properties;
props['auxiliary'] = 'exercise';
props['time'] = self.time;
var coords = feature.geometry.coordinates;
var latlngs:Array<L.LatLng> = self.getLatLngArray()[0];
for (let i = 0; i < latlngs.length; i++) {
const latlng = latlngs[i];
coords.push([latlng.lng, latlng.lat]);
}
geojson.features.push(feature);
}
......
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