Add changelog and time spent on route to the popup

This commit is contained in:
Eugene Burmakin 2024-05-30 11:56:04 +02:00
parent 5e4e686492
commit e235ff66b0
3 changed files with 15 additions and 2 deletions

View file

@ -1 +1 @@
0.4.2
0.4.3

View file

@ -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

View file

@ -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}<br>Route ended: ${lastTimestamp}`;
var popupContent = `Route started: ${firstTimestamp}<br>Route ended: ${lastTimestamp}<br>Time en route: ${timeOnRoute} minutes`;
addHighlightOnHover(polyline, map, popupContent);