From 9f08b1d977bf5bd1827683ecc80da4ed1dee54ab Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 6 Dec 2014 07:23:54 +0000 Subject: [PATCH] mobile: work around leaflet not seeing the WebView size in some cases, causing odd map issues at startup not 100% certain it fixes it yet, as it doesn't happen every single time... --- code/smartphone.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/smartphone.js b/code/smartphone.js index 8ed9c445..43ec892f 100644 --- a/code/smartphone.js +++ b/code/smartphone.js @@ -174,8 +174,15 @@ window.runOnSmartphonesAfterBoot = function() { addHook('portalSelected', window.setAndroidPermalink); } + + // for some reason, leaflet misses the WebView size being set at startup on IITC Mobile + // create a short timer that checks for this issue + setTimeout (function() { map.invalidateSize(); }, 0.2*1000); + } + + window.setAndroidPermalink = function() { var c = window.map.getCenter(); var lat = Math.round(c.lat*1E6)/1E6;