diff --git a/client/API.md b/client/API.md index aa8b88f6..5a4926e9 100644 --- a/client/API.md +++ b/client/API.md @@ -588,6 +588,7 @@ their `idx` property. * `icon` (string): Symbol key of the result * `type` (string): Type of the result * `id` (string): If the result is an OSM object, the ID of the OSM object, prefixed by `n` (node), `w` (way) or `r` (relation) +* `ele` (number): Elevation in meters ### route diff --git a/frontend/app/map/lines/edit-line.html b/frontend/app/map/lines/edit-line.html index 56df6d1d..8a41004a 100644 --- a/frontend/app/map/lines/edit-line.html +++ b/frontend/app/map/lines/edit-line.html @@ -44,7 +44,7 @@
diff --git a/frontend/app/map/lines/lines.js b/frontend/app/map/lines/lines.js index e1c3add8..aae883de 100644 --- a/frontend/app/map/lines/lines.js +++ b/frontend/app/map/lines/lines.js @@ -111,6 +111,11 @@ fm.app.factory("fmMapLines", function(fmUtils, $uibModal, $compile, $timeout, $r }, _deleteLine: function(line) { if(line.id != null && openLine && line.id == openLine.id) { + if(openLineHighlight) { + openLineHighlight.remove(); + openLineHighlight = null; + } + openLine.hide(); openLine = null; } @@ -145,10 +150,13 @@ fm.app.factory("fmMapLines", function(fmUtils, $uibModal, $compile, $timeout, $r openLine = { hide: map.infoBox.show(template, scope, () => { openLine = null; - linesById[line.id].remove(); - linesById[line.id].options.pane = "overlayPane"; - linesById[line.id].addTo(map.map); - openLineHighlight.remove(); + if(linesById[line.id]) { // Does not exist anymore after line was deleted + linesById[line.id].remove(); + linesById[line.id].options.pane = "overlayPane"; + linesById[line.id].addTo(map.map); + } + if(openLineHighlight) + openLineHighlight.remove(); }).hide, id: line.id }; @@ -169,19 +177,21 @@ fm.app.factory("fmMapLines", function(fmUtils, $uibModal, $compile, $timeout, $r elevationPlot.clear(); scope.$watch("line.trackPoints", (trackPoints) => { - let latlngs = []; + elevationPlot.clear(); + if(line.trackPoints) { + let latlngs = []; for(let i=0; i {} // Otherwise a new event handler gets added every single time we add a line, and is never cleared - }); + elevationPlot.addData({ + _latlngs: latlngs + }, { + on: () => {} // Otherwise a new event handler gets added every single time we add a line, and is never cleared + }); + } }, true); let drawElevationPlot = () => { @@ -386,7 +396,7 @@ fm.app.factory("fmMapLines", function(fmUtils, $uibModal, $compile, $timeout, $r // We have to wait until the server sends us the trackPoints of the line var removeWatcher = $rootScope.$watch(function() { return !!linesById[line.id]; }, function(exists) { if(exists) { - linesUi.showLineInfoBox(line); + linesUi.showLineInfoBox(map.client.lines[line.id]); removeWatcher(); } }); diff --git a/frontend/app/map/markers/edit-marker.html b/frontend/app/map/markers/edit-marker.html index ae268d59..00e1e15e 100644 --- a/frontend/app/map/markers/edit-marker.html +++ b/frontend/app/map/markers/edit-marker.html @@ -38,7 +38,7 @@
diff --git a/frontend/app/search/result-popup.html b/frontend/app/search/result-popup.html index efa3c8e9..30a011f1 100644 --- a/frontend/app/search/result-popup.html +++ b/frontend/app/search/result-popup.html @@ -16,14 +16,14 @@
{{filteredTypes = (result.isMarker && result.isLine ? client.types : (client.types | fmObjectFilter:{type:result.isMarker ? 'marker' : 'line'})); ""}}
- +
- +
- +