lib/geocoder/lookups/yandex.rb in geocoder-1.4.4 vs lib/geocoder/lookups/yandex.rb in geocoder-1.4.5
- old
+ new
@@ -45,14 +45,18 @@
if query.reverse_geocode?
q = query.coordinates.reverse.join(",")
else
q = query.sanitized_text
end
- {
+ params = {
:geocode => q,
:format => "json",
:plng => "#{query.language || configuration.language}", # supports ru, uk, be
:key => configuration.api_key
- }.merge(super)
+ }
+ unless (bounds = query.options[:bounds]).nil?
+ params[:bbox] = bounds.map{ |point| "%f,%f" % point }.join('~')
+ end
+ params.merge(super)
end
end
end