From 6604c23257f222bdfd73fa9bab634059bffdadb9 Mon Sep 17 00:00:00 2001 From: kamidu Date: Thu, 2 Mar 2017 15:20:27 +0530 Subject: [PATCH] fix for leaflet tile not loading issues --- .../public/js/load-map.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/load-map.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/load-map.js index 8ce98731bf..af0d1e5d88 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/load-map.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/public/js/load-map.js @@ -46,9 +46,10 @@ function loadLeafletMap() { this.closePopup(); }); } - $("#map-error").hide(); $("#device-location").show(); + setTimeout(function(){ map.invalidateSize()}, 400); + } else if (location_long && location_lat) { map = L.map(container).setView([location_lat, location_long], zoomLevel); @@ -61,7 +62,9 @@ function loadLeafletMap() { m.on('mouseout', function (e) { this.closePopup(); }); - + $("#map-error").hide(); + $("#device-location").show(); + setTimeout(function(){ map.invalidateSize()}, 400); } else { $("#device-location").hide(); $("#map-error").show();