mapbox / mapbox/mapbox-maps-ios

Offline Load Tile Region in version above 11.3 not work with custom style.

Open
#2,217 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

Environment

  • Xcode version: 15.4
  • iOS version: 17.5
  • Devices affected: Iphone 15 Pro Max
  • Maps SDK Version: 11.5.1

Observed behavior and steps to reproduce

I have issue from loadTileRegion. My app use custom styleURL and mapview was load style successfully. I write a function for create a TileRegionLoadOptions

let offlineManager = OfflineManager()
let bounds = mapView.mapboxMap.coordinateBounds(for: mapView.bounds)
let coordinates = [bounds.southwest, bounds.northeast, bounds.northwest, bounds.southeast]
        if let styleURI = mapView.mapboxMap.styleURI {
            let options = TilesetDescriptorOptions(styleURI: styleURI, zoomRange: 7...16, tilesets: nil)
            let tilesetDescriptor = offlineManager.createTilesetDescriptor(for: options)
            let tileRegionLoadOptions = TileRegionLoadOptions(
                geometry: .polygon(.init([coordinates])),
                descriptors: [tilesetDescriptor], metadata: nil,
                acceptExpired: false, networkRestriction: .none)
        }

and use it with

TileStore.default.loadTileRegion(
            forId: name,
            loadOptions: options)

For version 11.2, it will working normally ( have download progress )

Screenshot 2024-07-24 at 21 48 10

But in version above 11.3, It will instant return TileRegion with zero data ( requiredResourceCount , completedResourceCount, completedResourceSize ).

Screenshot 2024-07-24 at 21 48 29

Expected behavior

I want it working normally in version above 11.3.

Notes / preliminary analysis

Because of rejected from Apple about Privacyinfo.xcprivacy in version below 11.3, I cannot use them. So I'm trying to upgrade to newer version but facing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided TileRegionLoadOptions and TileStore.default.loadTileRegion code using a custom styleURL on SDK 11.5.1, then compare it with 11.2. Trace the offline loading path around OfflineManager, TilesetDescriptorOptions, and TileRegionLoadOptions. Done means the region reports nonzero resource counts and download progress for the newer SDK.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.