mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

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

Open sega4revenge opened this issue 7 months ago • 1 comments

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.

sega4revenge avatar Jul 24 '24 14:07 sega4revenge