0

私はGeocodergemを使用していますが、正常に動作しています。今、私はgoogle_premierが以下のエラーを取得してアップグレードしようとしました

1.9.2p320 :001 > Geocoder.search("Hyderabad")
Geocoding API's response was not valid JSON.
 => [] 

config / initializers/geocoder.rbに新しいファイルが追加されました。これが私の設定設定です

Geocoder::Configuration.lookup = :google_premier
Geocoder::Configuration.api_key = "xxx-key"
4

2 に答える 2

0

ジオコーダーが送信しないようにするには、ジオコーダー構成の api_key 行にコメントを付けるだけです。Google ジオコーダ DOS は API キーを必要としません...

Geocoder.rb の例:

# -*- encoding : utf-8 -*-
Geocoder.configure(
    :timeout  => 5,
    :lookup   => :google,
    #:ip_lookup => :google,
    #:api_key  => "xxxx-xxx",
    :units    => :km
)
于 2013-06-24T23:18:52.437 に答える