OSMIndoorLayer: add style scaling #355

This commit is contained in:
Emux 2017-06-02 21:54:29 +03:00
parent dce7886447
commit f669022ca3
2 changed files with 11 additions and 5 deletions

View File

@ -94,7 +94,7 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
VectorDataset data = JeoTest.readGeoJson(is);
Style style = JeoTest.getStyle();
mIndoorLayer = new OSMIndoorLayer(mMap, data, style);
mIndoorLayer = new OSMIndoorLayer(mMap, data, style, getResources().getDisplayMetrics().density);
mMap.layers().add(mIndoorLayer);
showToast("data ready");

View File

@ -43,13 +43,19 @@ import java.util.HashMap;
public class OSMIndoorLayer extends JeoVectorLayer {
protected TextBucket mTextLayer;
protected TextStyle mText = TextStyle.builder()
.fontSize(16).color(Color.BLACK)
.strokeWidth(2.2f).strokeColor(Color.WHITE)
.build();
protected TextStyle mText;
public OSMIndoorLayer(Map map, VectorDataset data, Style style) {
this(map, data, style, 1);
}
public OSMIndoorLayer(Map map, VectorDataset data, Style style, float scale) {
super(map, data, style);
mText = TextStyle.builder()
.fontSize(16 * scale).color(Color.BLACK)
.strokeWidth(2.2f * scale).strokeColor(Color.WHITE)
.build();
}
public boolean[] activeLevels = new boolean[10];