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 Tile LOD controls #2958

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

Conversation

alasram
Copy link
Collaborator

@alasram alasram commented Oct 22, 2024

Expose tile level of details (LOD) parameters to Android. Controlling the LOD gives MapLibre clients the ability to control performance scalability. This is already exposed to some level with the parameter pixelRatio but the option pixelRatio changes the view so it's typically set once when the application starts and the styling and camera need to be setup for the chosen pixelRatio.
This PR exposes controlling an offset (shift) to the zoom level. If performance drops below a certain FPS, an application can decide to lower the zoom level to reduce the number of processed and displayed tiles.
Similarly when the screen is tilted (Often the case during active Navigation on large display infotainment devices), tiles away from the camera could use lower zoom levels to maintain a certain level of performance. This PR exposes controlling the pitch angle threshold and the distance to camera to lower zoom levels.

Example:

What we currently get on a 4K display with 45 degrees pitch
default

Example where zoom is offset by +0.75 (usually a negative value would be used to improve performance):
zomm_add_0 75

Example where the pitch and distance to camera parameters allow for a lower zoom levels away from the camera view target:
reduced_lod_at_low_pitch

@alasram alasram requested a review from louwers October 22, 2024 23:48
Copy link

github-actions bot commented Oct 23, 2024

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +88  [ = ]       0    TOTAL

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

@alasram alasram force-pushed the alasram/android_tile_lod_controls branch from 78868d0 to a1f6780 Compare November 5, 2024 00:15
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.

Very useful and MapLibre Native should definitely include this functionality in my opinion.

A few things:

Let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants