Fix projection issue
This commit is contained in:
parent
594fafdc50
commit
3dc5b81acf
2 changed files with 12 additions and 9 deletions
|
@ -737,9 +737,10 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
||||||
location.setSpeed(speed);
|
location.setSpeed(speed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(locationLayer.getLastKnownLocation() != null && location.hasBearing()){
|
if(locationLayer.getLastKnownLocation() != null && !location.hasBearing()){
|
||||||
if(locationLayer.getLastKnownLocation().distanceTo(location) > 10 && !isRunningOnEmulator()){
|
if(locationLayer.getLastKnownLocation().distanceTo(location) > 10 && !isRunningOnEmulator()){
|
||||||
location.setBearing(locationLayer.getLastKnownLocation().bearingTo(location));
|
// very innacurate?
|
||||||
|
// location.setBearing(locationLayer.getLastKnownLocation().bearingTo(location));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -841,20 +842,20 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
||||||
DisplayMetrics metrics = new DisplayMetrics();
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||||
|
|
||||||
|
//FIXME victor review
|
||||||
//correct for roughly constant "look ahead" distance on different screens, see Issue 914
|
//correct for roughly constant "look ahead" distance on different screens, see Issue 914
|
||||||
int screenSizeCorrection = (int)Math.round(Math.log(((float)metrics.heightPixels)/320.0f) / Math.log(2.0f));
|
int screenSizeCorrection = (int)Math.round(Math.log(((float)metrics.heightPixels)/320.0f) / Math.log(2.0f));
|
||||||
|
|
||||||
speed *= 3.6;
|
if(speed < 5f/3.6){
|
||||||
if(speed < 5){
|
|
||||||
return currentZoom;
|
return currentZoom;
|
||||||
// less than 23: show zoom 17
|
// less than 23: show zoom 17
|
||||||
} else if(speed < 23){
|
} else if(speed < 23f/3.6){
|
||||||
return 17 + screenSizeCorrection;
|
return 17 + screenSizeCorrection;
|
||||||
} else if(speed < 43){
|
} else if(speed < 43f/3.6){
|
||||||
return 16 + screenSizeCorrection;
|
return 16 + screenSizeCorrection;
|
||||||
} else if(speed < 63){
|
} else if(speed < 63f/3.6){
|
||||||
return 15 + screenSizeCorrection;
|
return 15 + screenSizeCorrection;
|
||||||
} else if(speed < 83){
|
} else if(speed < 83f/3.6){
|
||||||
return 14 + screenSizeCorrection;
|
return 14 + screenSizeCorrection;
|
||||||
}
|
}
|
||||||
return 13 + screenSizeCorrection;
|
return 13 + screenSizeCorrection;
|
||||||
|
|
|
@ -201,7 +201,9 @@ public class RoutingHelper {
|
||||||
calculateRoute = true;
|
calculateRoute = true;
|
||||||
}
|
}
|
||||||
// calculate projection of current location
|
// calculate projection of current location
|
||||||
if(dist < POSITION_TOLERANCE * 1.5f) {
|
|
||||||
|
double projectDist = mode == ApplicationMode.CAR ? POSITION_TOLERANCE * 1.5f : POSITION_TOLERANCE ;
|
||||||
|
if(dist < projectDist) {
|
||||||
Location nextLocation = routeNodes.get(currentRoute);
|
Location nextLocation = routeNodes.get(currentRoute);
|
||||||
LatLon project = getProject(currentLocation, routeNodes.get(currentRoute - 1), routeNodes.get(currentRoute));
|
LatLon project = getProject(currentLocation, routeNodes.get(currentRoute - 1), routeNodes.get(currentRoute));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue