Tag transform: check theme existence, #420

This commit is contained in:
Emux
2018-10-21 17:29:38 +03:00
parent 292c092be3
commit 6a2b2afdba
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -66,7 +66,7 @@ public class MapElement extends GeometryBuffer {
* @return height in meters, if present
*/
public Float getHeight(IRenderTheme theme) {
String res = theme.transformKey(Tag.KEY_HEIGHT);
String res = theme != null ? theme.transformKey(Tag.KEY_HEIGHT) : Tag.KEY_HEIGHT;
String v = tags.getValue(res != null ? res : Tag.KEY_HEIGHT);
if (v != null)
return Float.parseFloat(v);
@@ -77,7 +77,7 @@ public class MapElement extends GeometryBuffer {
* @return minimum height in meters, if present
*/
public Float getMinHeight(IRenderTheme theme) {
String res = theme.transformKey(Tag.KEY_MIN_HEIGHT);
String res = theme != null ? theme.transformKey(Tag.KEY_MIN_HEIGHT) : Tag.KEY_MIN_HEIGHT;
String v = tags.getValue(res != null ? res : Tag.KEY_MIN_HEIGHT);
if (v != null)
return Float.parseFloat(v);
@@ -244,6 +244,8 @@ public class BuildingLayer extends Layer implements TileLoaderThemeHook, ZoomLim
}
protected String getKeyOrDefault(String key) {
if (mRenderTheme == null)
return key;
String res = mRenderTheme.transformKey(key);
return res != null ? res : key;
}