Class: Kamelopard::PolyStyle
- Inherits:
-
ColorStyle
- Object
- Object
- ColorStyle
- Kamelopard::PolyStyle
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s PolyStyle 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
-
#fill ⇒ Object
Returns the value of attribute fill.
-
#outline ⇒ Object
Returns the value of attribute outline.
Attributes inherited from ColorStyle
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PolyStyle
constructor
A new instance of PolyStyle.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from ColorStyle
#alpha, #alpha=, #blue, #blue=, #green, #green=, #red, #red=, #validate_colorMode
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?, parse
Constructor Details
#initialize(options = {}) ⇒ PolyStyle
Returns a new instance of PolyStyle.
1644 1645 1646 1647 1648 1649 |
# File 'lib/kamelopard/classes.rb', line 1644 def initialize( = {}) #fill = 1, outline = 1, color = 'ffffffff', colormode = :normal) @fill = 1 @outline = 1 super nil, end |
Instance Attribute Details
#fill ⇒ Object
Returns the value of attribute fill.
1642 1643 1644 |
# File 'lib/kamelopard/classes.rb', line 1642 def fill @fill end |
#outline ⇒ Object
Returns the value of attribute outline.
1642 1643 1644 |
# File 'lib/kamelopard/classes.rb', line 1642 def outline @outline end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 |
# File 'lib/kamelopard/classes.rb', line 1651 def to_kml(elem = nil) k = XML::Node.new 'PolyStyle' super k Kamelopard.kml_array( k, [ [ @fill, 'fill' ], [ @outline, 'outline' ] ]) elem << k unless elem.nil? k end |