Martin
Martin

Reputation: 2914

Android GoogleMaps: Zoom in / out animation not working

I'm using GoogleMaps in my Android App and I want to have that smooth animation when you zoom out/in with your fingers. It is working but itimmediately stopd as I lift my fingers from display. Swipe to left and right is working. It will move automatically and then slow down. But zoom in/out animation is not working at all.

Tried to set these parameters to 'true' but without changes:

gmap.uiSettings.isZoomGesturesEnabled = true

Its weird that it doesnt work (animation). According to documentation it should work exactly as original GoogleMaps if you enable isZoomGesturesEnabled = true. Every single zoom in/out gesture is working with smooth slow-down animation as expected. Only Two finger pinch/stretch doesnt work with animation.

UPDATE:

To better understand my problem:

Here is animation if you swipe in GoogleMap

enter image description here

Here is animation if you zoom out by gesture (it stops immediately). I used clean project without any code, just basic GoogleMap activity.

enter image description here

Upvotes: 3

Views: 1278

Answers (1)

Vinay
Vinay

Reputation: 767

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);

for details follow this link https://developers.google.com/maps/documentation/android-sdk/views

Upvotes: 2

Related Questions