src/Services/Geocoding/GeocoderProvider.php
protected function buildGeocoderGeometry(\stdClass $geocoderGeometry)
    {
        $location = new Coordinate(
            $geocoderGeometry->location->lat,
            $geocoderGeometry->location->lng
        );

        $locationType = $geocoderGeometry->location_type;

        $viewport = new Bound(
            new Coordinate($geocoderGeometry->viewport->southwest->lat, $geocoderGeometry->viewport->southwest->lng),
            new Coordinate($geocoderGeometry->viewport->northeast->lat, $geocoderGeometry->viewport->northeast->lng)
        );

        $bound = null;
        if (isset($geocoderGeometry->bounds)) {
            $bound = new Bound(
                new Coordinate($geocoderGeometry->bounds->southwest->lat, $geocoderGeometry->bounds->southwest->lng),
                new Coordinate($geocoderGeometry->bounds->northeast->lat, $geocoderGeometry->bounds->northeast->lng)
            );
        }

        return new GeocoderGeometry($location, $locationType, $viewport, $bound);
    }
protected function buildGeocoderGeometry(\stdClass $geocoderGeometry)
    {
        $location = new Coordinate(
            $geocoderGeometry->location->lat,
            $geocoderGeometry->location->lng
        );

        $locationType = $geocoderGeometry->location_type;

        $viewport = new Bound(
            new Coordinate($geocoderGeometry->viewport->southwest->lat, $geocoderGeometry->viewport->southwest->lng),
            new Coordinate($geocoderGeometry->viewport->northeast->lat, $geocoderGeometry->viewport->northeast->lng)
        );

        $bound = null;
        if (isset($geocoderGeometry->bounds)) {
            $bound = new Bound(
                new Coordinate($geocoderGeometry->bounds->southwest->lat, $geocoderGeometry->bounds->southwest->lng),
                new Coordinate($geocoderGeometry->bounds->northeast->lat, $geocoderGeometry->bounds->northeast->lng)
            );
        }

        return new GeocoderGeometry($location, $locationType, $viewport, $bound);
    }
Builds a geocoder geometry according to a normalized geocoding geometry.

@param \stdClass $geocoderGeometry The normalized geocoder geomety.

@return \Ivory\GoogleMap\Services\Geocoding\Result\GeocoderGeometry The builded geocoder geometry.