LocationTextureLayer improvements #547
This commit is contained in:
parent
9ac533846d
commit
bb69e6acbd
@ -30,6 +30,17 @@ public class LocationTextureLayer extends Layer {
|
|||||||
locationRenderer.setTextureRegion(textureRegion);
|
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) {
|
public void setPosition(double latitude, double longitude, float bearing, float accuracy) {
|
||||||
double x = MercatorProjection.longitudeToX(longitude);
|
double x = MercatorProjection.longitudeToX(longitude);
|
||||||
double y = MercatorProjection.latitudeToY(latitude);
|
double y = MercatorProjection.latitudeToY(latitude);
|
||||||
@ -38,5 +49,6 @@ public class LocationTextureLayer extends Layer {
|
|||||||
bearing += 360;
|
bearing += 360;
|
||||||
double radius = accuracy / MercatorProjection.groundResolutionWithScale(latitude, 1);
|
double radius = accuracy / MercatorProjection.groundResolutionWithScale(latitude, 1);
|
||||||
locationRenderer.setLocation(x, y, bearing, radius);
|
locationRenderer.setLocation(x, y, bearing, radius);
|
||||||
|
locationRenderer.animate(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ public class LocationTextureRenderer extends BucketRenderer {
|
|||||||
this.billboard = billboard;
|
this.billboard = billboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void animate(boolean enable) {
|
public void animate(boolean enable) {
|
||||||
if (runAnim == enable)
|
if (runAnim == enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user