[andriod] #4051 - add callback to move camera api

This commit is contained in:
Tobrun
2016-02-22 09:25:07 +01:00
parent 271d8df998
commit 565f4eff63

View File

@@ -152,11 +152,26 @@ public class MapboxMap {
*/
@UiThread
public final void moveCamera(CameraUpdate update) {
moveCamera(update, null);
}
/**
* Repositions the camera according to the instructions defined in the update.
* The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position.
* See CameraUpdateFactory for a set of updates.
*
* @param update The change that should be applied to the camera.
*/
@UiThread
public final void moveCamera(CameraUpdate update, MapboxMap.CancelableCallback callback) {
mCameraPosition = update.getCameraPosition(this);
mMapView.jumpTo(mCameraPosition.bearing, mCameraPosition.target, mCameraPosition.tilt, mCameraPosition.zoom);
if (mOnCameraChangeListener != null) {
mOnCameraChangeListener.onCameraChange(mCameraPosition);
}
if (callback != null) {
callback.onFinish();
}
}
/**