Add welcome page with Google Map

This commit is contained in:
Erik Michaels-Ober 2011-02-14 13:49:00 -05:00
parent c749f63b1f
commit 6d04f19366
9 changed files with 43 additions and 12 deletions

View File

@ -0,0 +1,2 @@
class WelcomeController < ApplicationController
end

View File

@ -0,0 +1,2 @@
module WelcomeHelper
end

View File

@ -1,14 +1,14 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>AdoptAHydrant</title> <title>AdoptAHydrant</title>
<%= stylesheet_link_tag :all %> <%= stylesheet_link_tag "main" %>
<%= javascript_include_tag :defaults %> <%= javascript_include_tag "maps" %>
<%= csrf_meta_tag %> <%= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false" %>
</head> <%= csrf_meta_tag %>
<body> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
</head>
<%= yield %> <body onload="initialize()">
<%= yield -%>
</body> </body>
</html> </html>

View File

@ -0,0 +1,3 @@
<div id="map_canvas" style="width:100%; height:100%">
</div>

View File

@ -48,7 +48,7 @@ AdoptAHydrant::Application.routes.draw do
# You can have the root of your site routed with "root" # You can have the root of your site routed with "root"
# just remember to delete public/index.html. # just remember to delete public/index.html.
# root :to => "welcome#index" root :to => "welcome#index"
# See how all your routes lay out with "rake routes" # See how all your routes lay out with "rake routes"

View File

@ -0,0 +1,9 @@
function initialize() {
var latlng = new google.maps.LatLng(42.358431,-71.059773);
var myOptions = {
zoom: 14,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}

View File

@ -0,0 +1,3 @@
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }

View File

@ -0,0 +1,8 @@
require 'test_helper'
class WelcomeControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

View File

@ -0,0 +1,4 @@
require 'test_helper'
class WelcomeHelperTest < ActionView::TestCase
end