public
Fork of chrislo/google_maps
Description: extends geokit and gives convenient helpers for adding google maps to your applicaiton
Homepage:
Clone URL: git://github.com/sdague/google_maps.git
gmoeck (author)
Mon Jun 01 14:59:11 -0700 2009
sdague (committer)
Sat Sep 12 05:59:12 -0700 2009
name age message
file README Tue Nov 25 08:38:12 -0800 2008 update readme [bhedana]
file Rakefile Mon Nov 24 10:28:20 -0800 2008 initial commit [bhedana]
directory lib/ Loading commit data...
file license.txt Sat Apr 04 02:34:47 -0700 2009 Fixed typo in license.txt file name [chrislo]
file licenst.txt Sat Apr 04 02:34:47 -0700 2009 Fixed typo in license.txt file name [chrislo]
directory test/ Sat Apr 11 07:20:23 -0700 2009 helps to actually make the change. added unit ... [mrtho1]
README
GoogleMaps
=========

Works with geokit and adds convenient helper methods for your views


To Use:

1 - Set your Google Maps API Key in environment.rb (or somewhere else if you'd prefer)
  I'd suggest copying the configuration code out of your environment.rb and into an initializer named geokit

  # This key is good for localhost:3000, signup for more at http://www.google.com/apis/maps/signup.html
  GOOGLE_APPLICATION_ID = "ABQIAAAA3HdfrnxFAPWyY-aiJUxmqRTJQa0g3IQ9GZqIMmInSLzwtGDKaBQ0KYLwBEKSM7F9gCevcsIf6WPuIQ"


2 - Do something like this in a view.

  <%
  map = GoogleMap.new
  map.markers << GoogleMapMarker.new(:map => map, 
                                     :lat => 47.6597, 
                                     :lng => -122.318,
                                     :html => 'My House')
  %>
  <%= map.to_html %>
  <div style="width: 500px; height: 500px;">
    <%= map.div %>
  </div>


Advanced Usage
=========

1 - Use included icon classes

  # Available icon classes:
  # GoogleMapLetterIcon.new('A')
  # GoogleMapSmallIcon.new('yellow')
  <%
  map = GoogleMap.new
  icon = GoogleMapSmallIcon.new('blue')
  map.markers << GoogleMapMarker.new(:map => map, 
                                     :icon => icon,
                                     :lat => 47.6597, 
                                     :lng => -122.318,
                                     :html => 'My House',
                   :marker_icon_path => '/path/to/image',
                   :marker_hover_text => 'String to show on Mouse Over'
                  )
  %>
  <%= map.to_html %>
  <div style="width: 500px; height: 500px;">
    <%= map.div %>
  </div>