()
| 109 | } |
| 110 | |
| 111 | async function loadStation() { |
| 112 | let location |
| 113 | |
| 114 | let config = await loadConfig() |
| 115 | |
| 116 | if (config.fixedLocation === 1) { |
| 117 | location = config.myLocation |
| 118 | } else { |
| 119 | location = await Location.current() |
| 120 | } |
| 121 | console.log(location) |
| 122 | const data = await new Request(apiURL(location, config.radius, config.apiKey)).loadJSON() |
| 123 | |
| 124 | if (!data) { |
| 125 | const errorList = new ListWidget() |
| 126 | errorList.addText("Keine Ergebnisse für den aktuellen Ort gefunden.") |
| 127 | return errorList |
| 128 | } |
| 129 | return data |
| 130 | } |
| 131 | |
| 132 | function formatValue(value) { |
| 133 | if (!value) { |
no test coverage detected