From c5dfef083022406e078dc88f0c52605dca638b07 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 2 Sep 2013 21:50:43 +0200 Subject: [PATCH] don't try to draw location while iitc boots --- mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java index 8a624ca5..f086d8fd 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java @@ -475,7 +475,7 @@ public class IITC_Mobile extends Activity { if (!mIsLocEnabled) { mIitcWebView.loadUrl("javascript: " + "window.map.locate({setView : true, maxZoom: 15});"); - // if gps location is displayed we can use a better location without any costs + // if gps location is displayed we can use a better location without any costs } else { if (mLastLocation != null) mIitcWebView.loadUrl("javascript: window.map.setView(new L.LatLng(" + @@ -554,9 +554,12 @@ public class IITC_Mobile extends Activity { // throw away all positions with accuracy > 100 meters // should avoid gps glitches if (loc.getAccuracy() < 100) { - mIitcWebView.loadUrl("javascript: " - + "window.plugin.userLocation.updateLocation( " - + loc.getLatitude() + ", " + loc.getLongitude() + ");"); + // do not touch the javascript while iitc boots + if (findViewById(R.id.imageLoading).getVisibility() == View.GONE) { + mIitcWebView.loadUrl("javascript: " + + "window.plugin.userLocation.updateLocation( " + + loc.getLatitude() + ", " + loc.getLongitude() + ");"); + } } }