Permalink
Browse files

Hillshading in style menu, fix #1095

  • Loading branch information...
devemux86 committed Dec 21, 2018
1 parent 5731196 commit 02e0a0cab89c8864e8d5f666db9c0e8ad524e9db
@@ -4,6 +4,7 @@

- Render themes: PNG scaling [#1090](https://github.com/mapsforge/mapsforge/issues/1090)
- Polyline scaled width [#1088](https://github.com/mapsforge/mapsforge/issues/1088)
- Hillshading in style menu [#1095](https://github.com/mapsforge/mapsforge/issues/1095)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/mapsforge/issues?q=is%3Aclosed+milestone%3A0.11.0)

@@ -1,7 +1,7 @@
/*
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014 Ludwig M Brinckmann
* Copyright 2014-2017 devemux86
* Copyright 2014-2018 devemux86
* Copyright 2017 usrusr
* Copyright 2017 MarcelHeckel
*
@@ -284,6 +284,7 @@ else if ("overlay".equals(qName)) {
}
} else if ("hillshading".equals(qName)) {
checkState(qName, Element.RULE);
String category = null;
byte minZoom = 5;
byte maxZoom = 17;
byte layer = 5;
@@ -294,7 +295,9 @@ else if ("overlay".equals(qName)) {
String name = pullParser.getAttributeName(i);
String value = pullParser.getAttributeValue(i);

if ("zoom-min".equals(name)) {
if ("cat".equals(name)) {
category = value;
} else if ("zoom-min".equals(name)) {
minZoom = XmlUtils.parseNonNegativeByte("zoom-min", value);
} else if ("zoom-max".equals(name)) {
maxZoom = XmlUtils.parseNonNegativeByte("zoom-max", value);
@@ -312,7 +315,10 @@ else if ("overlay".equals(qName)) {
int hillShadingLevel = this.level++;
Hillshading hillshading = new Hillshading(minZoom, maxZoom, magnitude, layer, always, hillShadingLevel, this.graphicFactory);

renderTheme.addHillShadings(hillshading);
if (this.categories == null || category == null
|| this.categories.contains(category)) {
this.renderTheme.addHillShadings(hillshading);
}
} else {
throw new XmlPullParserException("unknown element: " + qName);
}
@@ -272,6 +272,7 @@

<!-- hillshading element -->
<xs:complexType name="hillShading">
<xs:attribute name="cat" type="xs:string" use="optional" />
<xs:attribute name="zoom-min" default="5" type="xs:unsignedByte" use="optional" />
<xs:attribute name="zoom-max" default="17" type="xs:unsignedByte" use="optional" />
<xs:attribute name="magnitude" default="64" type="xs:unsignedByte" use="optional" />

0 comments on commit 02e0a0c

Please sign in to comment.