LocationTextureRenderer: add billboard rendering property (#549)

This commit is contained in:
Longri 2018-06-02 14:13:06 +02:00 committed by Emux
parent 94a2461741
commit 0fefd20cc6
No known key found for this signature in database
GPG Key ID: 64ED9980896038C3
2 changed files with 16 additions and 3 deletions

View File

@ -70,6 +70,9 @@ public class LocationTextureActivity extends BitmapTileActivity implements Locat
// set color of indicator circle (Color.RED is default)
locationLayer.locationRenderer.setIndicatorColor(Color.MAGENTA);
// set billboard rendering for TextureRegion (false is default)
locationLayer.locationRenderer.setBillboard(false);
locationLayer.setEnabled(false);
mMap.layers().add(locationLayer);
}

View File

@ -104,6 +104,7 @@ public class LocationTextureRenderer extends BucketRenderer {
private TextureRegion textureRegion;
private int accuracyColor = Color.BLUE;
private int viewShedColor = Color.RED;
private boolean billboard = false;
public LocationTextureRenderer(Map map) {
this.map = map;
@ -114,6 +115,10 @@ public class LocationTextureRenderer extends BucketRenderer {
this.accuracyColor = color;
}
public void setBillboard(boolean billboard) {
this.billboard = billboard;
}
public void setIndicatorColor(int color) {
this.viewShedColor = color;
}
@ -126,8 +131,13 @@ public class LocationTextureRenderer extends BucketRenderer {
this.radius = radius;
}
public void setTextureRegion(TextureRegion region) {
textureRegion = region;
public void setTextureRegion(TextureRegion textureRegion) {
this.textureRegion = textureRegion;
}
public void setTextureRegion(TextureRegion textureRegion, boolean billboard) {
this.textureRegion = textureRegion;
this.billboard = billboard;
}
private void animate(boolean enable) {
@ -243,7 +253,7 @@ public class LocationTextureRenderer extends BucketRenderer {
if (textureRegion == null)
return;
SymbolItem symbolItem = SymbolItem.pool.get();
symbolItem.set(symbolX, symbolY, textureRegion, this.bearing, false);
symbolItem.set(symbolX, symbolY, textureRegion, this.bearing, this.billboard);
symbolItem.offset = CENTER_OFFSET;
symbolBucket.pushSymbol(symbolItem);