adopt-a-hydrant/app/views/layouts/application.html.erb

39 lines
1.3 KiB
Plaintext
Raw Normal View History

2011-02-14 18:28:51 +00:00
<!DOCTYPE html>
<html>
2011-02-14 18:49:00 +00:00
<head>
2011-02-23 22:24:08 +00:00
<title>Adopt a Hydrant</title>
2011-02-14 18:49:00 +00:00
<%= stylesheet_link_tag "main" %>
2011-02-14 20:27:18 +00:00
<%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" %>
2011-02-14 18:49:00 +00:00
<%= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false" %>
2011-02-25 20:34:39 +00:00
<%= javascript_include_tag "snowstorm" %>
2011-02-25 21:34:01 +00:00
<script type="text/javascript">
$(function() {
var map;
var latlng = new google.maps.LatLng(<%= @lat %>, <%= @lng %>);
var myOptions = {
zoom: <%= @zoom %>,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
2011-02-25 21:49:45 +00:00
var redMarker = '/images/markers/red.png';
var greenMarker = '/images/markers/green.png';
<% @hydrants.each do |hydrant| %>
var h<%= hydrant.city_id %>LatLng = new google.maps.LatLng(<%= hydrant.lat %>, <%= hydrant.lng %>);
var h<%= hydrant.city_id %>Marker = new google.maps.Marker({
position: h<%= hydrant.city_id %>LatLng,
map: map,
icon: <%= hydrant.user_id ? "greenMarker" : "redMarker" %>
});
<% end %>
2011-02-25 21:34:01 +00:00
})
</script>
2011-02-14 18:49:00 +00:00
<%= csrf_meta_tag %>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
</head>
2011-02-14 20:27:18 +00:00
<body>
2011-02-14 18:49:00 +00:00
<%= yield -%>
</body>
2011-02-14 18:28:51 +00:00
</html>