mapbox / mapbox-plugins-android

Mapbox Android Plugins are a collection of libraries that extend our other SDKs, helping you design powerful mapping features while the plugins handle most of the heavy lifting.
https://www.mapbox.com/android-docs/plugins/overview/
BSD 2-Clause "Simplified" License
241 stars 119 forks source link

Offline Plugin does not support providing style via local files on device, only via remote URLS #813

Open pyb4430 opened 5 years ago

pyb4430 commented 5 years ago

The implementations of OfflineRegionDefinition don't have support for setting the style from a local file or something of the sort. I need to define my styles dynamically (the map sources will be selected by the user) and then cache tiles for later offline use. MapboxMap can have its style set via local file and asset urls, so why not the same support for the offline module?

tobrun commented 5 years ago

@pyb4430 agreed that this should be added. I added it to the backlog but feel free to provide a PR for it.

stale[bot] commented 4 years ago

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[bot] commented 4 years ago

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[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

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

stale[bot] commented 4 years ago

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

codeversed commented 4 years ago

@langsmith @tobrun @LukasPaczos I have recently stumbled upon this issue of not being able to download an offline region specifying a locally stored JSON StyleSpec. I contacted support and they confirmed the issue but linked me here for the public discussion.

I'm a little confused about why this is an issue with the OfflinePlugin (which we do not use) rather than an issue with mapbox-gl-native-android. To me, it seems like the feature would need to be added to the OfflineManager or FileSource.

We also have an iOS app, which I confirmed this morning that they are passing a locally stored JSON StyleSpec path that has a prefix of file://. Is this working on iOS and not Android? The iOS SDK is a little different setup but they define a region and pass a style URL the same ask the Android SDK.

Any insight on the root cause of the issue would be helpful, thanks!

tobrun commented 4 years ago

sorry for late reply @codeversed, correct that this needs to be addressed first upstream. The underlying code in offline_download.cpp uses a direct reference to the online file source and not an abstraction that would allow to use a local file or assets hosted file. This means that this shouldn't work for iOS either except if NSUrl is able to handle local files (I'm not an iOS developer so IDK).

codeversed commented 4 years ago

@tobrun this is a needed feature for us. I have a support ticket in but it's marked low priority. What can I do to help get this done? It currently does work on iOS.