[英]How to animate the camera to a specified location in Google Maps v2 for Android?
[英]android google maps animate the camera slowly to my location
我需要在 android 中缓慢地将相机移动到我的位置,我使用下面的代码,但相机从一个位置更改为另一个位置,例如在页面之间切换。 这是我的代码
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(location1)
.zoom(16)
.bearing(90)
.tilt(30)
.build();
googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), 10000, null);
CameraUpdate center=
CameraUpdateFactory.newLatLng(location1);
// CameraUpdate zoomcam=CameraUpdateFactory.zoomTo(zoom);
googleMap.moveCamera(center);
只需删除googleMap.moveCamera(center);
. 只使用googleMap.animateCamera(center);
.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.