Moving the camera
The Google Maps API helps us to move from one visible region to another. This can be done by changing the camera view.
The camera view changing from one location to another can be animated. The duration of the animation can also be controlled.
To achieve this, we need to obtain the CameraUpdate
object from the CameraUpdateFactory
class.
The different ways to animate the camera views are as follows:
Changing zoom levels in the current position
Changing the camera position
Setting boundaries for the view
Panning the map
Changing the zoom level in the current position
Let's discuss the different methods used to change the zoom level. These methods should be called on the CameraUpdateFactory
class to obtain the CameraUpdate
object:
Method |
Parameter |
Function |
---|---|---|
|
None |
This increases the zoom level by 1. Other properties remain the same. |
|
None |
This decreases the zoom level by 1. Other properties remain the same. |
|
Zoom level in float |
This changes the zoom... |