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

Add Projection specifications #687

Merged
merged 5 commits into from
May 31, 2024
Merged

Add Projection specifications #687

merged 5 commits into from
May 31, 2024

Conversation

HarelM
Copy link
Collaborator

@HarelM HarelM commented May 31, 2024

Launch Checklist

This PR adds the projection specification according to the discussion here:

This is still experimental.

The following is how the docs would look like:
image

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Add an entry to CHANGELOG.md under the ## main section.

@HarelM HarelM requested review from birkskyum, louwers and neodescis May 31, 2024 11:32
@codecov-commenter
Copy link

codecov-commenter commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.60%. Comparing base (139a225) to head (8329fa9).
Report is 81 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #687      +/-   ##
==========================================
+ Coverage   92.56%   92.60%   +0.03%     
==========================================
  Files         104      105       +1     
  Lines        4616     4638      +22     
  Branches     1301     1306       +5     
==========================================
+ Hits         4273     4295      +22     
  Misses        343      343              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@birkskyum
Copy link
Member

birkskyum commented May 31, 2024

Is this to be understood as that the provided projection will be the one for low zoom levels, and then web-mercator on high zoom, and we'll add a transition at appropriate zoom levels? If so, and i'm probably overthinking it but better to do so early - do we see upcoming challenges to those assumptions that would favor something more explicit like e.g. a list of zoom-level: projection pairs? Or ability to at disable web-mercator transition, or control when it hits?

@HarelM
Copy link
Collaborator Author

HarelM commented May 31, 2024

The current implementation of globe transitions from globe to mercator without any zoom configurations or user input, it just does it. I don't know if we can actually keep the globe projection while zooming in further.
Having said that, this is still experimental and I want to be able to use it in the globe branch and see how it behaves and then decide if and how to change it.
CC: @kubapelc

@birkskyum
Copy link
Member

That's a good point, as long as it's experimental this will do fine.

@kubapelc
Copy link

The current implementation of globe transitions from globe to mercator without any zoom configurations or user input, it just does it. I don't know if we can actually keep the globe projection while zooming in further.

Hi, it needs to do that at a certain zoom level, because otherwise 32 bit floats (or GPU inverse trigonometry) will run out of precision and artifacts will appear.

The transition zoom level (and the animation duration) is currently not configurable, but it is just a few numbers and I don't see any reason why users shouldn't be able to adjust it. The current values (possibly good candidates for default values) make the transition virtually unnoticeable, while the artifacts are also well hidden.

@HarelM HarelM merged commit a018340 into main May 31, 2024
6 checks passed
@HarelM HarelM deleted the add-projection branch May 31, 2024 14:37
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

Successfully merging this pull request may close these issues.

4 participants