OSM indoor layer: allow setting inactive levels color, closes #366

This commit is contained in:
Emux 2017-06-19 19:51:45 +03:00
parent 0eb53403d1
commit 3a3a58d273
2 changed files with 9 additions and 5 deletions

View File

@ -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)

View File

@ -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;
}
}