diff --git a/docs/Changelog.md b/docs/Changelog.md index fb9baf0b..46a0b890 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -15,6 +15,7 @@ - Fix coord scale short overflow [#343](https://github.com/mapsforge/vtm/issues/343) - Mapsforge map read improvements [#357](https://github.com/mapsforge/vtm/issues/357) - Improve canvas DPI setting [#349](https://github.com/mapsforge/vtm/issues/349) +- OSM indoor layer enhancements [#366](https://github.com/mapsforge/vtm/issues/366) - Gretty plugin at web modules [#338](https://github.com/mapsforge/vtm/issues/338) - Many other minor improvements and bug fixes - [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.8.0) diff --git a/vtm-jeo/src/org/oscim/layers/OSMIndoorLayer.java b/vtm-jeo/src/org/oscim/layers/OSMIndoorLayer.java index 55ac9869..4f78a18b 100644 --- a/vtm-jeo/src/org/oscim/layers/OSMIndoorLayer.java +++ b/vtm-jeo/src/org/oscim/layers/OSMIndoorLayer.java @@ -105,8 +105,8 @@ public class OSMIndoorLayer extends JeoVectorLayer { float width = rule.number(f, CartoCSS.LINE_WIDTH, 1.2f); int color = Color.rainbow((level + 1) / 10f); - if (level > -2 && !active) - color = Color.fade(color, 0.1f); + if (/*level > -2 && */!active) + color = getInactiveColor(color); ll.line = new LineStyle(0, color, width); ll.heightOffset = level * 4; @@ -116,8 +116,8 @@ public class OSMIndoorLayer extends JeoVectorLayer { MeshBucket mesh = t.buckets.getMeshBucket(level * 3); if (mesh.area == null) { int color = JeoUtils.color(rule.color(f, CartoCSS.POLYGON_FILL, RGB.red)); - if (level > -2 && !active) - color = Color.fade(color, 0.1f); + if (/*level > -2 && */!active) + color = getInactiveColor(color); mesh.area = new AreaStyle(color); //mesh.area = new Area(Color.fade(Color.DKGRAY, 0.1f)); @@ -152,6 +152,10 @@ public class OSMIndoorLayer extends JeoVectorLayer { } + protected int getInactiveColor(int color) { + return Color.fade(color, 0.1f); + } + private int getLevel(Feature f) { /* not sure if one could match these geojson properties with cartocss */ Object o = f.get("@relations"); @@ -177,5 +181,4 @@ public class OSMIndoorLayer extends JeoVectorLayer { return 0; } - }