I would like to force the camera to behave like you are using navigation, it means when you rotate 90° left, the camera does the same thing.
I have a Google Map where my location (as a blue dot) is shown.
mGoogleMap.setMyLocationEnabled(true);
When I am moving, blue dot is with an arrow which shows my current bearing. I would like to get this bearing.
I am getting my current location using FusedLocationApi:
currentLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
Code below is animating camera to current location, but without the bearing. I can add the bearing, but I don't know the value.
@Override
public void onLocationChanged(Location location) {
LatLng latLng = new LatLng( location.getLatitude(), location.getLongitude() );
mGoogleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
mGoogleMap.animateCamera(CameraUpdateFactory.zoomTo(15));
}
Do you know how to get the current location direction? I was unable to find any proper information about that. I would greatly appreciate any help you can give me.
Thank you