private function parseCoordinates(AddressBuilder $builder, $result)
    {
        $coordinates = $result->geometry->location;
        $builder->setCoordinates($coordinates->lat, $coordinates->lng);

        if (isset($result->geometry->bounds)) {
            $builder->setBounds(
                $result->geometry->bounds->southwest->lat,
                $result->geometry->bounds->southwest->lng,
                $result->geometry->bounds->northeast->lat,
                $result->geometry->bounds->northeast->lng
            );
        } elseif (isset($result->geometry->viewport)) {
            $builder->setBounds(
                $result->geometry->viewport->southwest->lat,
                $result->geometry->viewport->southwest->lng,
                $result->geometry->viewport->northeast->lat,
                $result->geometry->viewport->northeast->lng
            );
        } elseif ('ROOFTOP' === $result->geometry->location_type) {
            // Fake bounds
            $builder->setBounds(
                $coordinates->lat,
                $coordinates->lng,
                $coordinates->lat,
                $coordinates->lng
            );
        }
    }
private function parseCoordinates(AddressBuilder $builder, $result)
    {
        $coordinates = $result->geometry->location;
        $builder->setCoordinates($coordinates->lat, $coordinates->lng);

        if (isset($result->geometry->bounds)) {
            $builder->setBounds(
                $result->geometry->bounds->southwest->lat,
                $result->geometry->bounds->southwest->lng,
                $result->geometry->bounds->northeast->lat,
                $result->geometry->bounds->northeast->lng
            );
        } elseif (isset($result->geometry->viewport)) {
            $builder->setBounds(
                $result->geometry->viewport->southwest->lat,
                $result->geometry->viewport->southwest->lng,
                $result->geometry->viewport->northeast->lat,
                $result->geometry->viewport->northeast->lng
            );
        } elseif ('ROOFTOP' === $result->geometry->location_type) {
            // Fake bounds
            $builder->setBounds(
                $coordinates->lat,
                $coordinates->lng,
                $coordinates->lat,
                $coordinates->lng
            );
        }
    }
private function parseCoordinates ( AddressBuilder $ builder , $ result ) { $ coordinates = $ result -> geometry -> location ; $ builder -> setCoordinates ( $ coordinates -> lat , $ coordinates -> lng ) ; if ( isset ( $ result -> geometry -> bounds ) ) { $ builder -> setBounds ( $ result -> geometry -> bounds -> southwest -> lat , $ result -> geometry -> bounds -> southwest -> lng , $ result -> geometry -> bounds -> northeast -> lat , $ result -> geometry -> bounds -> northeast -> lng ) ; } elseif ( isset ( $ result -> geometry -> viewport ) ) { $ builder -> setBounds ( $ result -> geometry -> viewport -> southwest -> lat , $ result -> geometry -> viewport -> southwest -> lng , $ result -> geometry -> viewport -> northeast -> lat , $ result -> geometry -> viewport -> northeast -> lng ) ; } elseif ( 'ROOFTOP' === $ result -> geometry -> location_type ) { // Fake bounds $ builder -> setBounds ( $ coordinates -> lat , $ coordinates -> lng , $ coordinates -> lat , $ coordinates -> lng ) ; } }
Parse coordinats and bounds.

@param AddressBuilder $builder
@param $result
Parse coordinats and bounds .