Colton Seal
Colton Seal

Reputation: 379

Ruby Geocoder for google business

Im using the Geocoder gem for ruby. With V2 of the google maps API for business you could pass in your API key in config/initializers/geocoder.rb in V3 of the API they no longer give you an API key but rather a client-id which is basically a cryptographic key that you use to create a signature for the url. Since I cannot obtain an API Key I dont quite know how to do the latter. Has anyone ran into this problem? If so could you please point me in a direction other than googles documentation.

Upvotes: 0

Views: 79

Answers (1)

eabraham
eabraham

Reputation: 4164

The following config should work(Replace with your own information):

# -*- encoding : utf-8 -*-
Geocoder.configure do |config|
  config.lookup = :google_premier
  config.api_key = [ 'GOOGLE_CRYPTO_KEY', 'GOOGLE_CLIENT_ID', 'GOOGLE_CHANNEL' ]
  config.timeout = 10
  config.units = :km
end

Upvotes: 1

Related Questions