From e235ff66b0046c311a275fa2de3cae54625be680 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Thu, 30 May 2024 11:56:04 +0200 Subject: [PATCH] Add changelog and time spent on route to the popup --- .app_version | 2 +- CHANGELOG.md | 12 ++++++++++++ app/javascript/controllers/maps_controller.js | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.app_version b/.app_version index 2b7c5ae0..17b2ccd9 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.4.2 +0.4.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index cfd994dc..f93f90b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.4.3] — 2024-05-30 + +### Added + +- Now user can hover on route and see when it started, when it ended and how much time it took to travel + +### Fixed + +- Timestamps in export form are now correctly assigned from the first and last points tracked by the user + +--- + ## [0.4.2] — 2024-05-29 ### Changed diff --git a/app/javascript/controllers/maps_controller.js b/app/javascript/controllers/maps_controller.js index ec794aea..7bc91913 100644 --- a/app/javascript/controllers/maps_controller.js +++ b/app/javascript/controllers/maps_controller.js @@ -94,9 +94,10 @@ export default class extends Controller { // Get the timestamps of the first and last points var firstTimestamp = this.formatDate(polylineCoordinates[0][4]); var lastTimestamp = this.formatDate(polylineCoordinates[polylineCoordinates.length - 1][4]) + var timeOnRoute = Math.round((polylineCoordinates[polylineCoordinates.length - 1][4] - polylineCoordinates[0][4]) / 60); // Time in minutes // Create the popup content - var popupContent = `Route started: ${firstTimestamp}
Route ended: ${lastTimestamp}`; + var popupContent = `Route started: ${firstTimestamp}
Route ended: ${lastTimestamp}
Time en route: ${timeOnRoute} minutes`; addHighlightOnHover(polyline, map, popupContent);