Fix polyline decoding

This commit is contained in:
Ben Goldsworthy 2023-01-14 20:08:56 +00:00
parent c55d572ec4
commit 97b85e1380
2 changed files with 5 additions and 5 deletions

View file

@ -149,6 +149,8 @@ class TrackerController extends Controller
case 200:
$data = json_decode($response->getBody());
$data->trip->locations = $this->decode_polyline($data->trip->route);
// Cache the downloaded file if it does not exist locally.
if (Storage::disk('local')->missing($tripFileName)) {
Log::debug("Caching new trip file '{$tripFileName}'.");
@ -173,8 +175,6 @@ class TrackerController extends Controller
}
}
$data->trip->locations = $this->decode_polyline($data->trip->route);
return $data->trip;
default:
// TODO: Add proper error handling.