From 356773d6fffa7d2e6b0f88e5d80bda717f57c9f7 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 8 Jan 2015 01:15:47 +0100 Subject: [PATCH] Update rendering additional --- .../osmand/render/RenderingRuleProperty.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRuleProperty.java b/OsmAnd-java/src/net/osmand/render/RenderingRuleProperty.java index 09af86b0f1..35471fb47d 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRuleProperty.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRuleProperty.java @@ -3,6 +3,7 @@ package net.osmand.render; import net.osmand.PlatformUtil; import net.osmand.binary.BinaryMapDataObject; +import net.osmand.binary.BinaryMapIndexReader.TagValuePair; import org.apache.commons.logging.Log; @@ -283,16 +284,27 @@ public class RenderingRuleProperty { return val != null && val.equals(val2); } - int i = val.indexOf('='); - if (i != -1) { - String ts = val.substring(0, i); - String vs = val.substring(i + 1); + int k = val.indexOf('='); + if (k != -1) { + String ts = val.substring(0, k); + String vs = val.substring(k + 1); Integer ruleInd = req.getObject().getMapIndex().getRule(ts, vs); if (ruleInd != null) { if (req.getObject().containsAdditionalType(ruleInd)) { return true; } } + } else { + String ts = val.substring(0, k); + if (ts != null) { + int[] additionalTypes = obj.getAdditionalTypes(); + for (int i = 0; i < additionalTypes.length; i++) { + TagValuePair vp = obj.getMapIndex().decodeType(additionalTypes[i]); + if (vp != null && ts.equals(vp.tag)) { + return true; + } + } + } } return false; }