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

Tiles not loading outside of metadata bounds #2521

Closed
wants to merge 1 commit into from

Conversation

nnhubbard
Copy link

Fixes issue #1318 where tiles outside of metadata bounds are not loading. This fix allows over zooming so that map features that are not on higher zoom levels will still show from their lower zoom level tiles.

For example, the offline mbtiles file might include world tiles in z1 only, but when you zoom in farther those tiles are blank unless you move to the metadata bounds. With this fix, if you zoom into an area outside of the bounds you will get over zoom from z1 which makes for a much nicer looking map without blank tiles.

…k if they were past their zoom level. This fix allows for over zooming.
@wipfli
Copy link
Contributor

wipfli commented Jun 21, 2024

Thanks for working on this. The behavior you describe sounds like the correct one, i.e., only show data from inside the bounds.

@louwers you might want to coordinate with @HarelM on how this behavior is done in MapLibre GL JS.

@louwers
Copy link
Collaborator

louwers commented Jun 21, 2024

@wipfli Does MapLibre GL JS support reading local MBTiles?

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.

I don't understand why your changes implements the behavior you say it does. Could you explain it?

@wipfli
Copy link
Contributor

wipfli commented Jun 22, 2024

MapLibre GL JS does not have offline mbtiles support. My think is that independent of the source - be it an offline mbtiles file or a zxy http endpoint - the behavior for unavailable tiles should be the same.

@nnhubbard
Copy link
Author

openmaptiles, which many people use to create offline mbtiles files will create a a world tile at z1 where you can see all continents, countries, etc. It makes sense to continue to show these as you zoom into different parts of the world using over zoom. Without that, an mbtiles file would need to be created with world data on every other zoom level making the file significantly larger.

@nnhubbard
Copy link
Author

I don't understand why your changes implements the behavior you say it does. Could you explain it?

This small code change will, when receiving an error for no tile, instead allow the previous zooms tile to show instead of showing blank. E.g. overzoom.

@louwers
Copy link
Collaborator

louwers commented Oct 27, 2024

This would be a pretty significant change to the tile loading behavior. Not all users will want to have this behavior in all use cases, so I think it would need to be configurable.

Please create a discussion or a design proposal so we can discuss this problem first.

@louwers louwers closed this Oct 27, 2024
@nnhubbard
Copy link
Author

This would be a pretty significant change to the tile loading behavior. Not all users will want to have this behavior in all use cases, so I think it would need to be configurable.

Please create a discussion or a design proposal so we can discuss this problem first.

That is fine. I have fixed it in my fork for my purposes.

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.

4 participants