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 optional map mode argument to render #3109

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kkirov
Copy link

@kkirov kkirov commented Dec 26, 2024

Label Clipping Prevention in mbgl-render

This PR adds the ability to use MapMode::Tile with mbgl-render to prevent label clipping at tile boundaries, which is particularly important for map tile generation.

Changes

  • Adds support for MapMode::Tile while maintaining MapMode::Static as the default
  • No breaking changes to existing behavior
  • Enables proper label placement across tile boundaries when explicitly using MapMode::Tile

Technical Background

Label clipping occurs because MapMode::Static treats each tile in isolation, causing labels near tile edges to be truncated. MapMode::Tile mode considers neighboring tiles during label placement, ensuring continuous and properly placed labels across tile boundaries.

Related Issues

Copy link
Collaborator

@louwers louwers left a comment

Choose a reason for hiding this comment

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

LGTM but you need to run clang-format.

pre-commit install
pre-commit run --all-files

Copy link

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-3109-compared-to-main.txt

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.

2 participants