diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index ae17123..750c365 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -66,18 +66,20 @@ @if(!in_array($location->id, config('app.current_trip_ignore'))) @php - // Privacy zones - $privacyLatLons = config('app.privacy_lat_lons'); - $latLon = explode(',', $privacyLatLons[0]); - if ( - !( - ( $location->latitude - $latLon[0] > 0.01 ) || ( $location->latitude - $latLon[0] < -0.01 ) || - ( $location->longitude - $latLon[1] > 0.01 ) || ( $location->longitude - $latLon[1] < -0.01 ) - ) - ) { - $location->latitude = $location->latitude + ((rand(0,2)-1)/100); - $location->longitude = $location->longitude + ((rand(0,2)-1)/100); - } + // Privacy zones + $privacyLatLons = config('app.privacy_lat_lons'); + foreach ($privacyLatLons as $latLonUnparsed) { + $latLon = explode(',', $latLonUnparsed); + if ( + !( + ( $location->latitude - $latLon[0] > 0.01 ) || ( $location->latitude - $latLon[0] < -0.01 ) || + ( $location->longitude - $latLon[1] > 0.01 ) || ( $location->longitude - $latLon[1] < -0.01 ) + ) + ) { + $location->latitude = $location->latitude + ((rand(0,2)-1)/100); + $location->longitude = $location->longitude + ((rand(0,2)-1)/100); + } + } @endphp [{{ $location->latitude }}, {{ $location->longitude }}],