A geocoder coordinate request allows you to geocode an address from an coordinate.
First of all, let's build a geocoder coordinate request:
use Ivory\GoogleMap\Base\Coordinate;
use Ivory\GoogleMap\Service\Geocoder\Request\GeocoderCoordinateRequest;
$request = new GeocoderCoordinateRequest(new Coordinate(48.865475, 2.321118));
The geocoder coordinate request constructor requires an coordinate as first argument.
If you want to update the coordinate, you can use:
$request->setCoordinate(new Coordinate(48.865475, 2.321118));
It specifies a type will restrict the results to this type. If multiple types are specified, the API will return all addresses that match any of the types.
use Ivory\GoogleMap\Service\Geocoder\Request\GeocoderAddressType;
$request->setLocationTypes([GeocoderAddressType::COUNTRY]);
It specifies a type will restrict the results to this type. If multiple types are specified, the API will return all addresses that match any of the types.
use Ivory\GoogleMap\Service\Base\GeometryLocationType;
$request->setLocationTypes([GeometryLocationType::APPROXIMATE]);
If you want to update the language, you can use:
$request->setLanguage('fr');