-
-
Notifications
You must be signed in to change notification settings - Fork 779
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
Display layers for zoom levels outside the min-max range. #5436
Comments
We basically want a way to reduce the blurriness of mercator->globe re-projection when looking at north/south pole. One way to that would be to limit clamp the zoom of raster tiles, reducing this effect. So for example layers at zoom 0,1,2 are never loaded and only 3 up -- even if the map is zoomed out more. |
There is no limitation to using different sources with different min-max zoom configurations. |
Sure but for that you'll need a tile server that renders them at a higher resolution for smaller zooms. An example of where it would be useful: example.mp4 |
Due to how mercator works (which is the basis of the tiles) when looking at the pole a different zoom level is used. |
And this is the issue. Another real-life case: If you have a source A serving tiles at zoom 3-12 and a source B at zoom 0-10, it is not possible to display both sources at zoom 11, 12 (by scaling up source B) and at zoom 0, 1, 2 (by scaling down source A). |
I don't think that's correct. Can you please share a jsbin with this issue? |
Globe problem: https://jsbin.com/qulujuleki/edit?html,js,output |
I guess these are two unrelated problems (please correct me if I’m wrong)? So, regarding blurriness: The current implementation works as follows: When tilting the globe from the equator to the pole, the zoom level changes while keeping the globe the same size, resulting in different tile sets (for zoom 0...3). What you want is: Display the tile set for zoom level 3, regardless of whether you are looking at the equator or the pole? |
Yes, that's what it was all about! I see that when the projection changes from a globe to a flat surface you can see the zoom jump, which is expected. This could be smoothed out somehow to gradually change the zoom to the correct one. |
Yes, the relevant change is in src/geo/projection/globe_utils.ts
There are other issues as well, for example markers are at the wrong position between zoom 11 and 12. In other words: Just a prove of concept for now, but not ready for production. |
An option to configure min zoom for a source, that will keep rendering it even if we zoom out further (currently it just disappears). This way, if zoomed out further (which also occurs at the poles automatically), it will force displaying of more, higher zoom tiles and reduce the blurriness effect. This is just an idea and perhaps there's a better way to approach this problem. I think the general issue here is that raster source is currently visually unappealing at the globe projection (at low zoom, at poles, where the projection error is the highest). That's obviously a projection limitation but by clamping down the zoom (or other solutions) this will be less noticeable and better for the end-users :-). |
While overzooming is easy as you simply take a tile and increase its size (which this library already does), underzoom is very expensive as you need to fetch a lot of tiles in order to build the view port, which in most cases is not what you would like to achieve, a better approach would be to provide the relevant tiles at the lower zoom levels, those are usually easier to create in the server side when creating the more detailed tiles... |
In globe view it probably doesn't make much difference, since looking from the equatorial side you can see half the globe at a higher zoom than looking from the polar side. |
@HarelM I understand this is an important consideration. However, this should be on us and not MapLibre contributors :-). The example of limiting zoom to level 3 is just for illustration and doesn't represent the final configuration, which may have a minZoom of 1 or 2. Also, the load impact on low-zoom tiles won't be as high since they are frequently accessed and often cached -- they are also less detailed and smaller in file size. By further restricting the map's minZoom, we gain more control over worst-case data loads. For example, using mapMinZoom:2 with sourceMinZoom:3 in globe projection will be fairly lightweight. |
User Story
As a developer using maplibre, I would like to display some raster layers for zoom levels outside the min-max range so that I can display them with other layers that support these zooms.
Rationale
Adding such an option would allow the mixing of layers whose source servers do not support all zooms.
In addition, it would avoid changing the tiles in the globe projection when raster tiles are used (simply the map at the poles would be smaller, but the calculated zoom would not affect the displayed tiles). This is the feature I need most at the moment and I think this part can be implemented easily.
Impact
Without such a option, it will not be possible to display several layers when the source servers do not render the tiles for every zoom needed (minzoom and maxzoom causes the layer to disappear outside this range) and the zoom in the globe projection will always affect the resolution of the displayed tiles.
The text was updated successfully, but these errors were encountered: