Skip to content

Commit

Permalink
#96: apply for all maps
Browse files Browse the repository at this point in the history
  • Loading branch information
l-e-X committed Aug 27, 2016
1 parent b2d08ac commit 8cf110a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 11 additions & 1 deletion www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ angular.module('grisu-noe',
$urlRouterProvider.otherwise('/tab/overview');
})

.run(function($ionicPlatform, $window, $rootScope, $timeout, $cordovaSplashscreen, $cordovaDevice, dataService, $screenshotService, util) {
.run(function($ionicPlatform, $window, $rootScope, $timeout, $cordovaSplashscreen,
$cordovaDevice, dataService, $screenshotService, util, leafletData) {
$ionicPlatform.ready(function() {

/** opens an external link with Cordova's inappbrowser plugin */
Expand All @@ -160,6 +161,15 @@ angular.module('grisu-noe',
});
};

/** hack to bring the overlays (e.g. OpenFireMap) in front of the base layer when the base layer changes */
$rootScope.$on('leafletDirectiveMap.baselayerchange', function() {
leafletData.getLayers().then(function(layer) {
angular.forEach(layer.baselayers, function(baseLayer) {
baseLayer.setZIndex(-1);
});
});
});

if ($window.cordova) {
$timeout(function() {
console.debug('hide splash screen');
Expand Down
11 changes: 0 additions & 11 deletions www/js/controllers/waterTabController.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ angular.module('grisu-noe').controller('waterTabController',
updateLayersAndHydrants();
});

/**
* hack to bring the overlays (e.g. OpenFireMap) in front of the base layer when the base layer changes
*/
$scope.$on('leafletDirectiveMap.baselayerchange', function() {
leafletData.getLayers().then(function(layer) {
angular.forEach(layer.baselayers, function(baseLayer) {
baseLayer.setZIndex(-1);
});
});
});

$scope.$on('$ionicView.loaded', function() {
$ionicLoading.show({
template: '<ion-spinner class="spinner-light" icon="ripple"></ion-spinner><div>Bestimme aktuelle Position...</div>'
Expand Down

0 comments on commit 8cf110a

Please sign in to comment.