-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/geolocation: GEO location support has been implemented
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace MoveMoveApp\DaData2\Methods\Address; | ||
|
||
use GuzzleHttp\Client; | ||
use MoveMoveApp\DaData2\Http\Router; | ||
use MoveMoveApp\DaData2\Methods\BaseMethod; | ||
|
||
/** | ||
* Reverse geocoding | ||
* | ||
* Reverse geocoding (address by coordinates) has been implemented to find the nearest addresses (houses, streets, cities) based on geographic coordinates. | ||
* | ||
* @note: This service is available exclusively for Russia. | ||
* | ||
* @link https://dadata.ru/api/geolocate/ | ||
* | ||
* @property string $lat | ||
* @property string $lon | ||
* @property string $count | ||
* @property string $radius_meters | ||
* @property array $language | ||
*/ | ||
class GeoLocateMethod extends BaseMethod | ||
{ | ||
protected string $method = 'POST'; | ||
protected string $entryPoint; | ||
protected string $expect = 'Address'; | ||
protected array $parameters = [ | ||
'lat' => 'float', | ||
'lon' => 'float', | ||
'count' => 'integer', | ||
'radius_meters' => 'integer', | ||
'language' => 'string', | ||
]; | ||
|
||
/** | ||
* @param Client $client | ||
* | ||
*/ | ||
public function __construct(Client &$client) | ||
{ | ||
$this->entryPoint = Router::geoLocateAddress(); | ||
|
||
parent::__construct($client); | ||
} | ||
} |