GoogleMaps problem using YM4R Clusterer

I’m trying to use the clusterer with YM4R and simply can’t get it to
work. I’ve gone through the readme and think I’m following everything
exactly. Before I started trying to implement the clusterer, my map was
displaying fine. No I can’t even get the map to show up on the page.
I’ve done some google searches and can’t find any examples of how to
implement this. Any help would be greatly appreciated.

Here’s the code. There are multiple places in the controller where I’ve
tried different things and they haven’t worked, so I’ve commented them
out.

In my view:
<% if nil != @map %>
<%= GMap.header %>
<%= javascript_include_tag(“clusterer”) %>
<%= @map.to_html %>
<% end %>

In my controller
def view_dealers
@prodlist = Product.find_all
@map = GMap.new(“map_div”)
@map.control_init(:large_map => true,:map_type => true)
@map.center_zoom_init([38.4, -100],4)
gmarkers = Array.new
@dealers = Dealer.find(:all, :order => “state_id ASC, name ASC”)
@dealers.each do |dealer|
unless dealer.address == “”
dealer_address = dealer.address + " " + dealer.city + ", " +
dealer.state.name + " " + dealer.zip
unless dealer.phone == “”
dealer_phone = "Phone: " + dealer.phone + “

else
dealer_phone = “”
end
unless dealer.fax == “”
dealer_fax = "Fax: " + dealer.fax + “

else
dealer_fax = “”
end
dealer_title = dealer.name
info_window_text = dealer.name + "
" + dealer.address + "
" +
dealer.city + ", " + dealer.state.name + " " + dealer.zip + “”

” + dealer_phone + dealer_fax +
” + dealer.url + “
else
info_window_text = “Street address not specified”
end

Attempt to put GMArkers in array to create cluster

gmarkers.push(GMarker.new(dealer_address,:title => dealer_title,
:info_window => info_window_text))
#gmarkcluster.AddMarker(gmarkers[gmarkers.size])
end

gmarkcluster = Clusterer.new(gmarkers, :min_markers_per_cluster => 2)
@map.overlay_init gmarkcluster
#@map.addOverlay(gmarkcluster)
#@map.overlay_global_init(GMarkerGroup.new(true,gmarkers),“mycluster”)
end

Again, I’m desperate for help. Thanks in advance.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs