/
README
31 lines (17 loc) · 1.09 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Geographer
==========
This plugin has basic Google mapping functionality. It can use the Geokit geocoder if it is installed.
If Geokit is installed, and you have a Google key already set up for it, then there is no further setup required for this plugin.
If you don't have Geokit, then you can set the key in an initializer:
Geographer::GOOGLE_KEY = 'Your key'
Example
=======
Put this in the <head> of your page:
<%= geographer_header %>
Then put this in your page content:
<%= map_tag(:query => '1600 Pennsylvania Ave NW,Washington,DC,20500', :width => '400px', :height => '300px', :controls => [ :zoom ]) %>
The geokit geocoder will find the address. Or you can pass a Geokit::Mappable object, as long as it uses the acts_as_mappable macro:
<%= map_tag(:mappable => @location, :width => '400px', :height => '300px', :controls => [ :zoom ]) %>
If you don't want to use the geocoder, you can set the location manually, as well as set other options.
<%= map_tag(:center => [ 35, -167 ], :zoom => 3, :controls => [ :large ]) %>
Copyright (c) 2008 Glenn Powell, released under the MIT license