Skip to content

Allow user to override tile level calculation#1566

Open
xawill wants to merge 1 commit intoNASA-AMMOS:masterfrom
xawill:image-overlay-tile-depth-callback
Open

Allow user to override tile level calculation#1566
xawill wants to merge 1 commit intoNASA-AMMOS:masterfrom
xawill:image-overlay-tile-depth-callback

Conversation

@xawill
Copy link
Copy Markdown
Contributor

@xawill xawill commented Apr 19, 2026

Following discussion in #1278.

In this proposal, calculateLevel can now return null. This user-override indicates that the current tile has no content and should not be rendered. Let me know what you think about it. An alternative would be to support minLevel and maxLevel on TiledImageOverlay. In that case, we might want to clamp level between minLevel and maxLevel in calculateLevel, even though after testing it I noticed that the rest of the codebase is already clamping level everywhere I checked.

@xawill
Copy link
Copy Markdown
Contributor Author

xawill commented Apr 20, 2026

Thinking about it a bit more, there might be an issue with returning false from hasContent like this. It will prevent the tile from being refined in case the camera moves closer to the tile and hasContent should now return true, but it is not re-evaluated, is it?

Anyway it looks like a bit hacky to be able to return null from calculateLevel. Do you have any idea on how to solve the use case when the user wants to display the overlay only for zoom level >16 for instance?

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.

1 participant