apneadiving/Google-Maps-for-Rails — Issue #122: error when gmap is in "if" block
Author: mogadget
Created: 2011-12-01 14:48:40+00:00
State: open

Hi,
I wanted to control the map zoom so if search return just 1 enable auto_adjust the set the zoom to 12, it used to work before but when I moved to rails 3.1 im getting this strange error.

undefined method `>' for {[false, false, false, false]=>1}:ActiveSupport::OrderedHash

I put the gmap in my app helper i called it show_map

def show_map(hits, markers)
if hits > 1 then
gmaps(:markers => {:data => markers},:map_options => {:container_id => "front-container",:id => "map", :zoom=> 0})
else
gmaps(:markers => {"data" => markers},:map_options => {:container_id => "front-container",:id => "map", :auto_adjust => true,:auto_zoom => false, :zoom => 12})
end
end

in my view (haml)

=show_map(@thehits.size, @gmark)

Have you seen this before or maybe im missed anything?