We're considering a big change, and as usual we'd like to air it here and collect some feedback from you, our community, before moving forward.
Today, ODK Collect offers a choice of two Mapping SDKs (in the General Settings under "User interface"):
Google Maps for Android: This is the built-in map SDK on Android, provided by Google. It's designed primarily to show the Google basemap, and it has a user interface that feels like the Google Maps app.
OSMdroid: This is an open-source library for drawing maps. Although it's called OSMdroid, it's not specific to OSM; it's really just a library for displaying any raster map tiles. By default, we configure it to use map tiles from OSM.
It's useful to make a distinction between the map SDK and the map data. Currently, the "Mapping SDK" setting is effectively a choice between Google map data and OSM map data, because the two SDKs are configured that way. But any SDK could be used to display any map data, if it's in a format that the SDK supports.
We're considering adding the Mapbox SDK for Android. If we go this route, it will probably replace the OSMdroid library, because it looks like it offers all the functionality of OSMdroid and more. There are several motivations:
The Mapbox SDK can draw maps using raster tiles (like OSMdroid today) or vector tiles (which are faster and more responsive).
If used with the online map data provided by Mapbox, we'd have a beautiful, fast, vector-based map based on OSM data.
Support for vectors would allow us to support offline vector map tiles, which are far more storage-efficient than offline raster map tiles. The difference is significant enough that this may enable new use cases that previously required prohibitively large files.
The Mapbox SDK has built-in support for displaying GeoJSON. This is useful in itself, and also opens the door toward the possible future goal of interacting directly with preloaded geometry (e.g. collecting data about existing roads or buildings).
The Mapbox SDK is being actively developed. We currently use OSMdroid 5.6.4, which is 2+ years old; the current version is 6.1.0. If we want to benefit from OSMdroid's ongoing development, we'll need to migrate to 6.1.0, which offers lots of new features, but also has some major and incompatible changes.
Notably, however, the Mapbox SDK documentation says that you must sign up for a Mapbox access token in order to use the SDK. We don't want users to be required to register with a commercial entity in order to use ODK Collect—so either we would need to package our app with a built-in access token (i.e., get permission from Mapbox to distribute a special ODK access token), or we would need to find a way to use the Mapbox SDK without an access token.
It would make sense that the access token exists to control access to the online map data provided by Mapbox, not to prevent use of the SDK code itself. The Mapbox SDK for Android is open source, so it seems like it should be possible to use it to display your own map data without an access token. And I've confirmed this—I can initialize the SDK with a blank token and tell it to display a GeoJSON file, for example, and it works just fine. It would be nice to know how Mapbox feels about using their SDK this way—is it considered impolite, or could we reasonably expect the SDK to continue to work on non-Mapbox data with a blank access token? @Marena, can you shed some light on this?
Here's what we're currently imagining. If the Mapbox SDK is selected, it operates in one of two modes:
If there is an access token (either we distribute one or the user enters one), we display the beautiful Mapbox vector basemaps.
If there's no access token, we fall back to displaying the same OpenStreetMap raster tiles that OSMdroid uses now.
I'm going to be exploring this possibility over the next couple of weeks to determine its feasibility. I'd love to hear what you all think about this plan!
Thanks for your input!