From 375a8774b7f81c80a7871d8a24779540ac96133f Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Wed, 15 Mar 2023 22:48:41 +0000 Subject: [PATCH] Remove markers, fade out polyline --- resources/views/tracker.blade.php | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 1d57c0b..c9d1f93 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -59,22 +59,24 @@ attribution: 'OpenStreetMap' }).addTo(map); - /* - * Populate the route line. - */ - var routePoints = L.polyline([ - @foreach($trip->locations as $location) - @if(!in_array($location->id, config('app.current_trip_ignore'))) - [{{ $location->latitude }}, {{ $location->longitude }}], // {{$location->id}} - @endif - @endforeach - ], { - color: '#3d3d3d' - }).addTo(map); + @for($idx = 0; $idx <= count($trip->locations); $idx += 100) + /* + * Populate the route line. + */ + 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}} + @endif + @endforeach + ], { + color: 'rgba(62, 62, 62, {{ ( $idx - (-50) ) / (count($trip->locations) - (-50)) }})' + }).addTo(map); + @endfor /* * Populate all the checkins and popup texts. - */ + * var checkinMarkers = []; var marker = null, popupMarkup = null; var markerIcon = L.icon({ @@ -122,7 +124,7 @@ checkinMarkers[{{ $checkin->id }}] = marker; @endforeach - + */ /* * Fit the map to the last 25 locations, and then zoom out * (to help provide context).