Skip to content

Support overlapping and/or queued Camera animations #2820

Closed

Description

@nicooprat

mapbox-gl-js version: 0.20.1

Steps to Trigger Behavior

See demo 1: https://jsfiddle.net/tn4yqcp2/

Try to zoom (level > 7.5): the pitch is set according to current level of zoom. The flyTo button isn't working.

See demo 2: https://jsfiddle.net/tn4yqcp2/1/

Try to zoom (level > 7.5): the pitch is not set according to current level of zoom. The flyTo button is working.

  1. Create a map
  2. Listen for zoom, setPitch according to current level
  3. Trigger an animated action (eg flyTo)

Expected Behavior

The flyTo animation should continue, and the pitch should also be updated without breaking current animation.

Actual Behavior

Using setPitch cancels current animation (other methods too, like setBearing and so on).

PS. I'm also looking for a way to know if an event has been triggered manually (eg. scroll to zoom) or programmatically (eg. flyTo) as a workaround.

Activity

  1. lucaswoj commented on Jul 7, 2016

    @lucaswoj
    Contributor

    Expected Behavior

    The flyTo animation should continue, and the pitch should also be updated without breaking current animation.

    Actual Behavior

    Using setPitch cancels current animation (other methods too, like setBearing and so on).

    This is the intended behavior of the current API. For simplicity's sake, we don't support queued or overlapping camera animations. I think this feature should be considered in the scope of #2801

    PS. I'm also looking for a way to know if an event has been triggered manually (eg. scroll to zoom) or programmatically (eg. flyTo) as a workaround.

    You can use the event.originalEvent property to determine this

  2. changed the title [-]setPitch stops current animation[/-] [+]Support overlapping and/or queued Camera animations[/+] on Jul 8, 2016
  3. nicooprat commented on Jul 8, 2016

    @nicooprat
    Author

    Yes, would be great to have more flexibility! event.originalEvent did the trick anyway, thanks for your quick answer.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions