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.
[android] new camera move listeners fire in wrong order #9177
Callbacks are called in order: onCameraMoveStarted() -> onCameraMove() -> onCameraIdle()
Actual behavior
Camera movement finishes with onCameraMoveStarted() or onCameraMove(), or fires infinitely with onCameraMove() callback sometimes mixed up with onCameraMoveCanceled(), or any other combination. It looks really inconsistent.
the OnCameraMoveStarted call was placed above the following codeblock:
if (velocityXY < MapboxConstants.VELOCITY_THRESHOLD_IGNORE_FLING) {
// ignore short flings, these can occur when other gestures just have finished executingreturnfalse;
}
While it only should be invoked when the fling isn't ignored.
When setting TRACKING_FOLLOW callbacks seemed to be infinite because when we are changing tracking mode to TRACKING_FOLLOW camera is beaing eased to current position and animation duration is being calculated like this animationDuration = (int) ((locationUpdateTimestamp - previousUpdateTimeStamp) * 1.1f)butpreviousUpdateTimeStamp and locationUpdateTimestamp are not being cleared when selecting TRACKING_FOLLOW again, therefore animationDuration is made extremely long which looked like infinite.
Hey @Hassan-Fa, I've tested current implementation and I'm unable to reproduce a scenario when canceled isn't followed by idle, which I understand is the issue. Could you provide a reproducible example (I'm aware this might be hard) or do some debugging on your side, especially the logic in the CameraChangeDispatcher?
Activity
tobrun commentedon Jun 6, 2017
It seems that a
OnCameraMoveStartedis called as a result of idle, this seems the source of the misplacedOnCameraMoveCanceled.tobrun commentedon Jun 6, 2017
the OnCameraMoveStarted call was placed above the following codeblock:
While it only should be invoked when the fling isn't ignored.
tobrun commentedon Jun 6, 2017
Related to the OP with ease/animate camera. I'm only seeing expected behaviour:
or
LukasPaczos commentedon Jun 6, 2017
When camera is in an idle state and I use this code:
I'm getting such callbacks:
There is no call to
onCameraIdle(). I'm able to reproduce it every time.Callbacks being finished with
onCameraMoveStarted()is resolved by #9192 :)tobrun commentedon Jun 6, 2017
Thanks for adding the specific easeCamera definition, will try reproducing for #9192.
LukasPaczos commentedon Jun 6, 2017
When setting
TRACKING_FOLLOWcallbacks seemed to be infinite because when we are changing tracking mode toTRACKING_FOLLOWcamera is beaing eased to current position and animation duration is being calculated like thisanimationDuration = (int) ((locationUpdateTimestamp - previousUpdateTimeStamp) * 1.1f)butpreviousUpdateTimeStampandlocationUpdateTimestampare not being cleared when selectingTRACKING_FOLLOWagain, thereforeanimationDurationis made extremely long which looked like infinite.[android] - dealing with infinite camera move callbacks (mapbox#9177)
tobrun commentedon Jun 6, 2017
re.
map.easeCamera(CameraUpdateFactory.newLatLng(new LatLng(39.489309, -0.360415)), 1000, true, null, true);The source of this seems to be providing a null callback. Fixing up code to conform to this.
[android] - dealing with infinite camera move callbacks (#9177) (#9194)
tobrun commentedon Jun 6, 2017
Both #9194 and #9192 were merged to the release branch. Closing.
Merge branch 'release-ios-v3.6.0-android-v5.1.0' into merge_mapbox_v5_1
Merge release-ios-v3.6.0-android-v5.1.0 (#9416)
Hassan-Fa commentedon Oct 10, 2018
i'm having the same issue with SDK 6.6.0-alpha.2 & 6.4.0 & 6.5.0
setting the map OnIdleListener but acts like OnMoveListener
but not indefinite callBcaks
E/MapChangeListenerLogTAG: MoveStarted && int : 3
E/MapChangeListenerLogTAG: Move
E/MapChangeListenerLogTAG: MoveCanceled
E/MapChangeListenerLogTAG: Move
E/MapChangeListenerLogTAG: idle
E/MapChangeListenerLogTAG: MoveStarted && int : 1
E/MapChangeListenerLogTAG: MoveCanceled
E/MapChangeListenerLogTAG: idle
E/MapChangeListenerLogTAG: MoveStarted && int : 1
E/MapChangeListenerLogTAG: MoveCanceled
E/MapChangeListenerLogTAG: idle
E/MapChangeListenerLogTAG: MoveStarted && int : 1
E/MapChangeListenerLogTAG: MoveCanceled
E/MapChangeListenerLogTAG: idle
E/MapChangeListenerLogTAG: MoveStarted && int : 1
E/MapChangeListenerLogTAG: MoveCanceled
E/MapChangeListenerLogTAG: idle
E/MapChangeListenerLogTAG: MoveStarted && int : 1
E/MapChangeListenerLogTAG: MoveCanceled
E/MapChangeListenerLogTAG: idle
E/MapChangeListenerLogTAG: MoveStarted && int : 1
E/MapChangeListenerLogTAG: MoveCanceled
E/MapChangeListenerLogTAG: idle
E/MapChangeListenerLogTAG: MoveStarted && int : 1
E/MapChangeListenerLogTAG: MoveCanceled
E/MapChangeListenerLogTAG: idle
Hassan-Fa commentedon Oct 10, 2018
wasn't it resolved ?
what can be done now ?
LukasPaczos commentedon Oct 11, 2018
Hey @Hassan-Fa, I've tested current implementation and I'm unable to reproduce a scenario when
canceledisn't followed byidle, which I understand is the issue. Could you provide a reproducible example (I'm aware this might be hard) or do some debugging on your side, especially the logic in theCameraChangeDispatcher?