Skip to content

Map.animateCamera()

Masashi Katsumata edited this page May 19, 2014 · 10 revisions

Change the camera position with animation.

###Description The map view is modeled as a camera looking down on a flat plane. The position of the camera (and hence the rendering of the map) is specified by CameraPosition

When you change the camera, you have the option of animating the resulting camera movement. The animation interpolates between the current camera attributes and the new camera attributes. Default animation time of animateCamera() method is 5 seconds.


###Code

var GOOGLE = new plugin.google.maps.LatLng(37.422858, -122.085065);
map.animateCamera({
  'target': GOOGLE,
  'tilt': 60,
  'zoom': 18,
  'bearing': 140,
  'duration': 5000 // = 5 sec.
}, function() {
  console.log("The animation is done");
});

Map.animateCamera()

Join the official community

New versions will be announced through the official community. Stay tune!

Do you have a question or feature request?

Feel free to ask me on the issues tracker.

Or on the official community is also welcome!


New version 2.0-beta2 is available.

The cordova-googlemaps-plugin v2.0 has more faster, more features.

https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md

Clone this wiki locally