Summary: is there an alternative option to capture a GPS location via Google Maps instead of the phone GPS?
Background: we have over 6,000 communities registered via CommCare. Each community is realized as a case, with each person case linked to a community case. For each community we capture the population and travel time to the nearest health facility (in minutes). The health worker also has the option to capture the GPS location of the community; however, this is not always practical, as the community may be a relatively long distance away from the CommCare app user. Also, historically, we have not emphasized or enforced the capture of community locations.
Part of our COVID response will include enhanced charts and maps. For this to work well, we are looking to increase the % of communities that have a GPS locations. We are currently at about 50%. Given the current situation in Guatemala, health care workers are often unable to travel to communities (ie. due to curfews, reduced public transportation options, etc.).
So, from a UX perspective, we would like to allow the user to capture the GPS using a simple integration with Google maps, as an alternative to the phone GPS.
Hopefully this is already feasible, or someone could recommend an alternative workflow that would allow users to capture and provided accurate community location information. In general, we expect the person responsible for this will know the location of each community and able to accurately find it on a map. Each user may have 5-20 communities to do this for (our primary users are auxiliary nurses, based in rural health posts).
The platform should support this by allowing you to set the appearance attribute of a Geopoint Question to:
which will initially zoom in on the user’s location and then let you set a manual location by single clicking the map (make sure you tap and don’t drag when you are selecting the point).
This is a little used feature which appears to have a small bug in current releases. We will get that hotfixed ASAP.
If you want to prepare the form and test the functionality, I think the APK from our continuous testing/integration pipeline should work correctly to reflect how the feature will appear when fixed.
The other alternative would be to enter the data with Web Apps which will let you pick geopoints from a map UI as well.
Thanks Clayton. We’ll give it a try. Ray
The fix for the issue with the “maps” appearance atrribute has now been pushed out on Playstore as well. Please make sure you update your CommCare app from playstore and get on our latest release 2.48.3 when you decide to give this feature a try. Thanks!
Hi Shubham, thanks for the quick action. We have our initial prototype ready to test out. I just re-installed CommCare on my phone and it’s still 2.48.1. I assume it will take a bit longer for the update to roll-out to everyone. I’ll check again later today.
In the meantime, a question (since I cannot yet test myself): if we load the current GPS coordinates, whether initially captured via the phone GPS or with a map, will the initial map be centered on the loaded location or centered on the current location of the user?
I know Clayton wrote “initially zoom in on the user’s location”, but I was not sure if this was always the case, or only if the form property was not set.
Scenario: we may want to use this feature to allow users to ‘tweak’ or ‘correct’ existing location, so would be helpful to initialize the map accordingly.
Thanks again, Ray
Update: I now have an update version of CommCare and the map capture is working!
Regarding the user experience when updating an existing location, it seems to work as follows:
- User can use the ‘Show location’ to see where the current (previous) location was captured
- When choosing ‘Replace location’ to choose a new location, the map is centered on the current location of the user, and not the location previously saved in the case and loaded into the form as a default
I suspect this is working as designed/intended. However, I wonder if it would be feasible to have the ‘Replace Location’ option start with a marker at the previous/current location rather then the current location of the user. Hope this makes sense.
A bit more feedback: it turns out the that default map base layer works pretty well in suburban Canada, but very poorly in rural Guatemala. I don’t see a way to choose an alternative base layer in the location picker, like I can do in Google Maps. Is there a way to enable that? Satellite layer will likely be required, at least as an option. Thanks.
We have a PR up for fixing the first issue you outlined. It is possible for us to switch the base layer in the map, we’ll explore the best way to make that configurable and let you know ASAP.
Great. Thanks. Just a note that we are exploring potential alternatives in parallel with this. We have a custom dashboard/reporting/etc. web-app where it may be feasible to include this functionality as well. I’d prefer to have it embedded directly in the CommCare application, but we may have alternatives if the UX does not work out. During our initial testing, the auto-panning of the map negatively impacted usability (ie. it was difficult to pan and zoom to a new location, because the map kept auto-panning to the initial window until we set a placemarker).
One suggestion for what you are describing - As of the latest change (coming out very soon) if the map already has a default point set it will disable the ‘track to the user’s current location’ behavior.
If you set the “Default” value for the gps question to be a point which is close enough by that it will make it easier for users to track around to find the next point, that should disable the initial “auto-seek to user location” and give them a clearer point of reference. Would that work for you?
Yes, that sounds like a good change. Happy to give it a try and provide feedback once it is available. Pretty important to also have support for satellite layers to evaluate the overall experience. So, if layer support is not yet ready, it may make sense to wait for that. Thanks, Ray
The update should be out on the play store now with these changres.
It’s taking a bit longer for Google’s caches to update with the new version, but you can manually update from the github artifacts to start testing.
We will also be updating HQ soon (today or tomorrow) with an app setting which will let you set the default terrain layer for the app ahead of time.
We’ve rolled out change to our application that allow the user to use either the ‘capture current location’ or ‘capture location on a map’ UI to record the location of a patient. The changes made earlier this year, including alternative basemap, make this much more usable. Two things we’ve noticed:
- When we don’t set the default location, we would like the map to start centered on the current location of the user. In some situations we will have a better ‘default’ location available to set, but not always. In general, the current location of the user is a good starting point. So, can we somehow set the default location to match the current location of the user when we don’t have something more appropriate to set it to?
- When using the map UI, can we force the user to choose a location? It seems like the form property is being set to “0.0 0.0 0.0 0.0” by default, so our existing check to require this form property to be non-null is not working as intended. We could possibly expand the condition to check for this ‘null’ value, but was not sure if that is the best approach.
Great to hear back from you. Both of these are great suggestions. #1 seems to be a bug on our side and we will get it fixed soon in a playstore release. Fixing #1 should automatically result in a better behaviour in regards to your second point since map will get initialized with the user’s current location rather than “0.0 0.0 0.0 0.0”. We will further implement a check in the same release to not allow “0.0 0.0 0.0 0.0” as a valid location input from user as that could still happen when user tries to record a location before CommCare getting a fix on user’s current location. I will update this thread as soon as we make this release available on playstore. Thanks for making this feature much more usable with your inputs.
Ray, the suggested changes above were deployed as CommCare 2.49.7 on Playstore. Please let us know in case you face any further issues. Thanks.