fix recency fadeout

This commit is contained in:
Ben Goldsworthy 2023-03-19 17:34:19 +00:00
parent 375a8774b7
commit fed8dab57c

View file

@ -66,11 +66,14 @@
L.polyline([ L.polyline([
@foreach(array_slice($trip->locations, $idx, 100) as $location) @foreach(array_slice($trip->locations, $idx, 100) as $location)
@if(!in_array($location->id, config('app.current_trip_ignore'))) @if(!in_array($location->id, config('app.current_trip_ignore')))
[{{ $location->latitude }}, {{ $location->longitude }}], // {{$location->id}} [{{ $location->latitude }}, {{ $location->longitude }}],
@endif @endif
@endforeach @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); }).addTo(map);
@endfor @endfor