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

Fix uncautht OverscaledTileID error appearing with terrain enabled #1

Closed

Conversation

zbigniewmatysek-tomtom
Copy link
Collaborator

Fixes maplibre#1650.

Context

Negative zoom level were introduced by mapbox to handle displaying tiny maps. By negative zoom level they can scale down tiles. This PR is not questioning this design choice, just fixes issue with querying elevation caused by not handling negative zoom.

Problem

OverscaledTileID in getElevation() was constructed with negative zoomLevel (not allowed by tile spec) and thus threw uncaught error.

References:

Launch Checklist

  • 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.
  • Write tests for all new functionality.
  • Manually test the debug page.
  • Add an entry to CHANGELOG.md under the ## main section.

@zbigniewmatysek-tomtom zbigniewmatysek-tomtom marked this pull request as ready for review November 17, 2022 13:39
@zbigniewmatysek-tomtom zbigniewmatysek-tomtom changed the title Fix uncauth OverscaledTileID error appearing with terrain enabled Fix uncautht OverscaledTileID error appearing with terrain enabled Nov 22, 2022
Copy link
Collaborator

@StylianosVitalis-TomTom StylianosVitalis-TomTom left a comment

Choose a reason for hiding this comment

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

Pretty neat! 🙌

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.

map.setTerrain() throws error at max zoom
2 participants