diff --git a/app/javascript/controllers/maps_controller.js b/app/javascript/controllers/maps_controller.js
index 4e79a85a..aaa29716 100644
--- a/app/javascript/controllers/maps_controller.js
+++ b/app/javascript/controllers/maps_controller.js
@@ -186,12 +186,12 @@ console.log(selectedLayerName);
}
return `
- Timestamp: ${formatDate(marker[4], timezone)}
- Latitude: ${marker[0]}
- Longitude: ${marker[1]}
- Altitude: ${marker[3]}m
- Velocity: ${marker[5]}km/h
- Battery: ${marker[2]}%
+ Timestamp: ${formatDate(marker[4], timezone)}
+ Latitude: ${marker[0]}
+ Longitude: ${marker[1]}
+ Altitude: ${marker[3]}m
+ Velocity: ${marker[5]}km/h
+ Battery: ${marker[2]}%
[Delete]
`;
}
@@ -347,10 +347,10 @@ console.log(selectedLayerName);
const isDebugMode = getUrlParameter("debug") === "true";
let popupContent = `
- Start: ${firstTimestamp}
- End: ${lastTimestamp}
- Duration: ${timeOnRoute}
- Total Distance: ${formatDistance(totalDistance, this.distanceUnit)}
+ Start: ${firstTimestamp}
+ End: ${lastTimestamp}
+ Duration: ${timeOnRoute}
+ Total Distance: ${formatDistance(totalDistance, this.distanceUnit)}
`;
if (isDebugMode) {
@@ -364,9 +364,9 @@ console.log(selectedLayerName);
const pointsNumber = polylineCoordinates.length;
popupContent += `
- Prev Route: ${Math.round(distanceToPrev)}m and ${minutesToDaysHoursMinutes(timeBetweenPrev)} away
- Next Route: ${Math.round(distanceToNext)}m and ${minutesToDaysHoursMinutes(timeBetweenNext)} away
- Points: ${pointsNumber}
+ Prev Route: ${Math.round(distanceToPrev)}m and ${minutesToDaysHoursMinutes(timeBetweenPrev)} away
+ Next Route: ${Math.round(distanceToNext)}m and ${minutesToDaysHoursMinutes(timeBetweenNext)} away
+ Points: ${pointsNumber}
`;
}
diff --git a/app/services/points_reduce.rb b/app/services/points_reduce.rb
index 68f3ff46..94067123 100644
--- a/app/services/points_reduce.rb
+++ b/app/services/points_reduce.rb
@@ -1,6 +1,13 @@
# frozen_string_literal: true
class PointsReduce
+ # 1. On the route popup, the user can click on a button to simplify the route.
+ # 2. Request to the server to simplify the route.
+ # 3. Server returns simplified route.
+ # 4. Render the simplified route on the map.
+ # 5. If the user is happy with the simplified route, they can save it.
+ # 6. Request to the server to save the simplified route. This is a destructive action and erases unnecessary points.
+
DISTANCE_THRESHOLD = 50 # meters
TIME_THRESHOLD = 10 # seconds