maplibre / maplibre-native

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

fill-extrusion layer not updated when GeoJson source changes #2746

Open westnordost opened 1 month ago

westnordost commented 1 month ago

3D-buildings rendered in a fill-extrusion layer are not updated when the GeoJson source is updated/replaced. Only after some scrolling and/or zooming, it is. Sometimes, the updated 3D building is visible at the same time as the previous 3D building which leads to some Z-fighting. I suspect that actually the layer is updated, but the old 3D building is not correctly removed right away.

To Reproduce

Steps to reproduce the behavior:

  1. Have a Fill-extrusion layer backed by a GeoJson source that displays in some color
  2. Change the GeoJson source so that the element should display in another color
  3. See that the color doesn't immediately update

You can also test this yourself on current master in https://github.com/streetcomplete/StreetComplete or download the APK from https://github.com/streetcomplete/StreetComplete/releases/tag/v59.0-alpha1

Expected behavior

On updating the GeoJson, the old fill-extrusion layer should not be displayed anymore

Videos

https://github.com/user-attachments/assets/f8cc6e86-93ef-4bc7-b5cd-fd86eb0a9682

Note that the symbol and the fill-layer are updated correctly immediately as seen at the end of this video. They use the same GeoJson source.

https://github.com/user-attachments/assets/9c6d8508-3d63-4198-892e-f3f20f76ad08

In the second video, one can witness the z-fighting, which suggests that the fill-extrusion layer is updated correctly after all, but the old extrusion is not removed (immediately). (This video starts after the building has changed from something orange to something blue)

Platform information

westnordost commented 1 day ago

(FWIW, this is not fixed with org.maplibre.gl:android-sdk:11.3.0-vulkan-pre0)