forked from organicmaps/organicmaps-tmp
Fixed compass direction while moving.
This commit is contained in:
parent
9167542e94
commit
da58621aea
5 changed files with 11 additions and 8 deletions
|
@ -605,7 +605,7 @@ public class DownloadResourcesActivity extends MapsWithMeBaseActivity
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onDrivingHeadingUpdated(long time, double heading)
|
||||
public void onDrivingHeadingUpdated(long time, double heading, double accuracy)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
|
|
@ -892,8 +892,11 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onDrivingHeadingUpdated(long time, double heading)
|
||||
public void onDrivingHeadingUpdated(long time, double heading, double accuracy)
|
||||
{
|
||||
LocationUtils.correctCompassAngles(getWindowManager().getDefaultDisplay().getOrientation(), new double[]{heading});
|
||||
nativeCompassUpdated(time, heading, heading, accuracy);
|
||||
|
||||
if (mInfoView.getState() != State.HIDDEN)
|
||||
mInfoView.updateAzimuth(heading);
|
||||
}
|
||||
|
|
|
@ -770,7 +770,7 @@ public class SearchActivity extends MapsWithMeBaseListActivity implements Locati
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onDrivingHeadingUpdated(long time, double heading)
|
||||
public void onDrivingHeadingUpdated(long time, double heading, double accuracy)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ public class BookmarkListAdapter extends BaseAdapter
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onDrivingHeadingUpdated(long time, double heading)
|
||||
public void onDrivingHeadingUpdated(long time, double heading, double accuracy)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class LocationService implements
|
|||
|
||||
public void onCompassUpdated(long time, double magneticNorth, double trueNorth, double accuracy);
|
||||
|
||||
public void onDrivingHeadingUpdated(long time, double heading);
|
||||
public void onDrivingHeadingUpdated(long time, double heading, double accuracy);
|
||||
|
||||
public void onLocationError(int errorCode);
|
||||
}
|
||||
|
@ -125,11 +125,11 @@ public class LocationService implements
|
|||
it.next().onCompassUpdated(time, magneticNorth, trueNorth, accuracy);
|
||||
}
|
||||
|
||||
private void notifyDrivingHeadingUpdated(long time, double heading)
|
||||
private void notifyDrivingHeadingUpdated(long time, double heading, double accuracy)
|
||||
{
|
||||
final Iterator<LocationListener> it = mListeners.iterator();
|
||||
while (it.hasNext())
|
||||
it.next().onDrivingHeadingUpdated(time, heading);
|
||||
it.next().onDrivingHeadingUpdated(time, heading, accuracy);
|
||||
}
|
||||
|
||||
public void startUpdate(LocationListener listener)
|
||||
|
@ -223,7 +223,7 @@ public class LocationService implements
|
|||
private void emitCompassResults(long time, double north, double trueNorth, double offset)
|
||||
{
|
||||
if (mDrivingHeading >= 0.0)
|
||||
notifyDrivingHeadingUpdated(time, mDrivingHeading);
|
||||
notifyDrivingHeadingUpdated(time, mDrivingHeading, offset);
|
||||
else
|
||||
{
|
||||
if (Math.abs(Math.toDegrees(north - mLastNorth)) < NOISE_THRESHOLD)
|
||||
|
|
Loading…
Add table
Reference in a new issue