Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Creating an OfflineTilePyramidRegionDefinition crashes with asset:// URL #5271

Closed
rm3dbeckers opened this issue Jun 7, 2016 · 5 comments
Closed
Labels
Android Mapbox Maps SDK for Android archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl offline

Comments

@rm3dbeckers
Copy link

We've recently tested the offline download on Android and although it looks like the mapView itself accepts styleURLs looking like "asset://style.json" (they load and the tiles are being requested correctly), but the class OfflineTilePyramidRegionDefinition only seems to accept styleUrls of the form "mapbox://styles/mapbox/streets-v9". styleURLs pointing into the assets seem to later cause an error like getHost() called on null reference (or something along that line) and then result in a termination from within the mapbox-gl.so

@jfirebaugh
Copy link
Contributor

asset:// URLs are not supported for offline. You'll need to use a mapbox:// URL, or have the style hosted somewhere else and use a regular URL.

That said, the expected behavior is an error message, not a crash. Leaving this issue open to investigate that problem.

@jfirebaugh jfirebaugh added Android Mapbox Maps SDK for Android offline labels Jun 7, 2016
@jfirebaugh jfirebaugh changed the title Android, Offline: Offline download with style in assets folder terminates the app Creating an OfflineTilePyramidRegionDefinition crashes with asset:// URL Jun 7, 2016
@glegrain
Copy link

glegrain commented Aug 9, 2016

Hi, I am currently having the same issue on iOS. mapView accepts asset:// URLs but MGLTilePyramidOfflineRegion does not allow local file URL.

Looking at the MGLTilePyramidOfflineRegion documentation and code:

Relative file URLs cannot be used as offline style URLs.

Why is that?

@tobrun tobrun added the Core The cross-platform C++ core, aka mbgl label Jan 4, 2018
@jussirantala
Copy link

Why is this? If I want to serve offline tiles, I need to run a http server on the phone...

@stale
Copy link

stale bot commented Oct 27, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the archived Archived because of inactivity label Oct 27, 2018
@stale
Copy link

stale bot commented Dec 6, 2018

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl offline
Projects
None yet
Development

No branches or pull requests

5 participants