1 | <?php |
||
9 | class GoogleMapsClient extends HttpClient |
||
10 | { |
||
11 | /** |
||
12 | * @var string Google maps api endpoint. |
||
13 | */ |
||
14 | protected $url = 'https://maps.googleapis.com/maps/api/geocode/json'; |
||
15 | |||
16 | /** |
||
17 | * @var string Your API KEY. |
||
18 | */ |
||
19 | protected $apiKey; |
||
20 | |||
21 | /** |
||
22 | * GoogleMapsClient constructor. |
||
23 | * |
||
24 | * @param string $apiKey |
||
25 | * @param \Http\Client\HttpClient $httpClient |
||
26 | * |
||
27 | * @throws \InvalidArgumentException |
||
28 | */ |
||
29 | 12 | public function __construct($apiKey, \Http\Client\HttpClient $httpClient = null) |
|
38 | |||
39 | /** |
||
40 | * Get an array of longitude and latitude. |
||
41 | * |
||
42 | * @param Address $address |
||
43 | * |
||
44 | * @return array |
||
45 | * @throws \InvalidArgumentException |
||
46 | */ |
||
47 | 6 | public function getLatLong(Address $address) |
|
65 | } |
||
66 |