From a00517100e2cf5897c396420b8da5c9a117eb491 Mon Sep 17 00:00:00 2001 From: raitis Date: Tue, 23 Jul 2019 15:09:09 +0300 Subject: [PATCH] Enable turning on/off geolocation fixes #239 --- .../geolocation/geolocation.directive.js | 6 +- .../geolocation/partials/geolocation.html | 2 +- components/map/map.controller.js | 162 +++++++++--------- wiki/config.txt | 4 + 4 files changed, 91 insertions(+), 83 deletions(-) diff --git a/components/geolocation/geolocation.directive.js b/components/geolocation/geolocation.directive.js index 1ea7379616..2b731d2728 100644 --- a/components/geolocation/geolocation.directive.js +++ b/components/geolocation/geolocation.directive.js @@ -10,7 +10,7 @@ export default ['hs.map.service', 'hs.geolocation.service', 'Core', 'config', fu } } }, - controller: ['$scope', function ($scope) { + controller: ['$scope', 'config', function ($scope, config) { $scope.collapsed = true; $scope.blocateClick = function (e) { //Checking target is needed because follow button is inside locate button (container) @@ -24,6 +24,10 @@ export default ['hs.map.service', 'hs.geolocation.service', 'Core', 'config', fu Geolocation.geolocation.setTracking(true); } } + + $scope.geolocationVisible = function () { + return (angular.isUndefined(config.locationButtonVisible) || config.locationButtonVisible); + } }], replace: true }; diff --git a/components/geolocation/partials/geolocation.html b/components/geolocation/partials/geolocation.html index 54749e75e0..cdae5a4903 100755 --- a/components/geolocation/partials/geolocation.html +++ b/components/geolocation/partials/geolocation.html @@ -1,4 +1,4 @@ -