maplibre / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
https://maplibre.org/maplibre-gl-js/docs/
Other
6.67k stars 716 forks source link

When using raster-dem terrain source at zooms past ~17.0, text labels lift off surface #4908

Open jpgnz opened 2 weeks ago

jpgnz commented 2 weeks ago

maplibre-gl-js 4.7.1:

browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

Steps to Trigger Behavior

1) When using raster-dem terrain source at zooms past ~17.0, text labels lift off surface.

Link to Demonstration

https://ladbulance.nz/ml241027.html

Expected Behavior

Smaller zoom levels: image

Actual Behavior

image

jpgnz commented 2 weeks ago

Note, the demo is just https://github.com/openmaptiles/maptiler-terrain-gl-style + LINZ Basemaps with Terrain enabled.

HarelM commented 2 weeks ago

Any chance you can link to a working hsbin or codepen?

jpgnz commented 2 weeks ago

~https://output.jsbin.com/pikimiy~

Done - however the API keys will expire.

HarelM commented 2 weeks ago

I'll need a way to reproduce the issue when someone will take the time to solve this in the future. The other option is that you'll try to solve this. The above jsbin returns 404... Please see if you can find a minimal reproduction that doesn't require something that will expire.

jpgnz commented 2 weeks ago

My bad... https://ladbulance.nz/ml241027.html

HarelM commented 2 weeks ago

The style is huge... Can you please create a minimal reproduction?

jpgnz commented 2 weeks ago

Updated https://ladbulance.nz/ml241027.html with 2 sources, 1 glyph source, 6 layers. Trying to keep the balance there so you can see the issue.

I have obviously incorrectly assumed that the style I linked above was a common one which is why I chose it. Outside of LINZ for Terrain, I am using a completely different set of sources/layers where I originally saw this issue. I selected that to provide something that would reproduce.

HarelM commented 2 weeks ago

Thanks! I don't see a definition for maxzoom for the raster-dem tiles, is it possible that this may cause some issues? There's also this bug report, but I think it's more subtle than this:

jpgnz commented 2 weeks ago

Could be, I've just noticed that this issue exists on the LINZ viewer as well: https://basemaps.linz.govt.nz/@-43.5992759,172.7222979,z18.17,b-19.8,p74?style=topographic&i=topographic&terrain=LINZ-Terrain and the common source is that LINZ raster-dem. I'll do some more investigation.