O'Reilly logo

Learning Android Google Maps by Raj Amal W.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating the camera

In the previous sections, we used the moveCamera() method on the GoogleMap object. It changes the camera and updates the view immediately. You may have noted that, during the transformation, there is no animation and it is not smooth. So, in order to make smoother transformations, we need to use animations.

Using animation is very simple. Replace the moveCamera() method with the animateCamera() method. It would be similar to:

        map.animateCamera(CameraUpdateFactory.scrollBy(10,0));

To get more control over the animation, we can use the same animateCamera() method with more parameters. They are as follows:

  • The CameraUpdate object: This is the first parameter, which is same as the one used in the moveCamera() method.
  • Duration: This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required