1 | <?php namespace Arcanedev\GeoLocation\Google\Elevation; |
||
14 | class ElevationService extends AbstractService |
||
15 | { |
||
16 | /* ----------------------------------------------------------------- |
||
17 | | Constants |
||
18 | | ----------------------------------------------------------------- |
||
19 | */ |
||
20 | |||
21 | const BASE_URL = 'https://maps.googleapis.com/maps/api/elevation/json'; |
||
22 | |||
23 | /* ----------------------------------------------------------------- |
||
24 | | Constructor |
||
25 | | ----------------------------------------------------------------- |
||
26 | */ |
||
27 | |||
28 | /** |
||
29 | * ElevationService constructor. |
||
30 | * |
||
31 | * @param \GuzzleHttp\ClientInterface $client |
||
32 | */ |
||
33 | 12 | public function __construct(ClientInterface $client) |
|
39 | |||
40 | /* ----------------------------------------------------------------- |
||
41 | | Main Methods |
||
42 | | ----------------------------------------------------------------- |
||
43 | */ |
||
44 | |||
45 | /** |
||
46 | * Get the geocoding response. |
||
47 | * |
||
48 | * @param \Arcanedev\GeoLocation\Contracts\Entities\Coordinates\Position $position |
||
49 | * @param array $options |
||
50 | * |
||
51 | * @return \Arcanedev\GeoLocation\Google\Elevation\ElevationResponse |
||
52 | */ |
||
53 | 6 | public function location(PositionContract $position, array $options = []) |
|
61 | |||
62 | /** |
||
63 | * Reverse geocoding (address lookup). |
||
64 | * |
||
65 | * @param array $positions |
||
66 | * @param array $options |
||
67 | * |
||
68 | * @return \Arcanedev\GeoLocation\Google\Elevation\ElevationResponse |
||
69 | */ |
||
70 | public function path(array $positions, array $options = []) |
||
82 | |||
83 | /* ----------------------------------------------------------------- |
||
84 | | Other Methods |
||
85 | | ----------------------------------------------------------------- |
||
86 | */ |
||
87 | |||
88 | /** |
||
89 | * Prepare the response. |
||
90 | * |
||
91 | * @param \Psr\Http\Message\ResponseInterface $response |
||
92 | * |
||
93 | * @return \Arcanedev\GeoLocation\Google\AbstractResponse |
||
94 | */ |
||
95 | 9 | protected function prepareResponse(ResponseInterface $response) |
|
101 | } |
||
102 |