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

Improve globe constraints and panning precision #12114

Merged
merged 7 commits into from
Jul 27, 2022

Conversation

mourner
Copy link
Member

@mourner mourner commented Jul 25, 2022

Closes #12001.

  • Remove broken mercator-based constraints on low zoom level globe, instead opting for constraining the center of the view to maxBounds (same behavior as with alternative projections). Incidentally this fixes not being able to pan to the poles on the lowest zoom levels.
  • Fix scaling of the panning vector on globe view so that panning works more precisely, including near the poles and around globe to mercator transition zooms (it's now seamless).
  • Remove leftover TrackingEllipsoid code that's no longer used anywhere.

Try it out and let me know if the new behavior looks good, and after we settle on it, I'll update the expected query/unit tests to pass (hence the draft status). This PR also doesn't address the zooming behavior which may get weird in certain situations, rotating the globe excessively, but we can follow up on that in a different PR.

Launch Checklist

  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • manually test the debug page
  • tagged @mapbox/gl-native if this PR includes shader changes or needs a native port
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Improve panning precision on Globe View and relax constrains on lower zoom levels</changelog>

Copy link
Contributor

@karimnaaji karimnaaji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good with the adjusted constraints! I left a note regarding the tracking ellipsoid to investigate, as I think it was mistakenly disabled it when adding globe.

src/ui/handler_manager.js Outdated Show resolved Hide resolved
@mourner mourner marked this pull request as ready for review July 27, 2022 16:27
@mourner mourner requested a review from karimnaaji July 27, 2022 16:28
Copy link
Contributor

@karimnaaji karimnaaji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@karimnaaji karimnaaji merged commit 3d14aeb into main Jul 27, 2022
@karimnaaji karimnaaji deleted the fix-globe-low-zoom-controls branch July 27, 2022 17:12
SnailBones pushed a commit that referenced this pull request Jul 28, 2022
* fix globe constraints and improve panning precision

* fix flow

* reintroduce tracking ellipsoid

* fix panning through anti-meridian

* fixup

* fix query test

* update query geometry globe test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Globe view constraints should be relaxed
2 participants