update current projection to the calculated route
This commit is contained in:
parent
ccc3e02cc9
commit
3aaf231f61
1 changed files with 2 additions and 2 deletions
|
@ -202,16 +202,16 @@ public class RoutingHelper {
|
|||
}
|
||||
// calculate projection of current location
|
||||
|
||||
double projectDist = mode == ApplicationMode.CAR ? POSITION_TOLERANCE * 1.5f : POSITION_TOLERANCE ;
|
||||
double projectDist = mode == ApplicationMode.CAR ? POSITION_TOLERANCE : POSITION_TOLERANCE / 2 ;
|
||||
if(dist < projectDist) {
|
||||
Location nextLocation = routeNodes.get(currentRoute);
|
||||
LatLon project = getProject(currentLocation, routeNodes.get(currentRoute - 1), routeNodes.get(currentRoute));
|
||||
|
||||
locationProjection.setLatitude(project.getLatitude());
|
||||
locationProjection.setLongitude(project.getLongitude());
|
||||
float bearingTo = locationProjection.bearingTo(nextLocation);
|
||||
// we need to update bearing too
|
||||
if(locationProjection.hasBearing()) {
|
||||
float bearingTo = locationProjection.bearingTo(nextLocation);
|
||||
locationProjection.setBearing(bearingTo);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue