Use lastStaleKnownLocation with map markers
This commit is contained in:
parent
ddd1f914b5
commit
64f39675b0
2 changed files with 3 additions and 3 deletions
|
@ -442,7 +442,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
|
||||||
boolean defaultMode = appMode.getStringKey().equals(ApplicationMode.DEFAULT.getStringKey());
|
boolean defaultMode = appMode.getStringKey().equals(ApplicationMode.DEFAULT.getStringKey());
|
||||||
|
|
||||||
float dist = 0;
|
float dist = 0;
|
||||||
Location myLoc = mapActivity.getMapViewTrackingUtilities().getMyLocation();
|
Location myLoc = mapActivity.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
|
||||||
boolean useLocation = myLoc != null && mapActivity.getMyApplication().getSettings().ROUTE_MAP_MARKERS_START_MY_LOC.get();
|
boolean useLocation = myLoc != null && mapActivity.getMyApplication().getSettings().ROUTE_MAP_MARKERS_START_MY_LOC.get();
|
||||||
List<LatLon> markers = markersHelper.getSelectedMarkersLatLon();
|
List<LatLon> markers = markersHelper.getSelectedMarkersLatLon();
|
||||||
if (useLocation ? markers.size() > 0 : markers.size() > 1) {
|
if (useLocation ? markers.size() > 0 : markers.size() > 1) {
|
||||||
|
@ -607,7 +607,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
|
||||||
OsmandMapTileView mapView = mapActivity.getMapView();
|
OsmandMapTileView mapView = mapActivity.getMapView();
|
||||||
double left = 0, right = 0;
|
double left = 0, right = 0;
|
||||||
double top = 0, bottom = 0;
|
double top = 0, bottom = 0;
|
||||||
Location myLocation = mapActivity.getMyApplication().getLocationProvider().getLastKnownLocation();
|
Location myLocation = mapActivity.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
|
||||||
if (mapActivity.getMyApplication().getMapMarkersHelper().isStartFromMyLocation() && myLocation != null) {
|
if (mapActivity.getMyApplication().getMapMarkersHelper().isStartFromMyLocation() && myLocation != null) {
|
||||||
left = myLocation.getLongitude();
|
left = myLocation.getLongitude();
|
||||||
right = myLocation.getLongitude();
|
right = myLocation.getLongitude();
|
||||||
|
|
|
@ -211,7 +211,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings nightMode) {
|
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings nightMode) {
|
||||||
OsmandSettings settings = map.getMyApplication().getSettings();
|
OsmandSettings settings = map.getMyApplication().getSettings();
|
||||||
Location myLoc = map.getMapViewTrackingUtilities().getMyLocation();
|
Location myLoc = map.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
|
||||||
MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper();
|
MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper();
|
||||||
List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
|
List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue