Mapsforge themes don't support (-) 'exclusive negation', fix #407

This commit is contained in:
Emux 2017-09-24 12:41:53 +03:00
parent 0046f5c159
commit 324a1c309c
2 changed files with 10 additions and 3 deletions

View File

@ -423,7 +423,7 @@ public class XmlMapsforgeThemeBuilder extends DefaultHandler {
if (zoomMin > zoomMax)
throw new ThemeException("zoom-min must be less or equal zoom-max: " + zoomMin);
RuleBuilder b = RuleBuilder.create(keys, values);
RuleBuilder b = RuleBuilder.create(keys, values, true);
b.cat(cat);
b.zoom(zoomMin, zoomMax);
b.element(element);

View File

@ -1,6 +1,6 @@
/*
* Copyright 2014 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2017 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@ -86,6 +86,13 @@ public class RuleBuilder {
}
public static RuleBuilder create(String keys, String values) {
return create(keys, values, false);
}
/**
* Mapsforge themes don't support (-) 'exclusive negation'.
*/
public static RuleBuilder create(String keys, String values, boolean isMapsforge) {
String[] keyList = EMPTY_KV;
String[] valueList = EMPTY_KV;
@ -97,7 +104,7 @@ public class RuleBuilder {
if (values.length() > 2)
valueList = values.substring(2)
.split(SEPARATOR);
} else if (values.startsWith(STRING_EXCLUSIVE)) {
} else if (values.startsWith(STRING_EXCLUSIVE) && !isMapsforge) {
type = RuleType.EXCLUDE;
if (values.length() > 2)
valueList = values.substring(2)