maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
1.01k stars 297 forks source link

Metal: Incorrect reuse of sprites for line-pattern #2735

Open chchrn opened 3 weeks ago

chchrn commented 3 weeks ago

Describe the bug

In our product we use a style with line-pattern. In versions that use MetalKit for map rendering we noticed a problem with filling lines with pattern.

I have prepared a test project demonstrating the problem (attached).

The project style is available in style.json file or at https://api.npoint.io/7dac9318bfb95b18a9dc.

The example uses a simple geojson with two lines, one should be filled with a black dashed line and the other with yellow icons.

On a small zoom everything shows up as it should, but if you zoom in on the map you can see that the styles get mixed up. The yellow line starts to appear as a black dashed line and vice versa.

The problem seems to be the reuse of sprites.

We have only noticed this problem for the line-pattern property.

Before using the pre-metalKit version, we had no problems. The problem persists on the latest version 6.5.4 , and is also definitely present on 6.5.0

MlnPatterBug.zip

Screenshots photo_2024-08-19 19 10 45 photo_2024-08-19 19 10 47 photo_2024-08-19 19 10 50

Platform information (please complete the following information):

louwers commented 3 weeks ago

Thanks for the bug report. I'll have a look if I can create a render test for this.

moodstubos commented 2 weeks ago

We have the same problem with current Android release: android-v11.1.0