[android] #4327 - OnDoubleTap needs to trigger camera invalidation after a zoom occurs

This commit is contained in:
Tobrun
2016-03-21 15:08:06 +01:00
parent 7155c9bb81
commit ca565a2cb2

View File

@@ -694,6 +694,9 @@ public class MapView extends FrameLayout {
} else {
mNativeMapView.scaleBy(0.5, x / mScreenDensity, y / mScreenDensity, MapboxConstants.ANIMATION_DURATION);
}
// work around to invalidate camera position
postDelayed(new ZoomInvalidator(mMapboxMap), MapboxConstants.ANIMATION_DURATION);
}
//
@@ -2543,6 +2546,21 @@ public class MapView extends FrameLayout {
}
}
private static class ZoomInvalidator implements Runnable{
private MapboxMap mapboxMap;
public ZoomInvalidator(MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
}
@Override
public void run() {
// invalidate camera position
mapboxMap.getCameraPosition();
}
}
/**
* Definition of a map change event.
*