From fed8dab57cf3631c79f14174643ba7914e732b54 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sun, 19 Mar 2023 17:34:19 +0000 Subject: [PATCH] fix recency fadeout --- resources/views/tracker.blade.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index c9d1f93..c7435a9 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -66,11 +66,14 @@ L.polyline([ @foreach(array_slice($trip->locations, $idx, 100) as $location) @if(!in_array($location->id, config('app.current_trip_ignore'))) - [{{ $location->latitude }}, {{ $location->longitude }}], // {{$location->id}} + [{{ $location->latitude }}, {{ $location->longitude }}], @endif @endforeach ], { - color: 'rgba(62, 62, 62, {{ ( $idx - (-50) ) / (count($trip->locations) - (-50)) }})' + @php $colour = 180 * ( 1.0 - ( ( $idx ) / ( count($trip->locations) ) ) ); @endphp + color: 'rgb({{ $colour }}, {{ $colour }}, {{ $colour }})', + weight: 5, + //color: 'rgba(62, 62, 62, {{ ( $idx - 0.5) / (count($trip->locations) - 0.5 ) }})' }).addTo(map); @endfor