I would like to make the camera behave as if you are using navigation, which means that when you rotate 90 ° to the left, the camera does the same.
I have a Google map showing my location (like a blue dot).
mGoogleMap.setMyLocationEnabled(true);
When I move, a blue dot with an arrow that shows my current bearing. I would like to get this bearing.
I get my current location using FusedLocationApi:
currentLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
Below is the animation code for the camera at its current location , but without a bearing. I can add a bearing, but I do not 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));
}
, ? . , .