Fix and arrive at destination point

This commit is contained in:
vshcherb 2013-11-06 17:41:18 +01:00
parent a6029b3f26
commit 29d1fe315c
3 changed files with 8 additions and 5 deletions

View file

@ -101,6 +101,10 @@ public class TurnType {
return value.equals(KR);
}
public boolean goAhead() {
return value.equals(C);
}
public boolean isSkipToSpeak() {
return skipToSpeak;
}

View file

@ -289,9 +289,7 @@ public class VoiceRouter {
NextDirectionInfo nextInfo = router.getNextRouteDirectionInfo(new NextDirectionInfo(), true);
RouteSegmentResult currentSegment = router.getCurrentSegmentResult();
// after last turn say:
if (nextInfo.directionInfo == null || nextInfo.directionInfo.distance == 0) {
if (nextInfo.directionInfo == null) {
return;
}
int dist = nextInfo.distanceTo;

View file

@ -745,14 +745,15 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall
private float y2;
private LatLon initialCenterLatLon;
private boolean startRotating = false;
private static final float ANGLE_THRESHOLD = 18;
private static final float ANGLE_THRESHOLD = 15;
@Override
public void onZoomEnded(double relativeToStart, float angleRelative) {
// 1.5 works better even on dm.density=1 devices
float dz = (float) (Math.log(relativeToStart) / Math.log(2)) * 1.5f;
setIntZoom(Math.round(dz) + initialViewport.getZoom());
if(Math.abs(angleRelative) < ANGLE_THRESHOLD){
if(Math.abs(angleRelative) < ANGLE_THRESHOLD * relativeToStart ||
Math.abs(angleRelative) < ANGLE_THRESHOLD / relativeToStart){
angleRelative = 0;
}
rotateToAnimate(initialViewport.getRotate() + angleRelative);