Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class PrivyMapsFragment extends Fragment implements OnMapReadyCallback, G
private LocationRequest mLocationRequest;
private static int UPDATE_INTERVAL = 10000; // 10 sec
private static int FATEST_INTERVAL = 5000; // 5 sec
private static int DISPLACEMENT = 10; // 10 meters
private static int DISPLACEMENT = 50; // 50 meters

// My location
private Location myLocationData;
Expand Down Expand Up @@ -156,10 +156,14 @@ private void getMyCurrentLocation() {
myLocationData = getCurrentLocation();
if (myLocationData != null) {

float bearing = 0;
if(myLocationData.hasBearing())
bearing = myLocationData.getBearing();

MY_LOCATION_CAMERA_POS = new CameraPosition.Builder()
.target(new LatLng(myLocationData.getLatitude(), myLocationData.getLongitude()))
.zoom(15.0f)
.bearing(0)
.bearing(bearing)
.tilt(25)
.build();

Expand Down Expand Up @@ -270,7 +274,7 @@ protected void createLocationRequest() {
mLocationRequest.setInterval(UPDATE_INTERVAL);
mLocationRequest.setFastestInterval(FATEST_INTERVAL);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setSmallestDisplacement(DISPLACEMENT); // 10 meters
mLocationRequest.setSmallestDisplacement(DISPLACEMENT); // 50 meters
}

private void startLocationUpdates() {
Expand All @@ -286,6 +290,7 @@ private void stopLocationUpdates() {

@Override
public void onLocationChanged(Location location) {
myLocationData = location;
getMyCurrentLocation();
}

Expand Down