我已经尝试了几个小时让地理编码器与谷歌一起工作。我或多或少想弄清楚如何配置我的谷歌帐户和下面的代码以使地理编码器工作
Geokit::Geocoders::GoogleGeocoder.client_id = ''
Geokit::Geocoders::GoogleGeocoder.cryptographic_key = ''
对于我尝试过的各种参数,我从谷歌得到以下回复。
Unable to authenticate the request. Provided 'signature' is not valid for the provided
client ID. Learn more:
https://developers.google.com/maps/documentation/business/webservices/auth
在 Google Developer 面板上,有以下选项: 1. 默认情况下,Compute Engine 和 App Engine 会提供 Client ID 和 Email Address 字段。我启用了以下 API:BigQuery、Geocoding、Google Cloud SQL、Google Cloud Storage、Google Storage JSON API、Google Maps API v3、Google Maps Coordinate API、Google Maps Geolocation API
当您单击创建新的客户端 ID 时,您会看到三个选项:Web 应用程序、服务帐户和已安装的应用程序。我已经尝试过 Web 应用程序和安装的应用程序,它们都提供了一个名为“Client Secret”的字段,我将其输入到变量“cryptographic_key”中。它还提供了我在“client_id”字段中使用的客户端 ID。最后一个选项,服务,下载一个里面有私钥的证书。我不知道如何处理它,也无法提取私钥。
对此的任何帮助都会很棒。