_google_maps.rhtml
828 Bytes
<div style="clear: both;"></div>
<div style='text-align: center;'>
<div id="map"></div>
</div>
<%= content_tag('script', '', :src => "http://maps.google.com/maps/api/js?sensor=true", :type => 'text/javascript') %>
<%= javascript_include_tag('google_maps') %>
<%
icon = default_or_themed_icon("/images/icons-map/enterprise.png")
%>
<script type='text/javascript'>
mapLoad(<%= GoogleMaps.initial_zoom.to_json %>);
<% @searches.each do |name,search| %>
<% search[:results].each do |item| %>
<% if item.lat && item.lng %>
mapPutMarker(<%= item.lat.to_json %>, <%= item.lng.to_json %>, <%= item.name.to_json %>, '<%= icon %>',
'<%= url_for(:controller => :map_balloon, :action => name.to_s.singularize, :id => item.id) %>');
<% end %>
<% end %>
<% end %>
mapCenter();
</script>