Open akoylasar opened 2 years ago
Here are more different behaviors with box zoom. I note in the example @akoylasar provided that the behavior occurs only when zoomed in to a certain point. A few more interesting behaviors is if I make a box off the globe it'll rotate the globe in that direction and zoom in.
I think that some of these behaviors are happening because off-sceen mouse events are currently handled as if they were on the closest point on the horizon (as demonstrated in #11746).
getBounds
currently works by min-maxing the positions of the viewport corners. In the case of globe when the corners are in space, this clearly doesn't work and will require a different algorithm.
Notes from globe view meeting:
We need to ensure that these APIs are no-op (instead of returning invalid values) with globe view projection, as these need to be thought about for 3d and were mainly designed for the 2d case. The current state of returning incorrect results can be rather misleading for our users. We also need to coordinate with native to be sure to adopt the same no-op behavior.
These functions have been re-enabled in globe in https://github.com/mapbox/mapbox-gl-js/pull/12008 due to their widespread use. We should address providing a correct implementation soon.
When
globe
projection is used the following snippets yield inconsistent behavior when compared tomercator
projection:getBounds
andcameraForBounds
:https://user-images.githubusercontent.com/67509069/164701266-16ce6e51-6faf-490f-94aa-74045d3ee2e7.mp4
The returned camera transform should remain the same similar to when
mercator
is in use:https://user-images.githubusercontent.com/67509069/164701298-847b9f91-30c4-4bbf-ac70-743d6d0fb1e5.mp4
fitScreenCoordinates
:https://user-images.githubusercontent.com/67509069/164707548-bb06e6a5-52b9-4d3e-8a61-da3280a18d26.mp4
fitBounds
:https://user-images.githubusercontent.com/67509069/164712924-6dee4d71-c681-473b-9971-c36d609e994f.mp4
boxZoom
:https://user-images.githubusercontent.com/67509069/164719186-e14b7ae6-423f-4053-84ea-2c03f90a1b5f.mp4