![](/img/trans.png)
[英]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.