From 3565cc8d440d4063185ff59d88875cd80c54e382 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Fri, 21 Jul 2017 13:55:18 +0300 Subject: [PATCH] Add small fixes --- OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 3 ++- OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 55124a1f4d..7892aa3ea5 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -792,7 +792,8 @@ public class MapControlsLayer extends OsmandMapLayer { } private void updateMyLocation(RoutingHelper rh, boolean dialogOpened) { - boolean enabled = !isLocationOutdated(mapActivity.getMyApplication().getLocationProvider().getLastKnownLocation()); + boolean enabled = mapActivity.getMyApplication().getLocationProvider().getLastKnownLocation() != null && + !isLocationOutdated(mapActivity.getMyApplication().getLocationProvider().getLastKnownLocation()); boolean tracked = mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation(); if (!enabled) { diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java index 86ad14b6ef..dc09eca433 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapLayer.java @@ -40,7 +40,7 @@ import gnu.trove.list.array.TIntArrayList; public abstract class OsmandMapLayer { - protected static final int UPDATES_BEFORE_CHECK_LOCATION = 20; + protected static final int UPDATES_BEFORE_CHECK_LOCATION = 40; protected List fullObjectsLatLon; protected List smallObjectsLatLon;