本文介绍了Android Google地图无需动画即可前往当前位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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!

推荐答案

替换

Replace

googleMap.animateCamera(current);

with

with

googleMap.moveCamera(current);

这篇关于Android Google地图无需动画即可前往当前位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 14:21