mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.35k stars 1.33k forks source link

MGLMapSnapshotter - Options do not support loading custom style from json #16548

Closed krames133 closed 3 years ago

krames133 commented 3 years ago

When trying to load a map snapshot and using a custom style loaded from a json resource this error is returned:

MGLErrorDomain" - code: 6

HTTP status code 404

Here is a simplified code snippet: let options = MGLMapSnapshotOptions(styleURL: URL(string: "https://example.com/styles/map_style.json"))

This feature works fine when using the Android SDK. The Android SDK even includes the a method to set a json style via this method:

withStyleJson | The map style JSON to use instead of a map style URL.

When will this be fixed and/or completed to match the functionality and behavior of the Android SDK?

Expected behavior

MapSnapshotter will load a snapshot when styleURL is set to a json resource.

Actual behavior

MapSnapshotter fails with error: HTTP statuc code 404

Configuration

Mapbox SDK versions: 6.2.1 iOS/macOS versions: 14.0 Device/simulator models: iPhone 11 Pro Xcode version: 12.0.1