mapbox / mapbox-unity-sdk

Mapbox Unity SDK - https://www.mapbox.com/unity/
Other
725 stars 210 forks source link

Zoom Level Tile Persistence Issue with MapBox for Unity SDK (v2.1.1) #1928

Open liquidbuddha opened 2 weeks ago

liquidbuddha commented 2 weeks ago

Description: I’m experiencing an issue with the MapBox for Unity SDK (v2.1.1) where tiles from higher or lower zoom levels persist alongside tiles at the new zoom level. This happens when the zoom level is set below 6. When I update the zoom level using map.UpdateMap(latLon, zoom), the old zoom-level tiles often remain, resulting in a visually incorrect map display with tiles of two grid sizes overlapping.

Steps to Reproduce:

  1. Initialize the map with MapBox SDK v2.1.1 in Unity.
  2. Set a low zoom level (below 6).
  3. Use map.UpdateMap(latLon, zoom) to change the zoom level.
  4. Observe that tiles from the previous zoom level persist alongside the new tiles.

Expected Behavior: Tiles from the old zoom level should be removed or refreshed when a new zoom level is set.

Actual Behavior: Tiles from the previous zoom level remain on the map, creating a display with mixed tile sizes. The only workaround is to set the zoom to a higher level temporarily and then return it to the intended zoom level, which unfortunately causes additional downstream web request issues.

Environment: • Unity: 2022.3.4f1 • MapBox SDK: 2.1.1 • Scripting Backend: Mono • API Level: .NET Standard 2.1 • Build Platforms: Windows, macOS, iOS, Android

Here is a screen recording showing the behavior: https://app.screencast.com/fuh0lfZk0nFhk

MapTile issue example 1 MapTile issue example 2

liquidbuddha commented 2 weeks ago

Note: The tile issue only happens with the Abstract Map set to Range Around Transform. When it's set to Range Around Center, the tiles seem fine when zooming, but this is not useful for my camera & environment setup.

Extent Options for Range Around Transform:

liquidbuddha commented 2 weeks ago

UPDATE: By changing the Visible and Dispose buffers to match (4x4, or 6x6, etc) seems to have solved the issue.

liquidbuddha commented 2 weeks ago

UPDATE: Issue has returned with seemly no changes to anything map related. Map visible / dispose settings at 4x4, 6x6, or 8x8 all have mis-matched tiles at low zoom levels.