Fix moving target
This commit is contained in:
parent
5ebfa2decf
commit
95b2a20e2c
1 changed files with 2 additions and 2 deletions
|
@ -328,7 +328,7 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
|
|||
LatLon lt = new LatLon(l.getLatitude(), l.getLongitude());
|
||||
boolean cancelDestinationId = false;
|
||||
if(followTargetLocation != null ) {
|
||||
if(pn == null || pn.point == null || !pn.point.equals(followTargetLocation) ) {
|
||||
if(pn == null || pn.point == null || MapUtils.getDistance(pn.point, followTargetLocation) > 10) {
|
||||
cancelDestinationId = true;
|
||||
}
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye
|
|||
sameObject = false;
|
||||
}
|
||||
LatLon mapLoc = new LatLon(map.getMapView().getLatitude(), map.getMapView().getLongitude());
|
||||
final boolean centered = Algorithms.objectEquals(followMapLocation, mapLoc);
|
||||
final boolean centered = followMapLocation != null && MapUtils.getDistance(mapLoc, followMapLocation) < 1;
|
||||
if(sameObject || centered) {
|
||||
final LatLon loc;
|
||||
if(centered ) {
|
||||
|
|
Loading…
Reference in a new issue