Fix problem with road shield

This commit is contained in:
Victor Shcherb 2020-05-13 16:56:37 +02:00
parent 83d06a5efc
commit 7c204fde16

View file

@ -1138,16 +1138,23 @@ public class MapInfoWidgetsFactory {
for (int i = 0; i < object.nameIds.length; i++) { for (int i = 0; i < object.nameIds.length; i++) {
String key = object.region.routeEncodingRules.get(object.nameIds[i]).getTag(); String key = object.region.routeEncodingRules.get(object.nameIds[i]).getTag();
String val = object.names.get(object.nameIds[i]); String val = object.names.get(object.nameIds[i]);
if (key.startsWith("road_ref")) { if (!key.startsWith("road_ref")) {
nameTag = key;
name = val;
} else {
additional.append(key).append("=").append(val).append(";"); additional.append(key).append("=").append(val).append(";");
} }
} }
if(name == null || nameTag == null) { for (int i = 0; i < object.nameIds.length; i++) {
String key = object.region.routeEncodingRules.get(object.nameIds[i]).getTag();
String val = object.names.get(object.nameIds[i]);
if (key.startsWith("road_ref")) {
boolean visible = setRoadShield(view, object, key, val, additional);
if(visible) {
return true;
}
}
}
return false; return false;
} }
private boolean setRoadShield(ImageView view, RouteDataObject object, String nameTag, String name, StringBuilder additional ) {
Context context = topBar.getContext(); Context context = topBar.getContext();
int[] tps = object.getTypes(); int[] tps = object.getTypes();