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 151a91e9fd6..cb2a518ef66 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 @@ -736,6 +736,7 @@ var geoLocationLink = $(".initGeoLocationLink"); if (geoLocationLink) { geoLocationLink.on('click', function () { + loadGeoFencing(); initializeGeoLocation({{geoServicesEnabled}}); }); geoPublicUri = $("#geo-charts").data("geo-public-uri"); 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 9c9632f3df1..266433f1c44 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 @@ -46,7 +46,8 @@ function initialLoad(geoFencingEnabled) { } function initializeMap() { - if (typeof(map) !== 'undefined') { + ///map.zoomControl is added to fix UI loading issue on Safari + if (typeof(map) !== 'undefined' && map.zoomControl != null) { map.remove(); } if (document.getElementById('map') == null) { 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/geo_fencing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js index 5996dbcac35..07a42cefd8a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js @@ -23,10 +23,9 @@ var drawnItems; var lastId; var controlDiv; -loadGeoFencing(); - function loadGeoFencing() { - if (map == null) { + ///map.zoomControl is added to fix UI loading issue on Safari + if (map == null || map.zoomControl == null) { setTimeout(loadGeoFencing, 1000); // give everything some time to render } else { map.on('draw:created', function (e) {