lib/barometer/web_services/geocode.rb in barometer-0.6.3 vs lib/barometer/web_services/geocode.rb in barometer-0.6.4
- old
+ new
@@ -12,14 +12,14 @@
return nil unless _has_geocode_key?
location = self.get(
"http://maps.google.com/maps/geo",
:query => {
:gl => query.country_code, :key => Barometer.google_geocode_key,
- :output => "xml", :q => query.q
+ :output => "json", :q => query.q, :sensor => "false"
},
- :format => :xml, :timeout => Barometer.timeout
+ :format => :json, :timeout => Barometer.timeout
)
- location = location['kml']['Response'] if location && location['kml']
+ location = location['kml']['Response'] if (location && location['kml'])
location ? (geo = Data::Geo.new(location)) : nil
end
private