Android Google地图无需动画即可转到当前位置

Jia*_*nYA 12 android google-maps

我知道这可能有点傻,我一定错过了一些东西但是如何禁用那个放大到我的标记的动画并立即加载谷歌地图和我当前的位置?

这是我目前的代码

@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);
    }
Run Code Online (Sandbox Code Playgroud)

我想尽可能删除动画相机.谢谢!

Jua*_*ler 27

更换

googleMap.animateCamera(current);
Run Code Online (Sandbox Code Playgroud)

googleMap.moveCamera(current);
Run Code Online (Sandbox Code Playgroud)

(参考)