Add Google Map of voters
[selectricity-live] / vendor / plugins / ym4r_gm / lib / gm_plugin / control.rb
diff --git a/vendor/plugins/ym4r_gm/lib/gm_plugin/control.rb b/vendor/plugins/ym4r_gm/lib/gm_plugin/control.rb
new file mode 100644 (file)
index 0000000..99b3e58
--- /dev/null
@@ -0,0 +1,64 @@
+module Ym4r\r
+  module GmPlugin\r
+    #Small map control. Report to the Google Maps API documentation for details.\r
+    class GSmallMapControl\r
+      include MappingObject\r
+      def create\r
+        "new GSmallMapControl()"\r
+      end\r
+    end\r
+    #Large Map control. Report to the Google Maps API documentation for details.\r
+    class GLargeMapControl\r
+      include MappingObject\r
+      def create\r
+        "new GLargeMapControl()"\r
+      end\r
+    end\r
+    #Small Zoom control. Report to the Google Maps API documentation for details.\r
+    class GSmallZoomControl\r
+      include MappingObject\r
+      def create\r
+        "new GSmallZoomControl()"\r
+      end\r
+    end\r
+    #Scale control. Report to the Google Maps API documentation for details.\r
+    class GScaleControl\r
+      include MappingObject\r
+      def create\r
+        "new GScaleControl()"\r
+      end\r
+    end\r
+    #Map type control. Report to the Google Maps API documentation for details.\r
+    class GMapTypeControl\r
+      include MappingObject\r
+      def create\r
+        "new GMapTypeControl()"\r
+      end\r
+    end\r
+    #Overview map control. Report to the Google Maps API documentation for details.\r
+    class GOverviewMapControl\r
+      include MappingObject\r
+      def create\r
+        "new GOverviewMapControl()"\r
+      end\r
+    end\r
+\r
+    #An object representing a position of a control.\r
+    #The first argument of the constructor is one of the following : :top_right, :top_left, :bottom_right, :bottom_left.\r
+    class GControlPosition < Struct.new(:anchor,:offset)\r
+      include MappingObject\r
+      def create\r
+        js_anchor = if anchor == :top_right\r
+                      "G_ANCHOR_TOP_RIGHT"\r
+                    elsif anchor == :top_left\r
+                      "G_ANCHOR_TOP_LEFT"\r
+                    elsif anchor == :bottom_right\r
+                      "G_ANCHOR_BOTTOM_RIGHT"\r
+                    else\r
+                      "G_ANCHOR_BOTTOM_LEFT"\r
+                    end\r
+        "new GControlPosition(#{js_anchor},#{offset})"\r
+      end\r
+    end\r
+  end\r
+end\r

Benjamin Mako Hill || Want to submit a patch?