guolindev/booksource

第十一章定位成功,但地图不移动

ShiremanSun opened this issue · 1 comments

第十一章定位成功,但地图不移动

private void navigateTo(BDLocation location) {
if (isFirstLocate) {
Toast.makeText(this, "nav to " + location.getAddrStr(), Toast.LENGTH_SHORT).show();
LatLng ll = new LatLng(location.getLatitude(), location.getLongitude());
MapStatus.Builder builder=new MapStatus.Builder();
builder.target(ll).zoom(18f);
baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));

        isFirstLocate = false;
    }

已解决,改成这样才可以。