diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 3151d42..b990cc7 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -1342,6 +1342,7 @@ sub map_history { with_polyline => $with_polyline, after => $filter_from, before => $filter_until, + verbose => 1 ); if ($filter_type) { @@ -1357,12 +1358,19 @@ sub map_history { skipped_journeys => [], station_coordinates => [], polyline_groups => [], + distance_traveled => 0, ); return; } my $include_manual = $self->param('include_manual') ? 1 : 0; + my $total_distance = 0; + + for my $journey (@journeys) { + $total_distance += $journey->{km_route} // 0; + } + my $res = $self->journeys_to_map_data( journeys => \@journeys, route_type => $route_type, @@ -1374,6 +1382,7 @@ sub map_history { year => $year, with_map => 1, title => 'travelynx: Karte', + total_distance => $total_distance, %{$res} ); } diff --git a/templates/history_map.html.ep b/templates/history_map.html.ep index 57ba81f..3232b4c 100644 --- a/templates/history_map.html.ep +++ b/templates/history_map.html.ep @@ -33,6 +33,9 @@ %= include '_map', station_coordinates => $station_coordinates, polyline_groups => $polyline_groups %= form_for '/history/map' => begin +
+ Gesamtdistanz: <%= sprintf("%.2f", $total_distance // 0) %> km +
Detailgrad: