feat: multiple privacy zones
This commit is contained in:
parent
cca7284d9d
commit
6d716a242b
1 changed files with 14 additions and 12 deletions
|
@ -66,18 +66,20 @@
|
||||||
@if(!in_array($location->id, config('app.current_trip_ignore')))
|
@if(!in_array($location->id, config('app.current_trip_ignore')))
|
||||||
|
|
||||||
@php
|
@php
|
||||||
// Privacy zones
|
// Privacy zones
|
||||||
$privacyLatLons = config('app.privacy_lat_lons');
|
$privacyLatLons = config('app.privacy_lat_lons');
|
||||||
$latLon = explode(',', $privacyLatLons[0]);
|
foreach ($privacyLatLons as $latLonUnparsed) {
|
||||||
if (
|
$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 - $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);
|
$location->latitude = $location->latitude + ((rand(0,2)-1)/100);
|
||||||
}
|
$location->longitude = $location->longitude + ((rand(0,2)-1)/100);
|
||||||
|
}
|
||||||
|
}
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
[{{ $location->latitude }}, {{ $location->longitude }}],
|
[{{ $location->latitude }}, {{ $location->longitude }}],
|
||||||
|
|
Loading…
Reference in a new issue