【问题标题】:How to Setup Geokit with Google geocoder: client_id and cryptographic_key如何使用 Google 地理编码器设置 Geokit:client_id 和 cryptographic_key
【发布时间】:2023-03-25 06:19:02
【问题描述】:

我已经尝试了几个小时让地理编码器与谷歌一起工作。我或多或少想弄清楚如何配置我的谷歌帐户和下面的代码以使地理编码器工作

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 开发者面板上,有以下选项: 1. 默认情况下,为 Compute Engine 和 App Engine 提供客户端 ID 和电子邮件地址字段。我启用了以下 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。最后一个选项,服务,下载一个里面有私钥的证书。我不知道如何处理它,无法提取私钥。

在这方面的任何帮助都会很棒。

【问题讨论】:

    标签: google-maps google-maps-api-3 google-geocoder google-geocoding-api geokit


    【解决方案1】:

    我想你想要: Geokit::Geocoders::GoogleGeocoder.api_key = 'myApiKey'

    这是您用于免费服务的密钥,如果您使用的是付费的“Maps API for Business”,那么这两个参数是正确的。

    这在当前的自述文件中。可能是文档不够清楚?

    【讨论】:

      【解决方案2】:

      你去过https://developers.google.com/maps/documentation/business/webservices/auth

      这几乎概括了您需要什么以及从哪里获得它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-14
        • 1970-01-01
        • 2013-05-06
        相关资源
        最近更新 更多