Remove markers, fade out polyline

This commit is contained in:
Ben Goldsworthy 2023-03-15 22:48:41 +00:00
parent e5a5ddffcd
commit 375a8774b7

View file

@ -59,22 +59,24 @@
attribution: 'OpenStreetMap' attribution: 'OpenStreetMap'
}).addTo(map); }).addTo(map);
/* @for($idx = 0; $idx <= count($trip->locations); $idx += 100)
* Populate the route line. /*
*/ * Populate the route line.
var routePoints = L.polyline([ */
@foreach($trip->locations as $location) L.polyline([
@if(!in_array($location->id, config('app.current_trip_ignore'))) @foreach(array_slice($trip->locations, $idx, 100) as $location)
[{{ $location->latitude }}, {{ $location->longitude }}], // {{$location->id}} @if(!in_array($location->id, config('app.current_trip_ignore')))
@endif [{{ $location->latitude }}, {{ $location->longitude }}], // {{$location->id}}
@endforeach @endif
], { @endforeach
color: '#3d3d3d' ], {
}).addTo(map); color: 'rgba(62, 62, 62, {{ ( $idx - (-50) ) / (count($trip->locations) - (-50)) }})'
}).addTo(map);
@endfor
/* /*
* Populate all the checkins and popup texts. * Populate all the checkins and popup texts.
*/ *
var checkinMarkers = []; var checkinMarkers = [];
var marker = null, popupMarkup = null; var marker = null, popupMarkup = null;
var markerIcon = L.icon({ var markerIcon = L.icon({
@ -122,7 +124,7 @@
checkinMarkers[{{ $checkin->id }}] = marker; checkinMarkers[{{ $checkin->id }}] = marker;
@endforeach @endforeach
*/
/* /*
* Fit the map to the last 25 locations, and then zoom out * Fit the map to the last 25 locations, and then zoom out
* (to help provide context). * (to help provide context).