medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
438 stars 209 forks source link

API key required to search for location in geopoint enketo widget #6303

Open garethbowen opened 4 years ago

garethbowen commented 4 years ago

Describe the bug When trying to search for a location using the geopoint enketo widget it doesn't work and an error is shown in the console.

To Reproduce Steps to reproduce the behavior:

  1. Install the geopoint.xml demo form
  2. Go to Reports tab
  3. Click the New Action button and select the Geopoint form
  4. In the search field type a location and click the magnifying glass button
  5. Nothing happens. Check the error in the console.

Expected behavior The location is found and selected on the map. No error in the console.

Logs

{
   "error_message" : "You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account",
   "results" : [],
   "status" : "REQUEST_DENIED"
}

Environment

Additional context The widget fetches the api key from the config.json in enketo-core but we need to be able to configure it per project. Contribute to Enketo as required to allow passing the config or using an unrestricted API (maybe openstreetmaps?). Alternatively we could contribute a change which hides the search box if no api key is given.

ChinHairSaintClair commented 2 months ago

Just wondering if there has been any new developments in this area?

garethbowen commented 2 months ago

@ChinHairSaintClair I don't think so. I'm really interested in using a free offline first mapping alternative like OSM instead of Google Maps as the API costs and online first approach are always going to be a barrier to use. Is this something you're interested in using?

ChinHairSaintClair commented 1 month ago

@garethbowen. Your reasoning is sound, maps are really interesting. I believe we followed a similar approach years back when I worked on an offline-first mobile app in the agriculture field. As a result it seems I jumped the gun a bit, our stakeholders confirmed we'll be using an off-app map solution for our reporting. We won't be needing it at this time.