diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs
index 4fe6e70fd3..0c22014c8e 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs
@@ -64,6 +64,12 @@
Information
+ {{#if geoServicesEnabled}}
Speed km/h
Heading
+ {{/if}}
@@ -688,11 +696,11 @@
var geoLocationLink = $(".initGeoLocationLink");
if (geoLocationLink) {
geoLocationLink.on('click', function () {
- initializeGeoLocation()
+ initializeGeoLocation({{geoServicesEnabled}});
});
- {{#if showGeoFencingTools}}
+ geoPublicUri = $("#geo-charts").data("geo-public-uri");
+ {{#if geoServicesEnabled}}
var geoToolsMenu = $('#location-action-bar');
- geoPublicUri = $("#geo-charts").data("geo-public-uri");
var realtTime = createGeoToolListItem('javascript:enableRealTime()',
'Return to Real Time View', 'fw fw-undo', geoToolsMenu);
realtTime.css("display", "none");
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js
index e41cde4345..f35db76fee 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js
@@ -52,6 +52,6 @@ function onRequest(context) {
} else {
viewModel.lastLocation = stringify({});
}
- viewModel.showGeoFencingTools = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled;
+ viewModel.geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled;
return viewModel;
}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js
index ad02afb114..dcc9a8c95a 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/app.js
@@ -40,38 +40,11 @@ function initialLoad() {
setTimeout(initialLoad, 500); // give everything some time to render
} else {
initializeMap();
- // getTileServers();
- // loadWms();
processAfterInitializationMap();
- //Access gps and make zoom to server location as map center
- //navigator.geolocation.getCurrentPosition(success, error);
$("#loading").hide();
}
}
-//function success(position) {
-// var browserLatitude = position.coords.latitude;
-// var browserLongitude = position.coords.longitude;
-// map.setView([browserLatitude, browserLongitude]);
-// map.setZoom(14);
-// $.UIkit.notify({
-// message: "Map view set to browser's location",
-// status: 'info',
-// timeout: ApplicationOptions.constance.NOTIFY_INFO_TIMEOUT,
-// pos: 'top-center'
-// });
-//}
-//
-//function error() {
-// $.UIkit.notify({
-// message: "Unable to find browser location!",
-// status: 'warning',
-// timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
-// pos: 'top-center'
-// });
-//}
-
-
function initializeMap() {
if (typeof(map) !== 'undefined') {
map.remove();
@@ -83,7 +56,7 @@ function initializeMap() {
map = L.map("map", {
zoom: 14,
center: [6.927078, 79.861243],
- layers: [defaultOSM, defaultTFL],
+ layers: [defaultOSM],
zoomControl: true,
attributionControl: false,
maxZoom: 20,
@@ -147,28 +120,20 @@ function processAfterInitializationMap() {
div.innerHTML = "