-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use separate Google API key for GeoCoding requests #1158
Comments
Hi Sam, Thanks for reporting this. There is a setting but I'll have to look what's going on (Google Cloud API issue or Enketo bug). It's also not working on https://enke.to/::widgets, I noticed. It's supposed to work if a valid Google API key is used and GeoCoding is enabled in (Ona'a) Google Cloud API account. |
|
Looks like API keys should have IP restrictions instead of referrer (domain) restrictions. Must have been a recent enforcement change on Google's side. Unfortunately, IP restrictions wouldn't work for client-side requests straight to Google Cloud. {
"error_message" : "API keys with referer restrictions cannot be used with this API.",
"results" : [],
"status" : "REQUEST_DENIED"
} https://developers.google.com/maps/faq#browser-keys-blocked-error |
Solutions:
For now I have chosen option 1 on my servers. I think option 2 is the way to go, but will require an enketo configuration change (and slight redesign ideally) which can be painful for Enketo installers. |
This seems like the way to go - rather than requiring another string of dependencies in the client side. It would allow enketo to switch geocoder providers on the back-end as well without having to change the enketo frontend. For instance if someone wanted to use mapbox. |
I think it is currently no longer possible to get maps and geocoding both working in an Enketo installation (1 or the other), so this has become urgent. |
I'm happy to make a pull request - just trying to get the dev environment set up. We're seeing the same issue. I'd like to make a generic geocoding service that could be swapped out with any provider if possible. I currently use Mapbox - for example. I could see it being configured like this for example: // config.json
geocoder: {
provider: 'mapbox',
apiKey: 'xxxx'
} //config.json
geocoder: {
provider: 'google',
apiKey: 'xxxx',
} |
I like that. Thanks in advance! I guess, you'll be adding specific code for the supported providers to request and parse the response of each. MapBox and Google seem great to support out-of-the box. Some changes will be required in Enketo-Core as well (in the geo widget). It's okay if geoCoding doesn't really work in Enketo Core, as long as we can provide some mock response (as returned by Enketo Express) to test it. |
I've updated the MR's for both enketo core and enketo - definitely no rush on checking them out but let me know if there's any changes that would be helpful! |
I have noticed that when you search a location when collecting geopoint, geotrace or geoshape to a specific location it does not work on odk.enke.to and enketo.ona.io but it works on ee.kobotoolbox.org.
Is there a configuration we need to change to enable this search function on enketo.ona.io?
You can use this form to test
date_testing.xlsx
The text was updated successfully, but these errors were encountered: