diff --git a/vtm/src/org/oscim/core/MapElement.java b/vtm/src/org/oscim/core/MapElement.java index 0cbc8ef2..5fded8ef 100644 --- a/vtm/src/org/oscim/core/MapElement.java +++ b/vtm/src/org/oscim/core/MapElement.java @@ -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); diff --git a/vtm/src/org/oscim/layers/tile/buildings/BuildingLayer.java b/vtm/src/org/oscim/layers/tile/buildings/BuildingLayer.java index 985b1f10..cf4cb8ec 100644 --- a/vtm/src/org/oscim/layers/tile/buildings/BuildingLayer.java +++ b/vtm/src/org/oscim/layers/tile/buildings/BuildingLayer.java @@ -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; }