LocationTextureLayer improvements #547

This commit is contained in:
Emux 2018-06-30 22:14:52 +03:00
parent 9ac533846d
commit bb69e6acbd
No known key found for this signature in database
GPG Key ID: 64ED9980896038C3
2 changed files with 13 additions and 1 deletions

View File

@ -30,6 +30,17 @@ public class LocationTextureLayer extends Layer {
locationRenderer.setTextureRegion(textureRegion);
}
@Override
public void setEnabled(boolean enabled) {
if (enabled == isEnabled())
return;
super.setEnabled(enabled);
if (!enabled)
locationRenderer.animate(false);
}
public void setPosition(double latitude, double longitude, float bearing, float accuracy) {
double x = MercatorProjection.longitudeToX(longitude);
double y = MercatorProjection.latitudeToY(latitude);
@ -38,5 +49,6 @@ public class LocationTextureLayer extends Layer {
bearing += 360;
double radius = accuracy / MercatorProjection.groundResolutionWithScale(latitude, 1);
locationRenderer.setLocation(x, y, bearing, radius);
locationRenderer.animate(true);
}
}

View File

@ -140,7 +140,7 @@ public class LocationTextureRenderer extends BucketRenderer {
this.billboard = billboard;
}
private void animate(boolean enable) {
public void animate(boolean enable) {
if (runAnim == enable)
return;