| Class | Ym4r::GmPlugin::GIcon |
| In: |
lib/gm_plugin/overlay.rb
|
| Parent: | Object |
Represents a definition of an icon. You can pass rubyfied versions of the attributes detailed in the Google Maps API documentation. You can initialize global icons to be used in the application by passing a icon object, along with a variable name, to GMap#icon_init. If you want to declare an icon outside this, you will need to declare it first, since the JavaScript constructor does not accept any argument.
| DEFAULT | = | Variable.new("G_DEFAULT_ICON") |
| copy_base | [RW] | |
| options | [RW] |
Options can contain all the attributes (in rubyfied format) of a GIcon object (see Google’s doc), as well as :copy_base, which indicates if the icon is copied from another one.
# File lib/gm_plugin/overlay.rb, line 63
63: def initialize(options = {})
64: @copy_base = options.delete(:copy_base)
65: @options = options
66: end
Creates a GIcon.
# File lib/gm_plugin/overlay.rb, line 68
68: def create
69: if @copy_base
70: c = "new GIcon(#{MappingObject.javascriptify_variable(@copy_base)})"
71: else
72: c = "new GIcon()"
73: end
74: if !options.empty?
75: "addOptionsToIcon(#{c},#{MappingObject.javascriptify_variable(@options)})"
76: else
77: c
78: end
79: end