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, #master_only

Instance Method Summary collapse

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 = {}) ⇒ LineStyle

Returns a new instance of LineStyle.



1414
1415
1416
1417
1418
1419
1420
1421
1422
# File 'lib/kamelopard/classes.rb', line 1414

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.



1412
1413
1414
# File 'lib/kamelopard/classes.rb', line 1412

def labelVisibility
  @labelVisibility
end

#outerColorObject

Returns the value of attribute outerColor.



1412
1413
1414
# File 'lib/kamelopard/classes.rb', line 1412

def outerColor
  @outerColor
end

#outerWidthObject

Returns the value of attribute outerWidth.



1412
1413
1414
# File 'lib/kamelopard/classes.rb', line 1412

def outerWidth
  @outerWidth
end

#physicalWidthObject

Returns the value of attribute physicalWidth.



1412
1413
1414
# File 'lib/kamelopard/classes.rb', line 1412

def physicalWidth
  @physicalWidth
end

#widthObject

Returns the value of attribute width.



1412
1413
1414
# File 'lib/kamelopard/classes.rb', line 1412

def width
  @width
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
# File 'lib/kamelopard/classes.rb', line 1424

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