Add Google Map of voters
[selectricity-live] / vendor / plugins / ym4r_gm / lib / gm_plugin / control.rb
1 module Ym4r\r
2   module GmPlugin\r
3     #Small map control. Report to the Google Maps API documentation for details.\r
4     class GSmallMapControl\r
5       include MappingObject\r
6       def create\r
7         "new GSmallMapControl()"\r
8       end\r
9     end\r
10     #Large Map control. Report to the Google Maps API documentation for details.\r
11     class GLargeMapControl\r
12       include MappingObject\r
13       def create\r
14         "new GLargeMapControl()"\r
15       end\r
16     end\r
17     #Small Zoom control. Report to the Google Maps API documentation for details.\r
18     class GSmallZoomControl\r
19       include MappingObject\r
20       def create\r
21         "new GSmallZoomControl()"\r
22       end\r
23     end\r
24     #Scale control. Report to the Google Maps API documentation for details.\r
25     class GScaleControl\r
26       include MappingObject\r
27       def create\r
28         "new GScaleControl()"\r
29       end\r
30     end\r
31     #Map type control. Report to the Google Maps API documentation for details.\r
32     class GMapTypeControl\r
33       include MappingObject\r
34       def create\r
35         "new GMapTypeControl()"\r
36       end\r
37     end\r
38     #Overview map control. Report to the Google Maps API documentation for details.\r
39     class GOverviewMapControl\r
40       include MappingObject\r
41       def create\r
42         "new GOverviewMapControl()"\r
43       end\r
44     end\r
45 \r
46     #An object representing a position of a control.\r
47     #The first argument of the constructor is one of the following : :top_right, :top_left, :bottom_right, :bottom_left.\r
48     class GControlPosition < Struct.new(:anchor,:offset)\r
49       include MappingObject\r
50       def create\r
51         js_anchor = if anchor == :top_right\r
52                       "G_ANCHOR_TOP_RIGHT"\r
53                     elsif anchor == :top_left\r
54                       "G_ANCHOR_TOP_LEFT"\r
55                     elsif anchor == :bottom_right\r
56                       "G_ANCHOR_BOTTOM_RIGHT"\r
57                     else\r
58                       "G_ANCHOR_BOTTOM_LEFT"\r
59                     end\r
60         "new GControlPosition(#{js_anchor},#{offset})"\r
61       end\r
62     end\r
63   end\r
64 end\r

Benjamin Mako Hill || Want to submit a patch?