-
-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CameraUpdates
overwrite each other (no parallel camera updates)
#2790
Comments
(Regarding the labels: This is probably rather a missing feature than abug, but an issue for |
Would just including the options from the previous update in the new one be an option? |
You mean the previous animation target? I.e. animation A starts with zoom by +1 (zoom 17 to 18), then while animation A is still running, animation B starts with a new position? If your suggestion is to include the zoom target of 18 in the animation B that replaces animation A: I think this behavior would be suboptimal and can lead to unexpected results that feel like bugs. The correct way to handle parallel animations, I'd say, is to animate each separate property (zoom, tilt, rotation, position, padding) separately and only replace a running animation with a newly posted animation if it animates the same property. FYI, I wrote in the chat today, a slightly different approach:
|
Note
This is probably rather a missing feature than a bug. However, the API suggests that this should be possible, but it turns out that it isn't.
Description
Any new camera update posted to
MapLibreMap::easeCamera
cancels the old camera animation and replaces it with a new camera animation.To Reproduce
Calling e.g.
will cancel the zooming to zoom=18 after 500ms and instead (rather than additionally) move to the given target position. I.e. any new camera position update animation will overwrite the last.
Expected behavior
The animations of different properties of the camera (zoom, tilt, position, rotation, ...) should run in parallel if they don't conflict each other.
Video
In this video, we see that the position is being updated in an animation every second or so to focus on the current location. When the user taps the zoom-in button, the move-to animation is cancelled or the other way round (the zoom-in animation is cancelled), depending on the timing:
zoombounce.mp4
Important: This is not only an issue with zoom vs position. At any time, the user may also press a button to change the map's rotation (the compass button) or tilt (changing from (car-)navigation-mode to just-follow-me-mode) while the position is continuously updated. Also, it is possible for the continuously updated position to interrupt a zoom-to or zoom-back animation as seen in the video in #2789
Platform information (please complete the following information):
Additional context
Originally reported in streetcomplete/StreetComplete#5860 and in streetcomplete/StreetComplete#5857 (for padding-animation)
The text was updated successfully, but these errors were encountered: