fix parsing of state
This commit is contained in:
parent
165fbd7018
commit
ebb715d362
2 changed files with 7 additions and 7 deletions
|
@ -51,7 +51,7 @@ class Radar extends WeatherDisplay {
|
||||||
|
|
||||||
// get the base map
|
// get the base map
|
||||||
let src = 'images/4000RadarMap2.jpg';
|
let src = 'images/4000RadarMap2.jpg';
|
||||||
if (weatherParameters.State === 'HI') src = 'images/HawaiiRadarMap2.png';
|
if (weatherParameters.state === 'HI') src = 'images/HawaiiRadarMap2.png';
|
||||||
this.baseMap = await utils.image.load(src);
|
this.baseMap = await utils.image.load(src);
|
||||||
|
|
||||||
const baseUrl = 'https://radar.weather.gov/Conus/RadarImg/';
|
const baseUrl = 'https://radar.weather.gov/Conus/RadarImg/';
|
||||||
|
@ -94,7 +94,7 @@ class Radar extends WeatherDisplay {
|
||||||
let sourceXY;
|
let sourceXY;
|
||||||
let width;
|
let width;
|
||||||
let height;
|
let height;
|
||||||
if (weatherParameters.State === 'HI') {
|
if (weatherParameters.state === 'HI') {
|
||||||
width = 600;
|
width = 600;
|
||||||
height = 571;
|
height = 571;
|
||||||
sourceXY = this.getXYFromLatitudeLongitudeHI(weatherParameters.latitude, weatherParameters.longitude, offsetX, offsetY);
|
sourceXY = this.getXYFromLatitudeLongitudeHI(weatherParameters.latitude, weatherParameters.longitude, offsetX, offsetY);
|
||||||
|
@ -120,7 +120,7 @@ class Radar extends WeatherDisplay {
|
||||||
let radarSourceX = radarSourceXY.x / 2;
|
let radarSourceX = radarSourceXY.x / 2;
|
||||||
let radarSourceY = radarSourceXY.y / 2;
|
let radarSourceY = radarSourceXY.y / 2;
|
||||||
|
|
||||||
if (weatherParameters.State === 'HI') {
|
if (weatherParameters.state === 'HI') {
|
||||||
radarOffsetX = 120;
|
radarOffsetX = 120;
|
||||||
radarOffsetY = 69;
|
radarOffsetY = 69;
|
||||||
radarSourceXY = this.getXYFromLatitudeLongitudeHI(weatherParameters.latitude, weatherParameters.longitude, offsetX, offsetY);
|
radarSourceXY = this.getXYFromLatitudeLongitudeHI(weatherParameters.latitude, weatherParameters.longitude, offsetX, offsetY);
|
||||||
|
@ -167,7 +167,7 @@ class Radar extends WeatherDisplay {
|
||||||
const imgBlob = await utils.image.load(blob);
|
const imgBlob = await utils.image.load(blob);
|
||||||
|
|
||||||
// draw the entire image
|
// draw the entire image
|
||||||
if (weatherParameters.State === 'HI') {
|
if (weatherParameters.state === 'HI') {
|
||||||
workingContext.clearRect(0, 0, 571, 600);
|
workingContext.clearRect(0, 0, 571, 600);
|
||||||
workingContext.drawImage(imgBlob, 0, 0, 571, 600);
|
workingContext.drawImage(imgBlob, 0, 0, 571, 600);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -21,9 +21,9 @@ class RegionalForecast extends WeatherDisplay {
|
||||||
|
|
||||||
// pre-load the base map (returns promise)
|
// pre-load the base map (returns promise)
|
||||||
let src = 'images/Basemap2.png';
|
let src = 'images/Basemap2.png';
|
||||||
if (weatherParameters.State === 'HI') {
|
if (weatherParameters.state === 'HI') {
|
||||||
src = 'images/HawaiiRadarMap4.png';
|
src = 'images/HawaiiRadarMap4.png';
|
||||||
} else if (weatherParameters.State === 'AK') {
|
} else if (weatherParameters.state === 'AK') {
|
||||||
src = 'images/AlaskaRadarMap6.png';
|
src = 'images/AlaskaRadarMap6.png';
|
||||||
}
|
}
|
||||||
this.baseMap = utils.image.load(src);
|
this.baseMap = utils.image.load(src);
|
||||||
|
@ -41,7 +41,7 @@ class RegionalForecast extends WeatherDisplay {
|
||||||
|
|
||||||
// get a target distance
|
// get a target distance
|
||||||
let targetDistance = 2.5;
|
let targetDistance = 2.5;
|
||||||
if (weatherParameters.State === 'HI') targetDistance = 1;
|
if (weatherParameters.state === 'HI') targetDistance = 1;
|
||||||
|
|
||||||
// make station info into an array
|
// make station info into an array
|
||||||
const stationInfoArray = Object.keys(_StationInfo).map(key => Object.assign({}, _StationInfo[key], {targetDistance}));
|
const stationInfoArray = Object.keys(_StationInfo).map(key => Object.assign({}, _StationInfo[key], {targetDistance}));
|
||||||
|
|
Loading…
Reference in a new issue