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

[mapbox] Fix interleaving when base map has terrain #8111

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

Pessimistress
Copy link
Collaborator

For #8060

Background

The current projection matrix parameters in WebMercatorViewport are designed to match an early release of Mapbox. Between mapbox-gl, maplibre-gl, and their different major versions, the calculation has diverged significantly. This hack extracts near and far plane positions from a private property on the mapbox-gl map.

For the long term, I will open feature requests for the base maps to expose their projection matrix.

Change List

  • WebMercatorViewport accepts external nearZ/farZ positions
  • MapboxLayer uses base map nearZ/farZ if available

@Pessimistress
Copy link
Collaborator Author

Mapbox issue: mapbox/mapbox-gl-js#12888
Maplibre issue: maplibre/maplibre-gl-js#3080

Copy link
Collaborator

@felixpalmer felixpalmer left a comment

Choose a reason for hiding this comment

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

Good find!

@Pessimistress Pessimistress merged commit e9a8403 into master Sep 13, 2023
2 checks passed
@Pessimistress Pessimistress deleted the x/mapbox-far-z branch September 13, 2023 23:04
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.

None yet

2 participants