Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@map = Map.new
    @mapper = GMap.new("map")
    @mapper.control_init(:large_map => true,:map_type => true)
    @mapper.center_zoom_init([30.637321,-96.346664],8)
    @maps = Map.find(:all, :conditions => ["approved = ?", true])

    @presenter = MapsPresenter.new(:mapper => @mapper, :maps => @maps, :user => current_user)

    @mapper.icon_global_init(GIcon.new(:image => "../images/rails.png",
     :icon_anchor => GPoint.new(7,7),
     :info_window_anchor => GPoint.new(9,2)), "rails_icon")

    @rails_icon = Variable.new("rails_icon")

    @tab1 = GInfoWindowTab.new('INFO', @marker_html)
    @tab2 = GInfoWindowTab.new('INFO', @marker_html)
    @window_tabs = [@tab1, @tab2]

    for map in @maps

      @window_tabs = @presenter.get_infowindow_html(map)
      @mapper.overlay_init(GMarker.new([map.lat, map.lng], 
        :title => map.name,
        :icon => @rails_icon,
        :info_window_tabs => @window_tabs))
    end
  end