summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjiban Bairagya <sanjiban22393@gmail.com>2016-07-17 20:21:57 (GMT)
committerSanjiban Bairagya <sanjiban@magicpin.in>2016-07-17 20:22:17 (GMT)
commitc3d7ab14c2953fcbabf42fb7605ae230fa9220cc (patch)
tree51da3cce9dd3a96366f67de5a03832be42a617aa
parent693ceec0681a6a42a39c0adb18d164d96e020530 (diff)
Make the range for detection of deviation from route speed-dependent
-rw-r--r--src/lib/marble/routing/RoutingModel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/marble/routing/RoutingModel.cpp b/src/lib/marble/routing/RoutingModel.cpp
index 9c48db6..a7894a7 100644
--- a/src/lib/marble/routing/RoutingModel.cpp
+++ b/src/lib/marble/routing/RoutingModel.cpp
@@ -284,7 +284,7 @@ int RoutingModel::rightNeighbor( const GeoDataCoordinates &position, RouteReques
return route->size()-1;
}
-void RoutingModel::updatePosition( GeoDataCoordinates location, qreal /*speed*/ )
+void RoutingModel::updatePosition( GeoDataCoordinates location, qreal speed )
{
d->m_route.setPosition( location );
@@ -297,7 +297,7 @@ void RoutingModel::updatePosition( GeoDataCoordinates location, qreal /*speed*/
if ( d->m_positionTracking && d->m_positionTracking->accuracy().vertical > 0.0 ) {
deviation = qMax<qreal>( d->m_positionTracking->accuracy().vertical, d->m_positionTracking->accuracy().horizontal );
}
- qreal const threshold = deviation + 100.0;
+ qreal const threshold = deviation + qBound(10.0, speed*10.0, 150.0);
RoutingModelPrivate::RouteDeviation const deviated = distance < threshold ? RoutingModelPrivate::OnRoute : RoutingModelPrivate::OffRoute;
if ( d->m_deviation != deviated ) {