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