3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/helpers/map_helper.rb', line 3
def address_fields_map( address_fields )
json = address_fields.to_gmaps4rails do |address_field, marker|
marker.title address_field.profileable.title
if address_field.profileable.kind_of? Group
marker.picture({
picture: image_path("img/gmaps_yellow_marker_38.png"),
width: 22, height: 38
})
end
end
raise 'no json generated from address fields' unless json
marker_options = {}
gmaps( :markers => { :data => json, :options => marker_options },
:map_options => { :auto_adjust => true, :auto_zoom => true }
)
end
|