lib/geocoder/lookups/google_premier.rb in geocoder-1.1.3 vs lib/geocoder/lookups/google_premier.rb in geocoder-1.1.4

- old
+ new

@@ -6,18 +6,19 @@ module Geocoder::Lookup class GooglePremier < Google private # --------------------------------------------------------------- - def query_url(query, reverse = false) - params = { - (reverse ? :latlng : :address) => query, - :sensor => 'false', - :language => Geocoder::Configuration.language, + def query_url_params(query) + super.merge(query_url_google_params(query)).merge( + :key => nil, # don't use param inherited from Google lookup :client => Geocoder::Configuration.api_key[1], :channel => Geocoder::Configuration.api_key[2] - }.reject{ |key, value| value.nil? } - path = "/maps/api/geocode/json?#{hash_to_query(params)}" + ) + end + + def query_url(query) + path = "/maps/api/geocode/json?" + url_query_string(query) "#{protocol}://maps.googleapis.com#{path}&signature=#{sign(path)}" end def sign(string) raw_private_key = url_safe_base64_decode(Geocoder::Configuration.api_key[0])