Skip to content
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

Support overlapping and/or queued Camera animations #2820

Closed
nicooprat opened this issue Jul 5, 2016 · 2 comments
Closed

Support overlapping and/or queued Camera animations #2820

nicooprat opened this issue Jul 5, 2016 · 2 comments

Comments

@nicooprat
Copy link

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.

@lucaswoj
Copy link
Contributor

lucaswoj commented Jul 7, 2016

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

@lucaswoj lucaswoj changed the title setPitch stops current animation Support overlapping and/or queued Camera animations Jul 8, 2016
@nicooprat
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants