Android GoogleMaps:放大/缩小动画不起作用

时间:2019-09-16 06:52:40

标签: android google-maps

我在Android应用中使用GoogleMaps,并且希望您用手指zoom out/in时获得流畅的动画。它正在工作,但是当我从显示屏上抬起手指时,它立即停止了工作。向左和向右滑动即可使用。它将自动移动,然后放慢速度。但是放大/缩小动画根本不起作用。

试图将这些参数设置为“ true”,但没有更改:

gmap.uiSettings.isZoomGesturesEnabled = true

奇怪的是它不起作用(动画)。根据{{​​3}},如果启用isZoomGesturesEnabled = true,它应与原始GoogleMaps完全一样。每个放大/缩小手势都可以按预期使用平滑的慢速动画。只有Two finger pinch/stretch不适用于动画。

更新:

为了更好地理解我的问题,

如果您在GoogleMap中滑动,则为动画

documentation

这是动画,如果您通过手势进行缩小(它会立即停止)。 我使用干净的项目,没有任何代码,只是基本的GoogleMap活动。

enter image description here

1 个答案:

答案 0 :(得分:0)

private static final LatLng SYDNEY = new LatLng(-33.88,151.21);
private static final LatLng MOUNTAIN_VIEW = new LatLng(37.4, -122.1);
private GoogleMap map;


// Move the camera instantly to Sydney with a zoom of 15.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(SYDNEY, 15));

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

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

有关详细信息,请点击此链接https://developers.google.com/maps/documentation/android-sdk/views