Fix bug with distance threshold for point announcements

This commit is contained in:
sonora 2014-09-10 16:25:22 +02:00
parent 0e798fb169
commit c0aaabdd8e

View file

@ -306,8 +306,8 @@ public class WaypointHelper {
break;
}
LocationPoint point = lwp.point;
double d1 = MapUtils.getDistance(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude(),
point.getLatitude(), point.getLongitude()) + lwp.getDeviationDistance();
double d1 = Math.max(0.0, MapUtils.getDistance(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude(),
point.getLatitude(), point.getLongitude()) - lwp.getDeviationDistance());
Integer state = locationPointsStates.get(point);
if (state != null && state.intValue() == ANNOUNCED_ONCE
&& getVoiceRouter()