From 977aa6b26a84e19fa5e1b3e283977eac51241bdc Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 7 Dec 2016 22:17:38 +0100 Subject: [PATCH] Add ignore polygon as point area --- .../src/net/osmand/render/RenderingRuleSearchRequest.java | 7 +++++++ .../net/osmand/render/RenderingRuleStorageProperties.java | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRuleSearchRequest.java b/OsmAnd-java/src/net/osmand/render/RenderingRuleSearchRequest.java index 56d04b461a..4c7f7a07a7 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRuleSearchRequest.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRuleSearchRequest.java @@ -199,6 +199,8 @@ public class RenderingRuleSearchRequest { } else if(isSpecified(storage.PROPS.R_ATTR_INT_VALUE)){ values[rp.getId()] = getIntPropertyValue(storage.PROPS.R_ATTR_INT_VALUE); fvalues[rp.getId()] = getFloatPropertyValue(storage.PROPS.R_ATTR_INT_VALUE); + } else if(isSpecified(storage.PROPS.R_ATTR_BOOL_VALUE)){ + values[rp.getId()] = getIntPropertyValue(storage.PROPS.R_ATTR_BOOL_VALUE); } } else if (rp.isFloat()) { fvalues[rp.getId()] = rule.getFloatProp(i); @@ -278,6 +280,11 @@ public class RenderingRuleSearchRequest { return values[property.getId()]; } + public boolean getBoolPropertyValue(RenderingRuleProperty property) { + int val = values[property.getId()]; + return val != -1 && val != 0; + } + public int getIntPropertyValue(RenderingRuleProperty property, int defValue) { int val = values[property.getId()]; return val == -1 ? defValue : val; diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRuleStorageProperties.java b/OsmAnd-java/src/net/osmand/render/RenderingRuleStorageProperties.java index 65dec45e19..e4d65a7386 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRuleStorageProperties.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRuleStorageProperties.java @@ -305,8 +305,8 @@ public class RenderingRuleStorageProperties { R_SHADOW_RADIUS = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(SHADOW_RADIUS)); R_ONEWAY_ARROWS_COLOR = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(ONEWAY_ARROWS_COLOR)); - R_ADD_POINT = registerRuleInternal(RenderingRuleProperty.createOutputIntProperty(ADD_POINT)); - R_IGNORE_POLYGON_AS_POINT_AREA = registerRuleInternal(RenderingRuleProperty.createOutputIntProperty(IGNORE_POLYGON_AS_POINT_AREA)); + R_ADD_POINT = registerRuleInternal(RenderingRuleProperty.createOutputBooleanProperty(ADD_POINT)); + R_IGNORE_POLYGON_AS_POINT_AREA = registerRuleInternal(RenderingRuleProperty.createOutputBooleanProperty(IGNORE_POLYGON_AS_POINT_AREA)); } public RenderingRuleProperty get(String name) {