refactor icon finding scripts
This commit is contained in:
parent
7fae649357
commit
e2877aad77
9 changed files with 365 additions and 363 deletions
|
|
@ -4,7 +4,7 @@ import { loadImg, preloadImg } from './utils/image.mjs';
|
|||
import { json } from './utils/fetch.mjs';
|
||||
import { directionToNSEW } from './utils/calc.mjs';
|
||||
import { locationCleanup } from './utils/string.mjs';
|
||||
import { getWeatherIconFromIconLink } from './icons.mjs';
|
||||
import { getLargeIcon } from './icons.mjs';
|
||||
import WeatherDisplay from './weatherdisplay.mjs';
|
||||
import { registerDisplay } from './navigation.mjs';
|
||||
import {
|
||||
|
|
@ -84,7 +84,7 @@ class CurrentWeather extends WeatherDisplay {
|
|||
if (!superResult) return;
|
||||
|
||||
// preload the icon
|
||||
preloadImg(getWeatherIconFromIconLink(observations.features[0].properties.icon));
|
||||
preloadImg(getLargeIcon(observations.features[0].properties.icon));
|
||||
this.setStatus(STATUS.loaded);
|
||||
}
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ const parseData = (data) => {
|
|||
data.WindSpeed = windConverter(data.WindSpeed);
|
||||
data.WindUnit = windConverter.units;
|
||||
data.Humidity = Math.round(observations.relativeHumidity.value);
|
||||
data.Icon = getWeatherIconFromIconLink(observations.icon);
|
||||
data.Icon = getLargeIcon(observations.icon);
|
||||
data.PressureDirection = '';
|
||||
data.TextConditions = observations.textDescription;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue