Swapnil Swapnil - 1 month ago 19
Android Question

What is the difference b/w animateCamera and moveCamera in google V2 maps?

Hi guys while doing a sample project on android v2 maps for setting the current location. I came across couple of lines

//what does this line do?
mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
//this line will animate to the provided lat and lon values
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(mLastLocation.getLatitude(), mLastLocation.getLongitude()), 16.0f));


what does mMap.moveCamera do?? I did not see any apparent visual changes as compared to the other line.
What is the main difference between the two? moveCamera seems similar to animateCamera IMO.

Answer
  • animateCamera: Map moves to the given location (or list of locations) using an animation, including zooming out and then zooming in to the new location (if the two points are far from each other).
  • moveCamera: Map changes focus to the given the given location (or list of locations) without animation, in a single frame change.
Comments