0

我有一张关于我的一项活动的地图。地图运行良好。但是,我想使用以下代码更改缩放和一些动画。然而,这些都没有回应。我错过了什么?谢谢!

googleMap.addMarker(new MarkerOptions().position(latLng).title(my_location.getLocationName()));

googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15));

// Zoom in, animating the camera.
googleMap.animateCamera(CameraUpdateFactory.zoomIn());

// Zoom out to zoom level 10, animating with a duration of 2 seconds.
googleMap.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);

CameraPosition cameraPosition = new CameraPosition.Builder()
.target(latLng)         // Sets the center of the map to my coordinates
.zoom(17)                   // Sets the zoom
.bearing(180)                // Sets the orientation of the camera to south
.tilt(30)                   // Sets the tilt of the camera to 30 degrees
.build();                   // Creates a CameraPosition from the builder

googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
4

0 回答 0