You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
I've got suggestion about this issue, maybe it would be helpful.
Please take a look at public final void animateCamera(CameraUpdate update, int durationMs, final MapboxMap.CancelableCallback callback) method in MapboxMap class - shouldn't you invalidate camera position onFinish()/onCancel() like you do it here?:
public final CameraPosition getCameraPosition() {
if (mInvalidCameraPosition) {
invalidateCameraPosition();
}
return mCameraPosition;
}
After quick test I get proper value in OnCameraChangeListener parameter when I have sth like that:
public MapboxMap.CancelableCallback mCameraAnimationCallback = new MapboxMap.CancelableCallback() {
@Override
public void onCancel() {
onCameraAnimationFinished();
}
@Override
public void onFinish() {
onCameraAnimationFinished();
}
};
private void onCameraAnimationFinished() {
mIsCameraAnimation = false;
Timber.e("[MapObserver] Camera Animation - finish");
mMapboxMap.getCameraPosition();
}
Activity
mpuchala commentedon Mar 16, 2016
Hey,
I've got suggestion about this issue, maybe it would be helpful.
Please take a look at
public final void animateCamera(CameraUpdate update, int durationMs, final MapboxMap.CancelableCallback callback)method inMapboxMapclass - shouldn't you invalidate camera positiononFinish()/onCancel()like you do it here?:After quick test I get proper value in
OnCameraChangeListenerparameter when I have sth like that:tobrun commentedon Mar 21, 2016
@mpuchala indeed invalidating the cameraposition in onCancel and onFinish produces better results.
[android] #4326 - using the camera API vs getCameraPosition should re…
[android] #4326 - making the code compatible with unit tests again
[android] #4326 - using the camera API vs getCameraPosition should re…
[android] #4326 - making the code compatible with unit tests again
bleege commentedon Mar 21, 2016
Rebased and Merged into
release-ios-3.2.0-android-4.0.0.