mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Add changelog and time spent on route to the popup
This commit is contained in:
parent
5e4e686492
commit
e235ff66b0
3 changed files with 15 additions and 2 deletions
|
|
@ -1 +1 @@
|
||||||
0.4.2
|
0.4.3
|
||||||
|
|
|
||||||
12
CHANGELOG.md
12
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/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
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
|
## [0.4.2] — 2024-05-29
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
|
|
@ -94,9 +94,10 @@ export default class extends Controller {
|
||||||
// Get the timestamps of the first and last points
|
// Get the timestamps of the first and last points
|
||||||
var firstTimestamp = this.formatDate(polylineCoordinates[0][4]);
|
var firstTimestamp = this.formatDate(polylineCoordinates[0][4]);
|
||||||
var lastTimestamp = this.formatDate(polylineCoordinates[polylineCoordinates.length - 1][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
|
// 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);
|
addHighlightOnHover(polyline, map, popupContent);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue