1

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.

Swapnil Kadam
  • 4,075
  • 5
  • 29
  • 35

1 Answers1

11
  • 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.
Neria Nachum
  • 1,519
  • 1
  • 20
  • 37