Class: Kamelopard::ListStyle
- Inherits:
-
ColorStyle
- Object
- Object
- ColorStyle
- Kamelopard::ListStyle
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s ListStyle object. Color is stored as an 8-character hex string, with two characters each of alpha, blue, green, and red values, in that order, matching the ordering the KML spec demands.
Instance Attribute Summary collapse
-
#bgColor ⇒ Object
Returns the value of attribute bgColor.
-
#href ⇒ Object
Returns the value of attribute href.
-
#listItemType ⇒ Object
Returns the value of attribute listItemType.
-
#state ⇒ Object
Returns the value of attribute state.
Attributes inherited from ColorStyle
Attributes inherited from Object
Instance Method Summary collapse
-
#initialize(bgcolor = nil, state = nil, href = nil, listitemtype = nil) ⇒ ListStyle
constructor
A new instance of ListStyle.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from ColorStyle
#alpha, #alpha=, #blue, #blue=, #green, #green=, #red, #red=, #validate_colorMode
Constructor Details
#initialize(bgcolor = nil, state = nil, href = nil, listitemtype = nil) ⇒ ListStyle
Returns a new instance of ListStyle.
1013 1014 1015 1016 1017 1018 1019 |
# File 'lib/kamelopard/classes.rb', line 1013 def initialize(bgcolor = nil, state = nil, href = nil, listitemtype = nil) super(nil, :normal) @bgcolor = bgcolor @state = state @href = href @listitemtype = listitemtype end |
Instance Attribute Details
#bgColor ⇒ Object
Returns the value of attribute bgColor.
1011 1012 1013 |
# File 'lib/kamelopard/classes.rb', line 1011 def bgColor @bgColor end |
#href ⇒ Object
Returns the value of attribute href.
1011 1012 1013 |
# File 'lib/kamelopard/classes.rb', line 1011 def href @href end |
#listItemType ⇒ Object
Returns the value of attribute listItemType.
1011 1012 1013 |
# File 'lib/kamelopard/classes.rb', line 1011 def listItemType @listItemType end |
#state ⇒ Object
Returns the value of attribute state.
1011 1012 1013 |
# File 'lib/kamelopard/classes.rb', line 1011 def state @state end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 |
# File 'lib/kamelopard/classes.rb', line 1021 def to_kml(elem = nil) k = REXML::Element.new 'ListStyle' super k Kamelopard.kml_array(k, [ [@listitemtype, 'listItemType'], [@bgcolor, 'bgColor'] ]) if (! @state.nil? or ! @href.nil?) then i = REXML::Element.new 'ItemIcon' Kamelopard.kml_array(i, [ [ @state, 'state' ], [ @href, 'href' ] ]) k.elements << i end elem.elements << k unless elem.nil? k end |