| @@ 342-350 (lines=9) @@ | ||
| 339 | * |
|
| 340 | * @api |
|
| 341 | */ |
|
| 342 | public function getForecastUVIndex($lat, $lon, $cnt = 8) |
|
| 343 | { |
|
| 344 | $answer = $this->getRawUVIndexData('forecast', $lat, $lon, $cnt); |
|
| 345 | $data = $this->parseJson($answer); |
|
| 346 | ||
| 347 | return array_map(function ($entry) { |
|
| 348 | return new UVIndex($entry); |
|
| 349 | }, $data); |
|
| 350 | } |
|
| 351 | ||
| 352 | /** |
|
| 353 | * Returns the historic uv index at the specified location. |
|
| @@ 367-375 (lines=9) @@ | ||
| 364 | * |
|
| 365 | * @api |
|
| 366 | */ |
|
| 367 | public function getHistoricUVIndex($lat, $lon, $start, $end) |
|
| 368 | { |
|
| 369 | $answer = $this->getRawUVIndexData('historic', $lat, $lon, null, $start, $end); |
|
| 370 | $data = $this->parseJson($answer); |
|
| 371 | ||
| 372 | return array_map(function ($entry) { |
|
| 373 | return new UVIndex($entry); |
|
| 374 | }, $data); |
|
| 375 | } |
|
| 376 | ||
| 377 | /** |
|
| 378 | * Directly returns the xml/json/html string returned by OpenWeatherMap for the current weather. |
|