Tag transform: check theme existence, #420
This commit is contained in:
parent
292c092be3
commit
6a2b2afdba
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user