Difference between public final void moveCamera (CameraUpdate update) and public final void animateCamera (CameraUpdate update)?

主宰稳场 提交于 2019-12-04 03:50:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!