From 34d267ad568f55190d900ca1bbd74a55d374d1a0 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Fri, 23 Aug 2013 16:11:52 +0200 Subject: [PATCH] take next name for roundabout (not roundabout name) --- .../plus/routing/RouteCalculationResult.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java index e0bd9a659d..49c4df613b 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java @@ -246,14 +246,19 @@ public class RouteCalculationResult { if(turn != null) { RouteDirectionInfo info = new RouteDirectionInfo(s.getSegmentSpeed(), turn); - if(routeInd + 1< list.size()) { - RouteSegmentResult next = list.get(routeInd); - info.setRef(next.getObject().getRef()); - info.setStreetName(next.getObject().getName()); - info.setDestinationName(next.getObject().getDestinationName()); - } - - String description = toString(turn, ctx) + " " + RoutingHelper.formatStreetName(info.getStreetName(), + if (routeInd + 1 < list.size()) { + int lind = routeInd; + if(turn.isRoundAbout() && routeInd + 2 < list.size()) { + // take next name for roundabout (not roundabout name) + lind = routeInd + 1; + } + RouteSegmentResult next = list.get(lind); + info.setRef(next.getObject().getRef()); + info.setStreetName(next.getObject().getName()); + info.setDestinationName(next.getObject().getDestinationName()); + } + + String description = toString(turn, ctx) + " " + RoutingHelper.formatStreetName(info.getStreetName(), info.getRef(), info.getDestinationName()); info.setDescriptionRoute(description); info.routePointOffset = prevLocationSize;