1

Here is an excerpt of my code:

if(myLocation != null) 
{
    double latitude = myLocation.getLatitude();
    double langitude = myLocation.getLongitude();
    LatLng currentLocation = new LatLng(latitude, langitude);
    mMap.moveCamera(CameraUpdateFactory.newLatLng(currentLocation));
    mMap.animateCamera(CameraUpdateFactory.zoomTo(16));          
}

Is there a reason the two last lines aren't doing anything? The whole map of Africa just displays when I run the program (with the current location).

Misa Lazovic
  • 2,805
  • 10
  • 32
  • 38
Jim Magee
  • 11
  • 1
  • are you sure that those two lines are hit? (debug/log) are you sure you call them after the map is ready? – N Dorigatti Feb 18 '16 at 15:34
  • [Answer from stack](http://stackoverflow.com/questions/19723017/android-google-map-move-camera-from-position-to-another) this may help – Aamir Ali Feb 18 '16 at 15:46
  • I managed to make it work, although I'm not sure why by changing it to: mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLocation, zoomLevel)); – Jim Magee Feb 18 '16 at 17:11

0 Answers0