diff --git a/OsmAnd/src/net/osmand/plus/routing/CurrentStreetName.java b/OsmAnd/src/net/osmand/plus/routing/CurrentStreetName.java index db7ba0763db..be2a1ca88f2 100644 --- a/OsmAnd/src/net/osmand/plus/routing/CurrentStreetName.java +++ b/OsmAnd/src/net/osmand/plus/routing/CurrentStreetName.java @@ -107,6 +107,9 @@ public boolean setupStreetName(@NonNull NextDirectionInfo info) { } else { shields = RoadShield.create(dataObject); } + if (shields.isEmpty()) { + destinationName = info.directionInfo.getDestinationRefAndName(); + } text = RoutingHelperUtils.formatStreetName(name, ref, destinationName, "", shields); turnType = info.directionInfo.getTurnType(); if (turnType == null) { diff --git a/OsmAnd/src/net/osmand/plus/routing/RoadShield.java b/OsmAnd/src/net/osmand/plus/routing/RoadShield.java index a7902fa4529..b793db0debb 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoadShield.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoadShield.java @@ -53,7 +53,7 @@ public static List create(@Nullable RouteDataObject rdo) { public static List createDestination(@Nullable RouteDataObject rdo, RouteDirectionInfo info) { List shields = create(rdo); String destRef = info.getDestinationRef(); - if (rdo != null && !Algorithms.isEmpty(destRef)) { + if (rdo != null && !Algorithms.isEmpty(destRef) && !shields.isEmpty()) { String refs = Algorithms.splitAndClearRepeats(destRef, ";"); List split = Arrays.asList(refs.split(";")); Map map = new HashMap<>(); @@ -68,10 +68,13 @@ public static List createDestination(@Nullable RouteDataObject rdo, } shields.clear(); + if (tag == null) { + return shields; + } for (String s : split) { RoadShield shield = map.get(s); if (shield == null) { - shield = new RoadShield(rdo, tag == null ? "route_road_" + s.length() + "_ref" : tag, s); + shield = new RoadShield(rdo, tag, s); shield.additional = additional; } shields.add(shield);