diff --git a/webroot/js/data-manager.js b/webroot/js/data-manager.js
index 9d1a506..f9a34aa 100644
--- a/webroot/js/data-manager.js
+++ b/webroot/js/data-manager.js
@@ -54,7 +54,6 @@ function DataManager(pointSearch){
locList.push({lat: latgeo, long:longeo, distance:dist, stationUrl:feature.stationId[i]});
}
}
-
if (locList.length===0) {
$this.trigger('allinit');
return
diff --git a/webroot/js/location.js b/webroot/js/location.js
index 9c2e6de..f2b0b05 100644
--- a/webroot/js/location.js
+++ b/webroot/js/location.js
@@ -55,10 +55,11 @@ function Location() { // onReady, onRefresh, onAllComplete
// ajax the latest observation
$.getJSON(url, function(data) {
+ if (data['v3-location-point'] != null) {
_observations[0] = json = data['v3-wx-observations-current'];
_observations[0].latitude = loclat;
_observations[0].longitude = loclong;
- _observations[0].cityname = data['v3-location-point'].location.city;
+ _observations[0].cityname = data['v3-location-point'].location.displayName;
$this.trigger('refresh');
// the following block only runs on init
@@ -71,14 +72,16 @@ function Location() { // onReady, onRefresh, onAllComplete
that.city = data['v3-location-point'].location.city;
- $this.trigger('init');
+ $this.trigger('init');
}
// set the expiration date/time
_observations[0].xdate = dateFns.addMinutes(json.lastBuildDate, json.ttl);
setTimeout(checkRefresh, getRandom(5000, 10000));
-
+ } else {
+ $this.trigger('init');
+ }
});
}
diff --git a/webroot/js/slides-loop.js b/webroot/js/slides-loop.js
index 8bf4813..dbde83f 100644
--- a/webroot/js/slides-loop.js
+++ b/webroot/js/slides-loop.js
@@ -1211,9 +1211,11 @@ RADAR < MAIN CITY < CITY 1 < CITY 2
airport='AIRPORTS';
for (var location of dataMan.locations) {
+ if (location.city !== undefined) {
city = location.city;
cities += arrow+'' + city + '';
}
+ }
$('#info-slides-header .hscroller').append(cities + arrow + (radar + arrow + airport + arrow + health + cities + arrow).repeat(4));
}
diff --git a/webroot/js/weather.js b/webroot/js/weather.js
index 685951c..39bb883 100644
--- a/webroot/js/weather.js
+++ b/webroot/js/weather.js
@@ -52,7 +52,7 @@ function WeatherManager() {
var queryString = window.location.search;
if (queryString) {
- $.getJSON("https://api.weather.com/v3/location/search?query="+queryString.split("?")[1]+"&language=en-US&format=json&apiKey=" + process.env.API_KEY, function(data) {
+ $.getJSON("https://api.weather.com/v3/location/search?query="+queryString.split("?")[1]+"&language=en-US&format=json&apiKey=" + api_key, function(data) {
dataMan = createDataManager( data.location.latitude[0]+','+data.location.longitude[0] );
mainloc = data.location.city[0]
});