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

Add test app activity for loading a local style.json file #6265

Closed
danswick opened this issue Sep 6, 2016 · 4 comments
Closed

Add test app activity for loading a local style.json file #6265

danswick opened this issue Sep 6, 2016 · 4 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@danswick
Copy link
Contributor

danswick commented Sep 6, 2016

I have seen a handful of requests recently to use local style JSON files in Android applications. This is useful for apps that require third-party tiles or lower quality mapbox tiles (in jpg70 format, for example). The current example points to a hosted asset. It would be helpful to have an example activity showing how this is done.

cc @tobrun @cammace @bleege

@danswick danswick added the Android Mapbox Maps SDK for Android label Sep 6, 2016
@1ec5
Copy link
Contributor

1ec5 commented Sep 6, 2016

The iOS SDK automatically converts relative URLs to asset: URLs, which are relative to the asset directory that is set when initializing the mbgl::DefaultFileSource. It also prepends the asset: scheme to absolute file URLs so that mbgl treats them as absolute file URLs.

@cammace
Copy link
Contributor

cammace commented Sep 13, 2016

In the demo app using a local json style is explained in a comment. If this is adequate, I can update the example found on our site.

@bleege
Copy link
Contributor

bleege commented Sep 13, 2016

In the demo app using a local json style is explained in a comment. If this is adequate, I can update the example found on our site.

Yeah, that JSON file should be fine. The key is to embed it locally in the file system and then build out the TestApp example that reads from the file system. This will provide and example for customers, but even more importantly give us something that we can write test cases for to ensure that this continues to work over time. 😉

@ivovandongen
Copy link
Contributor

@danswick #6497 brings a test Activity that loads a style file from the file system (opposed to a packaged asset). See the specific commit for details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

5 participants