Class: Kamelopard::ListStyle
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. – This doesn’t descend from ColorStyle because I don’t want the to_kml() call to super() adding color and colorMode elements to the KML – Google Earth complains about ‘em ++
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 Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ListStyle
constructor
A new instance of ListStyle.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?
Constructor Details
#initialize(options = {}) ⇒ ListStyle
Returns a new instance of ListStyle.
1444 1445 1446 1447 1448 1449 |
# File 'lib/kamelopard/classes.rb', line 1444 def initialize( = {}) #bgcolor = nil, state = nil, href = nil, listitemtype = nil) @state = :open @bgColor = 'ffffffff' super end |
Instance Attribute Details
#bgColor ⇒ Object
Returns the value of attribute bgColor.
1442 1443 1444 |
# File 'lib/kamelopard/classes.rb', line 1442 def bgColor @bgColor end |
#href ⇒ Object
Returns the value of attribute href.
1442 1443 1444 |
# File 'lib/kamelopard/classes.rb', line 1442 def href @href end |
#listItemType ⇒ Object
Returns the value of attribute listItemType.
1442 1443 1444 |
# File 'lib/kamelopard/classes.rb', line 1442 def listItemType @listItemType end |
#state ⇒ Object
Returns the value of attribute state.
1442 1443 1444 |
# File 'lib/kamelopard/classes.rb', line 1442 def state @state end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 |
# File 'lib/kamelopard/classes.rb', line 1451 def to_kml(elem = nil) k = XML::Node.new 'ListStyle' super k Kamelopard.kml_array(k, [ [@listItemType, 'listItemType'], [@bgColor, 'bgColor'] ]) if (! @state.nil? or ! @href.nil?) then i = XML::Node.new 'ItemIcon' Kamelopard.kml_array(i, [ [ @state, 'state' ], [ @href, 'href' ] ]) k << i end elem << k unless elem.nil? k end |