Parse location from window hash

This commit is contained in:
Jesse Cardone 2019-06-12 19:33:34 -04:00
parent 9e17022bda
commit c7d64b7c77
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,9 @@
WxData.init();
WxData.observations('USNY0483:1:US').then(data => {
// Default to Atlanta
let mainLoc = window.location.hash ? window.location.hash : 'USGA0028:1:US';
WxData.observations(mainLoc).then(data => {
document.getElementById('city').innerText = data.obs_name;
document.getElementById('current-temp').innerText = data.temp;
document.getElementById('current-info').innerText = data.wx_phrase;

File diff suppressed because one or more lines are too long