diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/net/osmand/binary/BinaryMapIndexReader.java index 3dca8e5f6f..49a2836dd1 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryMapIndexReader.java @@ -1568,6 +1568,7 @@ public class BinaryMapIndexReader { Map > encodingRules = new HashMap >(); TIntObjectMap decodingRules = new TIntObjectHashMap(); public int nameEncodingType = 0; + public int nameEnEncodingType = -1; public int refEncodingType = -1; public int coastlineEncodingType = -1; public int coastlineBrokenEncodingType = -1; @@ -1624,6 +1625,8 @@ public class BinaryMapIndexReader { onewayReverseAttribute = id; } else if("ref".equals(tag)){ refEncodingType = id; + } else if("name:en".equals(tag)){ + nameEnEncodingType = id; } else if("tunnel".equals(tag)){ negativeLayers.add(id); } else if("bridge".equals(tag)){ diff --git a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java index d50a3c31a5..796849ca5c 100644 --- a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java @@ -358,14 +358,24 @@ public class TextRenderer { public void renderText(final BinaryMapDataObject obj, final RenderingRuleSearchRequest render, final RenderingContext rc, final TagValuePair pair, final float xMid, final float yMid, final Path path, final PointF[] points) { - TIntObjectHashMap map = obj.getObjectNames(); + final TIntObjectHashMap map = obj.getObjectNames(); if (map != null) { map.forEachEntry(new TIntObjectProcedure() { @Override public boolean execute(int tag, String name) { if (name != null && name.trim().length() > 0) { - createTextDrawInfo(obj, render, rc, pair, xMid, yMid, path, points, name, tag == obj.getMapIndex().nameEncodingType ? "" - : obj.getMapIndex().decodeType(tag).tag); + boolean isName = tag == obj.getMapIndex().nameEncodingType; + String nameTag = isName ? "" : obj.getMapIndex().decodeType(tag).tag; + boolean skip = false; + if (isName && rc.useEnglishNames && map.containsKey(obj.getMapIndex().nameEnEncodingType)) { + skip = true; + } + if (tag == obj.getMapIndex().nameEnEncodingType && !rc.useEnglishNames) { + skip = true; + } + if(!skip) { + createTextDrawInfo(obj, render, rc, pair, xMid, yMid, path, points, name, nameTag); + } } return true; }