Class: Kamelopard::LineStyle
- Inherits:
-
ColorStyle
- Object
- Object
- ColorStyle
- Kamelopard::LineStyle
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s LineStyle 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
-
#outerColor ⇒ Object
Returns the value of attribute outerColor.
-
#outerWidth ⇒ Object
Returns the value of attribute outerWidth.
-
#physicalWidth ⇒ Object
Returns the value of attribute physicalWidth.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from ColorStyle
Attributes inherited from Object
Instance Method Summary collapse
-
#initialize(width = 1, outercolor = 'ffffffff', outerwidth = 0, physicalwidth = 0, color = 'ffffffff', colormode = :normal) ⇒ LineStyle
constructor
A new instance of LineStyle.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from ColorStyle
#alpha, #alpha=, #blue, #blue=, #green, #green=, #red, #red=, #validate_colorMode
Constructor Details
#initialize(width = 1, outercolor = 'ffffffff', outerwidth = 0, physicalwidth = 0, color = 'ffffffff', colormode = :normal) ⇒ LineStyle
Returns a new instance of LineStyle.
985 986 987 988 989 990 991 |
# File 'lib/kamelopard/classes.rb', line 985 def initialize(width = 1, outercolor = 'ffffffff', outerwidth = 0, physicalwidth = 0, color = 'ffffffff', colormode = :normal) super(color, colormode) @width = width @outerColor = outercolor @outerWidth = outerwidth @physicalWidth = physicalwidth end |
Instance Attribute Details
#outerColor ⇒ Object
Returns the value of attribute outerColor.
983 984 985 |
# File 'lib/kamelopard/classes.rb', line 983 def outerColor @outerColor end |
#outerWidth ⇒ Object
Returns the value of attribute outerWidth.
983 984 985 |
# File 'lib/kamelopard/classes.rb', line 983 def outerWidth @outerWidth end |
#physicalWidth ⇒ Object
Returns the value of attribute physicalWidth.
983 984 985 |
# File 'lib/kamelopard/classes.rb', line 983 def physicalWidth @physicalWidth end |
#width ⇒ Object
Returns the value of attribute width.
983 984 985 |
# File 'lib/kamelopard/classes.rb', line 983 def width @width end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
993 994 995 996 997 998 999 1000 1001 1002 1003 1004 |
# File 'lib/kamelopard/classes.rb', line 993 def to_kml(elem = nil) k = REXML::Element.new 'LineStyle' super k Kamelopard.kml_array(k, [ [ @width, 'width' ], [ @outerColor, 'gx:outerColor' ], [ @outerWidth, 'gx:outerWidth' ], [ @physicalWidth, 'gx:physicalWidth' ], ]) elem.elements << k unless elem.nil? k end |