From f7cde7b7f3e2cf1d07388381205a49ddeb113ab5 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Fri, 28 Feb 2014 12:34:06 +0200 Subject: [PATCH] Fix roundabout issue --- .../net/osmand/plus/routing/RouteCalculationResult.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java index 2b72a7531c..451f8269b3 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java @@ -259,9 +259,11 @@ public class RouteCalculationResult { RouteDirectionInfo info = new RouteDirectionInfo(s.getSegmentSpeed(), turn); if (routeInd < list.size()) { int lind = routeInd; - if(turn.isRoundAbout() && routeInd + 1 < list.size()) { - // take next name for roundabout (not roundabout name) - lind = routeInd + 1; + if(turn.isRoundAbout()) { + // take next name for roundabout (not roundabout name) + while(lind < list.size() -1 && list.get(lind).getObject().roundabout()) { + lind++; + } } RouteSegmentResult next = list.get(lind); info.setRef(next.getObject().getRef());