-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fresh new camera #3583
Fresh new camera #3583
Conversation
break apart camera & animation options add getCamera method, replace old methods throughout codebase start updating tests, cameraForBounds method panTo tests writing some animation tests toying with tests continue writing tests fly tests add bounds tests
1f3fef3
to
3e9bfb3
Compare
Awesome progress here @mapsam. A few points on specific API details:
|
@jfirebaugh I think it belongs to CameraOptions. When doing an animation, you can either specify target |
Let's think more about both
|
|
Currently https://www.mapbox.com/mapbox-gl-js/api/#Map#fitBounds supports maxZoom, looking at the latest API docs for this branch I can't see maxZoom mentioned in fitBounds. Does it make sense to add it as a cameraOptions? |
Hey @mapsam -- I'm in the process of cleaning out our PR queue and it looks like there hasn't been any activity on this one recently. If you're still interested in coming back to it, please let us know and we'll be happy to help you get it to completion. Until then, I'm going to close it out. Thanks again for your contributions! |
Thanks for gardening @jfirebaugh! You're right, unfortunately I don't have the capacity to finish it right now. |
This is a complete refactor of the Camera API (
js/ui/camera.js
) per discussion in #2801 - some major changes:setCamera
method that takes three arguments, 1) camera options, 2) animation options, 3) event data.setCamera
. Many internal usages ofsetCamera
are updated to include their former animation type.type
parameter that has three valid values:none
,ease
, andfly
. Many of the animation options parameters are specific to certain types of animations.getCameraForBounds
method that returns a camera options object based on a bounds. We are keepingfitBounds
, which is a wrapper around this, and subsequently a wrapper aroundsetCamera
.TODO
getCameraForBounds
method.Questions
setCamera
method?duration: 0
workaround, which means you can't fake your way through the ease animation any longer. This only appears to be a problem with the scroll zoom functionality, which requiresease
for smooth transitions. I've worked around this by settingduration: 1
. Is this okay?I'd like to get some approval of the direction of this work before I update all of the examples and other tests, if that's okay.
cc @lucaswoj @mourner @1ec5 @mollymerp @lbud @jfirebaugh