问题
What is the difference between the methods
public final void moveCamera (CameraUpdate update) and public final void animateCamera (CameraUpdate update)
of GoogleMap class?
When should I call getCameraPosition()?
回答1:
The difference between those two is that:
animateCamera
will animate the camera to the desired position with a smooth animation, while moveCamera
will move the camera to the desired position instantly.
Edit:
From the docs of CameraPosition:
An immutable class that aggregates all camera position parameters.
basicly it contains all the data of the camera position like: bearing, tilt, target and zoom.
By running getCameraPosition()
you can get this CameraPosition object.
回答2:
Reading and understanding the documentation is the basic of software development.
animateCamera(CameraUpdate update)
Animates the movement of the camera from the current position to the position defined in the update.
moveCamera(CameraUpdate update)
Repositions the camera according to the instructions defined in the update.
来源:https://stackoverflow.com/questions/19114742/difference-between-public-final-void-movecamera-cameraupdate-update-and-public