From cafebfedf9007fe5f07739de50d819c506c622d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Tobias=20de=20Freitas=20Neto?= Date: Tue, 26 Dec 2023 16:45:57 -0400 Subject: [PATCH] Viewport estava sendo retornado como object --- src/app/Services/GeocodingService.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/Services/GeocodingService.php b/src/app/Services/GeocodingService.php index 7fddb86..a473c47 100644 --- a/src/app/Services/GeocodingService.php +++ b/src/app/Services/GeocodingService.php @@ -37,8 +37,16 @@ class GeocodingService implements GeocodingServiceContract */ public function getCoordinatesForAddress(string $address): GeocodingResponseData { + $response = $this->geocoder->getCoordinatesForAddress($address); + + $viewport = array_key_exists('viewport', $response) + ? get_object_vars($response['viewport']) + : []; + + $response['viewport'] = $viewport; + return GeocodingResponseData::from( - $this->geocoder->getCoordinatesForAddress($address) + $response ); }