From fbd55c7718bd40dfbc461ddd6e99adecc857335e Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sun, 9 Jun 2024 15:02:19 +0200 Subject: [PATCH] add breaks to routes --- config/app.php | 2 ++ resources/views/tracker.blade.php | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/config/app.php b/config/app.php index 8023908..41a0865 100644 --- a/config/app.php +++ b/config/app.php @@ -72,6 +72,8 @@ return [ 'current_trip_ignore' => explode(',', env('CURRENT_TRIP_IGNORE')), + 'current_trip_break_locations' => explode(',', env('CURRENT_TRIP_BREAK_LOCATIONS')), + 'past_trip_ids' => explode(',', env('PAST_TRIP_IDS')), /* diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 16bce10..0985cdd 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -67,6 +67,16 @@ @if(!in_array($location->id, config('app.current_trip_ignore'))) [{{ $location->latitude }}, {{ $location->longitude }}], @endif + + @if(in_array($location->id, config('app.current_trip_break_locations'))) + ], { + @php $colour = 180 * ( 1.0 - ( ( $idx - 99 ) / ( count($trip->locations) ) ) ); @endphp + color: 'rgb({{ $colour }}, {{ $colour }}, {{ $colour }})', + weight: 5, + }).addTo(map); + + L.polyline([ + @endif @endforeach ], { @php $colour = 180 * ( 1.0 - ( ( $idx ) / ( count($trip->locations) ) ) ); @endphp