Class: Kamelopard::LineStyle

Inherits:
ColorStyle show all
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

Attributes inherited from ColorStyle

#color, #colorMode

Attributes inherited from Object

#comment, #kml_id

Instance Method Summary collapse

Methods inherited from ColorStyle

#alpha, #alpha=, #blue, #blue=, #green, #green=, #red, #red=, #validate_colorMode

Methods inherited from Object

#change

Constructor Details

#initialize(options = {}) ⇒ LineStyle

Returns a new instance of LineStyle.



1054
1055
1056
1057
1058
1059
1060
1061
1062
# File 'lib/kamelopard/classes.rb', line 1054

def initialize(options = {})
    @outerColor = 'ffffffff'
    @width = 1
    @outerWidth = 0
    @physicalWidth = 0
    @labelVisibility = 0

    super nil, options
end

Instance Attribute Details

#labelVisibilityObject

Returns the value of attribute labelVisibility.



1052
1053
1054
# File 'lib/kamelopard/classes.rb', line 1052

def labelVisibility
  @labelVisibility
end

#outerColorObject

Returns the value of attribute outerColor.



1052
1053
1054
# File 'lib/kamelopard/classes.rb', line 1052

def outerColor
  @outerColor
end

#outerWidthObject

Returns the value of attribute outerWidth.



1052
1053
1054
# File 'lib/kamelopard/classes.rb', line 1052

def outerWidth
  @outerWidth
end

#physicalWidthObject

Returns the value of attribute physicalWidth.



1052
1053
1054
# File 'lib/kamelopard/classes.rb', line 1052

def physicalWidth
  @physicalWidth
end

#widthObject

Returns the value of attribute width.



1052
1053
1054
# File 'lib/kamelopard/classes.rb', line 1052

def width
  @width
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
# File 'lib/kamelopard/classes.rb', line 1064

def to_kml(elem = nil)
    k = XML::Node.new 'LineStyle'
    super k
    Kamelopard.kml_array(k, [
        [ @width, 'width' ],
        [ @outerColor, 'gx:outerColor' ],
        [ @outerWidth, 'gx:outerWidth' ],
        [ @physicalWidth, 'gx:physicalWidth' ],
    ])
    elem << k unless elem.nil?
    k
end