don't try to draw location while iitc boots

This commit is contained in:
Philipp Schaefer 2013-09-02 21:50:43 +02:00
parent c262a2e1d6
commit c5dfef0830

View File

@ -475,7 +475,7 @@ public class IITC_Mobile extends Activity {
if (!mIsLocEnabled) { if (!mIsLocEnabled) {
mIitcWebView.loadUrl("javascript: " + mIitcWebView.loadUrl("javascript: " +
"window.map.locate({setView : true, maxZoom: 15});"); "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 { } else {
if (mLastLocation != null) if (mLastLocation != null)
mIitcWebView.loadUrl("javascript: window.map.setView(new L.LatLng(" + 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 // throw away all positions with accuracy > 100 meters
// should avoid gps glitches // should avoid gps glitches
if (loc.getAccuracy() < 100) { if (loc.getAccuracy() < 100) {
mIitcWebView.loadUrl("javascript: " // do not touch the javascript while iitc boots
+ "window.plugin.userLocation.updateLocation( " if (findViewById(R.id.imageLoading).getVisibility() == View.GONE) {
+ loc.getLatitude() + ", " + loc.getLongitude() + ");"); mIitcWebView.loadUrl("javascript: "
+ "window.plugin.userLocation.updateLocation( "
+ loc.getLatitude() + ", " + loc.getLongitude() + ");");
}
} }
} }