Speedup location via gms
This commit is contained in:
parent
8c2e506105
commit
1b9eb9a6e1
2 changed files with 5 additions and 3 deletions
|
@ -63,11 +63,11 @@ public class LocationServiceHelperImpl extends LocationServiceHelper {
|
||||||
|
|
||||||
// Sets the fastest rate for active location updates. This interval is exact, and your
|
// Sets the fastest rate for active location updates. This interval is exact, and your
|
||||||
// application will never receive updates more frequently than this value.
|
// application will never receive updates more frequently than this value.
|
||||||
.setFastestInterval(50)
|
//.setFastestInterval(50)
|
||||||
|
|
||||||
// Sets the maximum time when batched location updates are delivered. Updates may be
|
// Sets the maximum time when batched location updates are delivered. Updates may be
|
||||||
// delivered sooner than this interval.
|
// delivered sooner than this interval.
|
||||||
.setMaxWaitTime(200)
|
.setMaxWaitTime(0)
|
||||||
|
|
||||||
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,9 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
}
|
}
|
||||||
// Issue 5538: Some devices return positives for hasBearing() at rest, hence add 0.0 check:
|
// Issue 5538: Some devices return positives for hasBearing() at rest, hence add 0.0 check:
|
||||||
boolean isBearing = lastKnownLocation.hasBearing() && (lastKnownLocation.getBearing() != 0.0);
|
boolean isBearing = lastKnownLocation.hasBearing() && (lastKnownLocation.getBearing() != 0.0)
|
||||||
|
&& (!lastKnownLocation.hasSpeed() || lastKnownLocation.getSpeed() > 0.1);
|
||||||
|
|
||||||
if (!locationOutdated && isBearing) {
|
if (!locationOutdated && isBearing) {
|
||||||
float bearing = lastKnownLocation.getBearing();
|
float bearing = lastKnownLocation.getBearing();
|
||||||
canvas.rotate(bearing - 90, locationX, locationY);
|
canvas.rotate(bearing - 90, locationX, locationY);
|
||||||
|
|
Loading…
Reference in a new issue