Skip to content

Commit

Permalink
Enable loading on the webapp heatmap screen as well
Browse files Browse the repository at this point in the history
  • Loading branch information
shankari committed Jul 17, 2016
1 parent 324d4a9 commit d8cd339
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webapp/www/js/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ angular.module('starter.heatmap', ['ui-leaflet'])
});

$scope.getPopRoute = function() {
$ionicLoading.show({
template: 'Loading...'
});
var data = {
modes: $scope.selectCtrl.modes,
from_local_date: $scope.selectCtrl.fromDate,
Expand All @@ -30,13 +33,15 @@ angular.module('starter.heatmap', ['ui-leaflet'])
console.log("Sending data "+JSON.stringify(data));
$http.post("/result/heatmap/pop.route", data)
.then(function(response) {
$ionicLoading.hide();
if (angular.isDefined(response.data.lnglat)) {
console.log("Got points in heatmap "+response.data.lnglat.length);
$scope.showHeatmap(response.data.lnglat);
} else {
console.log("did not find latlng in response data "+JSON.stringify(response.data));
}
}, function(error) {
$ionicLoading.hide();
console.log("Got error %s while trying to read heatmap data" +
JSON.stringify(error));
});
Expand Down

0 comments on commit d8cd339

Please sign in to comment.