Skip to content

Commit

Permalink
更新Gps移动定位算法
Browse files Browse the repository at this point in the history
  • Loading branch information
秋逸 committed Jul 13, 2018
1 parent b58e727 commit 8ce0d57
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ public void onLocationChanged(Location location) {
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
mGps = new Gps(mLongitude, mLatitude);
boolean isMove = false;
boolean isMove;
if (isFirstLocation) {
isMove = true;
isFirstLocation = false;
} else {
isMove = RxLocationTool.isMove(location, mLocationManager.getLastKnownLocation("fused"));
isMove = RxLocationTool.isMove(location, mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER));
}
setGpsInfo(location, isMove);
}
Expand Down Expand Up @@ -119,7 +120,7 @@ public void onProviderDisabled(String provider) {
}
};

mLocationManager.requestLocationUpdates("fused", 1000, 0, mLocationListener);
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, mLocationListener);
}

@Override
Expand Down

0 comments on commit 8ce0d57

Please sign in to comment.