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

Mapbox Animating Camera #9808

Open
Open

Description

@d-prukop

This is a ticket to track the discussion around implementing a new camera system for the various platforms.

The goal is to provide a camera system that allows independent animations to run on each of the map camera parameters. It should use a familiar API's for each of the platforms. This will give developers and designers the ability to have total control of the experience. It will also allow for the easy use of plug-in camera animation libraries and physics simulations for those who want to use certain styles of animation.

Further down the line, we should be able to introduce design tools for crafting animations and sharing those creations.

Some background and prior thinking:
“Fresh new camera”: mapbox/mapbox-gl-js#3583
“Concurrent Transition Animations”: #3625
“Reimplement camera transitions with Core Animation”: #8176

The new camera system will be able to animate each of the following parameters on independent timelines:

  • center coordinate
  • zoom level
  • bearing
  • pitch
  • anchor
  • roll ?? (yes!!??)

Animations will be handled on the various platforms and committed to the core with the frequency (or frame rate) controlled by the platform.

cc @mapbox/gl @pveugen

Activity

  1. added
    Android
    Core
    iOS
    navigation
    Qt
    on Aug 18, 2017
  2. d-prukop commented on Aug 18, 2017

    @d-prukop
    ContributorAuthor

    @jfirebaugh Can we figure out a way to prefetch tiles using the platform based animations?

  3. 1ec5 commented on Aug 18, 2017

    @1ec5
    Contributor

    mbgl currently treats anchor as a frame of reference for zoom and angle, but not as a degree of freedom in its own right. (Similarly, padding affects the frame of reference for center.) Would you suggest turning it into an animatable degree of freedom? What are the tradeoffs?

  4. d-prukop commented on Aug 18, 2017

    @d-prukop
    ContributorAuthor

    I'm thinking of anchor as an animatable parameter. Setting this explicitly has been the easiest way to control the effect. I haven't given much thought to the tradeoffs of setting this implicitly.

  5. 1ec5 commented on Aug 18, 2017

    @1ec5
    Contributor

    Currently, to change the camera’s padding (as the user perceives it), you’d need to reapply the current center coordinate with the new padding. The anchor is often provided by gesture recognizers (to be under the mouse cursor) when specifying a camera to animate to, but if you ask the map for its current anchor, you’ll always get an unset value. In this sense, anchor could just as well have been a member of AnimationOptions instead of CameraOptions.

    If we were to keep the current anchor implementation but allow for concurrent animations, the developer would for instance ease to a camera with a new anchor value, and any subsequent animation frames would have to account for that anchor when computing the center coordinate. On the other hand, if we turn anchor into its own degree of freedom, then there could be conflicting anchors when (say) the user makes a rotation gesture in the middle of a programmatic rotation.

  6. d-prukop commented on Aug 18, 2017

    @d-prukop
    ContributorAuthor

    That's a good point about the anchor moving to the point between touches on rotate. I'm very much thinking about this in the specific context of navigation where any touch/move on the map should cancel all animation. Any call to transition to the following mode (by tapping resume or re-center or using a timeout) should result in the anchor point moving to somewhere in the lower third of the screen. Calls for transition to the overhead view should move the anchor to the center of the defined viewport.

  7. kkaefer commented on Aug 21, 2017

    @kkaefer
    Member

    @d-prukop see #2006 for a discussion on tile prefetching.

  8. kkaefer commented on Aug 21, 2017

    @kkaefer
    Member

    See #9813 for cache eviction strategy when prefetching tiles.

  9. zugaldia commented on Aug 22, 2017

    @zugaldia
    Member

    Capturing chat today (cc: @tobrun). Looks like ObjectAnimator is a good starting point to achieve this on the Android side.

  10. d-prukop commented on Aug 22, 2017

    @d-prukop
    ContributorAuthor

    Had a chat with @1ec5 yesterday. The plan is to experiment with using CoreAnimation to do camera animations without changing anything on core.

  11. 5 remaining items

  12. tobrun commented on Sep 15, 2017

    @tobrun
    Member

    PR unblocking this feature for the Android binding in #10001.

  13. tobrun commented on Jan 18, 2018

    @tobrun
    Member

    Removing android label, API for that landed.

  14. removed
    Android
    on Jan 18, 2018
  15. julianrex commented on Jul 31, 2018

    @julianrex
    Contributor

    Tagging myself and @fabian-guerra just for reference.

  16. added
    archived
    on Jan 27, 2019
  17. stale commented on Jan 28, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  18. removed
    archived
    on Jan 28, 2019
  19. added
    archived
    on Jul 27, 2019
  20. stale commented on Jul 27, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  21. removed
    archived
    on Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoreQtfeaturegl-iosiOSnavigation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions