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 ); }