posm / OpenMapKitAndroid

http://openmapkit.org
BSD 3-Clause "New" or "Revised" License
128 stars 38 forks source link

constraint.json Files as ODK Media Files #156

Closed jasonrogena closed 7 years ago

jasonrogena commented 7 years ago

Right now, the form specific configuration files placed in /sdcard/openmapkit/constraints/ have to be manually placed there. It might be a good idea to add functionality for fetching this configuration file from ODK's media directory. This will help in setups where we don't have the luxury of placing this file in all the devices (for instance, in cases where a lot of devices are being used).

I suggest a feature where if OpenMapKit is launched from ODK Collect, for instance, for a form named 'form 1', OMK checks whether a file named 'omk-constraints.json' exists in /sdcard/odk/forms/form 1-media/ and copies this file to /sdcard/openmapkit/constraints/ as 'form 1.json'. This will allow for guys to publish their OMK form specific constraints file alonside the ODK form on ODK Aggregate/Formhub/ona.io

hallahan commented 7 years ago

This sounds like a pretty straightforward thing that could be implemented.

I think the initial idea is that custom constraints would be a part of a deployment. When you download MBTiles and OSM files as a part of a deployment, the custom constraint file would come with it. When you're getting your deployment with all that you need, that too would include your constraint.json.

But, looking in the forms media directory in ODK sounds reasonable to me.

hallahan commented 7 years ago

Merged PR.