-
Notifications
You must be signed in to change notification settings - Fork 1.3k
iOS: No longer able to load local Sprite resources #1208
Comments
The asset: URL scheme looks inside MapboxGL.bundle due to #1012. To point inside your app’s main bundle, you should be able to pass in a relative or absolute path to it. Does that work for you? |
I have tried that and it no longer seems to be working. Note that I am referring to the Sprite assets, not the style JSON. The style is loading, however, the Sprite assets are not. |
You’re right, none of this is working correctly right now. As far as the GL backend is concerned, there can only be HTTP(S) URLs backed by Passing in an asset: URL doesn’t work either because |
@picciano To answer your specific situation, where did you put your sprite JSON and how did you name it? If the style JSON has |
(As a temporary workaround, you can also dig yourself out of MapboxGL.bundle with a bunch of |
I put the style JSON and sprite files at the root level of the main application bundle. I just tried |
Let’s leave this issue open. |
This has a workaround and is not critical for b2. |
I am seeing style assets at the app bundle root working fine as |
Ah, we do have differing code paths based on the Mapbox SDK integration method. What I mentioned above only works in the |
The |
This is no longer an issue for us since we can now use client-side images for annotations. Much better than custom sprite sheets! |
This is definitely the way to go nowadays if you want custom images. |
As of #2746, we no longer bundle any styles with the SDK, so the asset: URL scheme is unused. Instead, point asset: to the application root for developer convenience and consistency with the Android and default asset roots. Also fixed an issue that prevented relative URLs from being treated as asset: URLs. Fixes #1208, fixes #3050.
As of #2746, we no longer bundle any styles with the SDK, so the asset: URL scheme is unused. Instead, point asset: to the application root for developer convenience and consistency with the Android and default asset roots. Also fixed an issue that prevented relative URLs from being treated as asset: URLs. Fixes #1208, fixes #3050.
I am setting a custom style in my app, as follows:
However, the sprite sheet (in the app bundle) is no longer loading. This URL was working in previous versions by inserting the URL into the raw JSON at runtime, but is now no longer found:
The files are located at the root level of the main bundle. I have tried various paths without success:
I have even tried hard-coding the absolute path above into the style JSON.
Is there any way to do this now?
The text was updated successfully, but these errors were encountered: