Wonderful, thank you for opening this @zestyping
On the question of tokens, what we had proposed was:
-
For the official, app-store app, ODK uses an access token linked to a single ODK-managed account and we'd work with ODK to keep the account traffic covered for free (like how Google does currently for ODK Collect's Google API services, right?). Would it be possible to have a built-in access token in the app when downloaded? Why would you need to distribute the access token?
-
With a built-in token, users of the official app wouldn't ever need to think about tokens if they didn't want to. They would be able to use the Mapbox styles that are offered from ODK's account, without ever needing to set up a Mapbox account themselves. (If they wanted to use styles from their own Mapbox account, they'd have to either a) make the style
public
and use it with the built-in ODK access token via some way to enter a custom map style URL or b) have a way to enter their own access token.) -
However, since ODK Collect is open source and can be forked to be used in any number of ways, we'd need to keep this token hidden to prevent token abuse (i.e., token not publicly published to Github and won't carry over to any clone/fork of the ODK Collect repo). This means that if developers want to create a fork of ODK Collect and use the Mapbox SDK, they would need to have their own Mapbox account and use their own token. That seemed acceptable in the discussion over in Adding Mapbox vector tile basemaps - #28 by Marena
-
I think your two mode option (access token or no access token) could work - but why not simply build it so there is a built-in access token, linked to an ODK-managed (and Mapbox-couponed) account?
For the other part of your question, @zestyping, yes the code for the Mapbox SDK is open source so there might be ways you could build a way to use the code without needing to link it to Mapbox services (e.g. your own raw GeoJSON files). (@langstonsmith please correct me if I'm wrong here.) There's no guarantee how well this would work, how well it would continue to work through various versions, and Mapbox volunteers would be limited in the amount of support we'd be able to provide (because it would be departing from the use cases that we're building for).
One of the big benefits of using the Mapbox SDK is access to the Mapbox basemap data. And we are willing to provide the basemap data for free to ODK Collect users via a central couponed Mapbox account. So if there is a way to address the concerns about access tokens while still providing Mapbox map data, that seems like the better option.
Please let me know if there are complications that I'm overlooking (for example, is it difficult to have a built-in, but hidden, access token within the ODK Collect app?)