feat: multiple privacy zones

This commit is contained in:
Ben Goldsworthy 2024-11-07 14:50:23 +01:00
parent cca7284d9d
commit 6d716a242b
Signed by: Rumperuu
SSH key fingerprint: SHA256:e5XfzNOr9UvWpEzyLfw0GtTMZWIFh3NmxH+/qQIi3xE

View file

@ -68,7 +68,8 @@
@php
// Privacy zones
$privacyLatLons = config('app.privacy_lat_lons');
$latLon = explode(',', $privacyLatLons[0]);
foreach ($privacyLatLons as $latLonUnparsed) {
$latLon = explode(',', $latLonUnparsed);
if (
!(
( $location->latitude - $latLon[0] > 0.01 ) || ( $location->latitude - $latLon[0] < -0.01 ) ||
@ -78,6 +79,7 @@
$location->latitude = $location->latitude + ((rand(0,2)-1)/100);
$location->longitude = $location->longitude + ((rand(0,2)-1)/100);
}
}
@endphp
[{{ $location->latitude }}, {{ $location->longitude }}],