Display interpolated time in igc example
This commit is contained in:
@@ -85,7 +85,6 @@ var displaySnap = function(coordinate) {
|
||||
line = null;
|
||||
info.innerHTML = ' ';
|
||||
} else {
|
||||
info.innerHTML = closestFeature.get('PLT');
|
||||
var geometry = closestFeature.getGeometry();
|
||||
var closestPoint = geometry.getClosestPoint(coordinate);
|
||||
if (point === null) {
|
||||
@@ -93,10 +92,14 @@ var displaySnap = function(coordinate) {
|
||||
} else {
|
||||
point.setCoordinates(closestPoint);
|
||||
}
|
||||
var date = new Date(closestPoint[2] * 1000);
|
||||
info.innerHTML =
|
||||
closestFeature.get('PLT') + ' (' + date.toUTCString() + ')';
|
||||
var coordinates = [coordinate, [closestPoint[0], closestPoint[1]]];
|
||||
if (line === null) {
|
||||
line = new ol.geom.LineString([coordinate, closestPoint]);
|
||||
line = new ol.geom.LineString(coordinates);
|
||||
} else {
|
||||
line.setCoordinates([coordinate, closestPoint]);
|
||||
line.setCoordinates(coordinates);
|
||||
}
|
||||
}
|
||||
map.requestRenderFrame();
|
||||
|
||||
Reference in New Issue
Block a user