Android Google Maps go to current location without

2020-08-11 04:09发布

I know this might be a little silly and I must have missed something but how do I disable that animation that zooms in all the way to my marker and load up google maps and my current location immediately?

This is my current code

@Override
    public void onLocationChanged(Location location) {
        currentLocation = location;
        String curr_location = currentLocation.getLatitude()+ ","+currentLocation.getLongitude();
        LatLng coordinates = new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude());
        CameraUpdate current = CameraUpdateFactory.newLatLngZoom(coordinates,15);
        googleMap.animateCamera(current);
        UpdateLocation(userid,email,curr_location);
    }

I'd like to remove the animate camera if possible. thanks!

1条回答
贼婆χ
2楼-- · 2020-08-11 04:33

Replace

googleMap.animateCamera(current);

with

googleMap.moveCamera(current);

(Reference)

查看更多
登录 后发表回答