Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Nov 8, 2024

@HarelM , this is a small nit.

We don't have a way to pass config properties to the individual projections right now, so the naming we choose for these presets should probably be as accurate as we can for now. I've been a bit back and forth on this, but I think this is the right call for now to be more accurate, and then if there's a more generic solution, then we can convert i.e. 'vertical-perspective' preset into the 'general-perspective' projection with the right parameters. We just need a minimal way right now to disable mercator at high zoom, and this will do.

Technically it's a Vertical Perspective projection that we support. It's how earth looks from space at finite distance, if it was a perfect sphere. It is a kind of General Perspective projection, which the following parameters:

  • Projection place tilt
    • angle against azimuth = 0
    • angle from vertical = 0
  • Distance to Earth's center, for the point of perspective = ~30-100km

We don't have a way to pass the params with the general-perspective setting, so we might as well be accurate with this for now.

For context, if the projection place in a General Perspective projection has a tilt defined, it's considered to be a:

And if the distance to Earth's center, for the point of perspective, is changed from 30k-100k km to other values in the General Perspective projection math, that'll result in these other well-known projections:

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.73%. Comparing base (d7444b4) to head (239d31e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #891   +/-   ##
=======================================
  Coverage   92.73%   92.73%           
=======================================
  Files         105      105           
  Lines        4683     4683           
  Branches     1323     1323           
=======================================
  Hits         4343     4343           
  Misses        340      340           

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

@birkskyum birkskyum merged commit 78e24be into maplibre:main Nov 8, 2024
6 checks passed
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.

3 participants