Repository navigation
Fresh new camera - #3583
Fresh new camera#3583mapsam wants to merge 5 commits into
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:setCameramethod that takes three arguments, 1) camera options, 2) animation options, 3) event data.setCamera. Many internal usages ofsetCameraare updated to include their former animation type.typeparameter that has three valid values:none,ease, andfly. Many of the animation options parameters are specific to certain types of animations.getCameraForBoundsmethod 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
getCameraForBoundsmethod.Questions
setCameramethod?duration: 0workaround, 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 requireseasefor 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