如果用户按下地图右上角的MyLocation按钮,我不会这样做,必须以这种方式设置缩放:
implements OnMyLocationButtonClickListener
.
.
.
mMap.setMyLocationEnabled(true);
.
.
.
@Override
public boolean onMyLocationButtonClick() {
if (mMap.getCameraPosition().zoom<16){
Log.d("XXXX","Zoom is "+mMap.getCameraPosition().zoom+" so animating it to 16");
mMap.animateCamera(CameraUpdateFactory.zoomTo(16));
}
return false;
}
日志正确打印这样的行:
Zoom is 13.0 so animating it to 16
Zoom is 11.0 so animating it to 16
.
.
.
但缩放不变,按钮只是将屏幕居中到用户蓝点位置而不应用缩放。
代码中有问题吗?
谢谢