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

Invalidate the camera position when gesture finishes #13920

Merged
merged 1 commit into from
Feb 13, 2019

Conversation

LukasPaczos
Copy link
Member

Users have reported an issue, where fetching current camera position from
OnCameraIdleListener#onCameraIdle after gesture execution would not be up to date. For example, below calls to map.getCameraPosition().zoom might've resulted in slightly different values after zooming in/out.

map.addOnCameraIdleListener(() -> {
  new Handler().postDelayed(() -> Log.i("Test", "Delay at " +  map.getCameraPosition().zoom), 32);
  Log.i("Test", "Idled at " +  map.getCameraPosition().zoom);
});

During any gesture execution, we were invalidating the camera position only when the frame has been rendered, which is not guaranteed to happen before #onCameraIdle is delivered. We should invalidate before delivering that event to ensure consistency.

@LukasPaczos LukasPaczos added the Android Mapbox Maps SDK for Android label Feb 13, 2019
@LukasPaczos LukasPaczos added this to the release-kombucha milestone Feb 13, 2019
@LukasPaczos LukasPaczos merged commit 98eac18 into master Feb 13, 2019
@LukasPaczos LukasPaczos deleted the lp-invalidate-camera-when-gesture-finishes branch February 13, 2019 12:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants