maplibre-gl-js
maplibre-gl-js copied to clipboard
Some vector layers on more distant tiles are not rendered for pitched 3D terrain map
maplibre-gl-js version: 2.4.0
browser: Vivaldi, Firefox
Steps to Trigger Behavior
- create a map with vector style and 3D terrain
- zoom it, pitch it
Link to Demonstration
https://labs.maptiler.com/showcase/osm-3d-terrain/#map=13.05/48.8144/21.5301/59.28/75.50&language=sk
Expected Behavior
All visible layers should be rendered.
Actual Behavior
Some vector layers (eg. some landcover type) on more distant tiles are not rendered for pitched 3D terrain map.
This is by design. To improve performance and make sure we are not loading too many tiles, the distant tiles are using a lower zoom level tiles. In your case, since the pitch is over 60 degrees and the horizon is visible, if this algorithm was not implemented the entire world tiles would have needed to be downloaded and rendered. Not a great solution :-) I guess you'll be able to see more details when you pan the map further into the distance, right?
@HarelM that is not the case. You can see gray residential areas and streets but not forests. If you disable 3D (or set pitch to zero) and will zoom out, you will see that residential areas and residential and other minor roads disappear before forests. There is no zoom with tiles containing those roads without forests in that style.
I see. Thanks for the info! Can you try and create a simplified style that shows this issue maybe?
I will do it.
Here is the minimal-style demo: https://codesandbox.io/s/maplibre-gl-js-issue-1618-8wzxue
Too see something you must zoom in, for example: https://8wzxue.csb.app/#map=14.28/48.85968/19.36918/-101.31/69.90
There are two layers - one shows landcover to zoom 13 and other shows landcover from zoom 13. If there is only one landcover layer used for all zooms, then the issue is not reproducible.
I only see one layer in the above link... am I missing something?
Not that the issue does not exists there, but just want to make sure I'm looking at the right example...
In style.json
there are two layers. I am actually not counting the third one - shading.
Hi, this is related to LOD (level of detail). You defined a minZoom
of 13, tiles near the horizon are requested for 12.
There are two layers - one has "minzoom": 13
other has "maxzoom": 13
. Affected tiles have nothing there from neither of the layers.
@zdila sorry for nagging, but can you simplify this even further - remove the style.json file, remove the hill shading and just have everything in the same file so it will be easy to see and understand?
@HarelM no problem. I've updated the testcase. Let me know if I could do anything more.
Ah ok, didnt noticed (only noticed the minzoom)! Yes this is an issue. How to fix. hmmm. I can think something where it comes from, but may it is not easy to fix... is this issue also in 2d? If you are interested in fixing this ;), i may can give you some hints to start with.
Tested by myself, and as expected, this issue is also in 2D. So this is no Terrain-3D issue. It is an LOD issue when tilting map more that 60deg.
I don't see the problem when terrain is "off", @prozessor13 can you share what you saw?
Terrain commented out:
Terrain not commented out:
is this issue also in 2d
"Partially" :-)
If 3D terrain is not enabled, then I see also more distant tiles, but not "to the infinity". I would expect to see the horizont in the red colour (as for zoom < 13 the styling is red).
Samples:
- 3D enabled:
- 3D disabled:
- 3D disabled and slightly zoomed out:
- 3D enabled and slightly zoomed out:
Yep. in 2D tile-list generation anchor is map-center, in 3d camera-position. So in 2d you get more tiles to the horizon, but the error is the same.
I'm not sure how to categorize this in terms of label - is this a bug or a enhancement? Is it only in 3D?