Class: Kamelopard::BalloonStyle
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s BalloonStyle 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.
-
#displayMode ⇒ Object
Returns the value of attribute displayMode.
-
#text ⇒ Object
Returns the value of attribute text.
-
#textColor ⇒ Object
Returns the value of attribute textColor.
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
-
#initialize(text = nil, options = {}) ⇒ BalloonStyle
constructor
Note: color element order is aabbggrr.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?, parse
Constructor Details
#initialize(text = nil, options = {}) ⇒ BalloonStyle
Note: color element order is aabbggrr
1424 1425 1426 1427 1428 1429 1430 1431 |
# File 'lib/kamelopard/classes.rb', line 1424 def initialize(text = nil, = {}) #text = '', textColor = 'ff000000', bgColor = 'ffffffff', displayMode = :default) @bgColor = 'ffffffff' @textColor = 'ff000000' @displayMode = :default super @text = text unless text.nil? end |
Instance Attribute Details
#bgColor ⇒ Object
Returns the value of attribute bgColor.
1421 1422 1423 |
# File 'lib/kamelopard/classes.rb', line 1421 def bgColor @bgColor end |
#displayMode ⇒ Object
Returns the value of attribute displayMode.
1421 1422 1423 |
# File 'lib/kamelopard/classes.rb', line 1421 def displayMode @displayMode end |
#text ⇒ Object
Returns the value of attribute text.
1421 1422 1423 |
# File 'lib/kamelopard/classes.rb', line 1421 def text @text end |
#textColor ⇒ Object
Returns the value of attribute textColor.
1421 1422 1423 |
# File 'lib/kamelopard/classes.rb', line 1421 def textColor @textColor end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 |
# File 'lib/kamelopard/classes.rb', line 1433 def to_kml(elem = nil) k = XML::Node.new 'BalloonStyle' super k Kamelopard.kml_array(k, [ [ @bgColor, 'bgColor' ], [ @text, 'text' ], [ @textColor, 'textColor' ], [ @displayMode, 'displayMode' ] ]) elem << k unless elem.nil? k end |