Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[andriod] #4051 - add callback to move camera api
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Feb 22, 2016
1 parent 271d8df commit 565f4ef
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,26 @@ public void setCameraPosition(@NonNull CameraPosition cameraPosition) {
*/
@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();
}
}

/**
Expand Down

0 comments on commit 565f4ef

Please sign in to comment.