I am developing an application using google map to display your location. I want to rotate the map around the location of users. I use getOrientation (R, orientation) (and set it to true north) to make the rotation of the device work fine, but I want the user's location to be at the bottom of the screen. I set the registration on the map to a quarter of the height of the screen.
mMap.setPadding(0,screenHeight/4,0,0);
What I noticed is that the rotation is still performed around a point in the center of the screen NOT filled by the center. This is the code I use in onSensorChanged
currentZoom = mMap.getCameraPosition().zoom;
CameraPosition currentPlace = new CameraPosition.Builder()
.target(new LatLng(currentNode.getLatitude(), currentNode.getLongitude()))
.bearing(degrees).tilt(60).zoom(currentZoom).build();
mMap.stopAnimation();
mMap.animateCamera(CameraUpdateFactory.newCameraPosition(currentPlace),40,null);
Is there any way to change the pivot point of the camera rotation?
source
share