簡體   English   中英

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM