Geo: Using the Mapbox SDK for Android

Thanks everyone, this is exciting all around! @Ivangayton makes a strong case for supporting MVT basemaps as a first step. And just so we're on the same page, we're actually talking about MVT MBTiles (Mapbox Vector Tiles stored within a SQLite container), right?

Here is a summary of what I think is going to happen in the short term:

  • @Marena and @yanokwa will coordinate in private to get the API key that Mapbox has generously offered into the build process with the documentation she describes in this comment.
  • @langstonsmith will finish his effort to get online Mapbox basemaps in Collect as described in Adding Mapbox vector tile basemaps - #36 by zestyping. This support will only work on the release build which will have the API key mentioned above. Alternately, those who fork can add their own API key as described in @Marena's documentation.
  • @zestyping will work off of the same branch and add support for offline vector mbtiles. This will work without requiring an API key.
  • I will be ready to code review as needed.

Did I get all that right?

@Marena, is there any way that you can restrict an API key to a specific Android app package name? I'm guessing probably not but thought I'd ask because that could make it very easy to use the special API key. It wouldn't need to be protected because it wouldn't work in any app but the officially released Collect. That's what Google has done (but of course they're entirely Android-centric).

As part of this work, I think it makes sense to rethink how users specify the various layers that should be shown, as @zestyping alluded to in his original post. Currently, there's a Mapping section in user interface settings with two preferences: Mapping SDK and Basemap. I'd like to propose that we remove "Mapping SDK" since that is not something a user should care about and instead have the following preferences:

  • Online basemap. Options will include the Google basemaps, OSM basemaps, Mapbox basemaps and none. If a selection is made here, that will determine which SDK is used behind the scenes.
  • Offline basemap. These can be rasters or vectors. If no online basemap was selected, the Mapbox SDK will be used. If a user selects a Google online basemap and a vector offline basemap, some kind of error message will be shown.
  • (Eventually) Editable vector layer (wording to be determined)

@Ivangayton, I'm particularly interested in your feedback on that proposal. Note that I'm suggesting one online basemap from a fixed list and one offline basemap that is user-specified.

We can start thinking about selectable and editable GeoJSON support in parallel but that will be considered a separate feature or more likely two (select may be a pretty low bar). Sample data files and desired behavior from @mathieubossaert and @Ivangayton will help guide that. No urgency so it will be quand @mathieubossaert pourra à nouveau respirer!

1 Like