Class: Kamelopard::LabelStyle

Inherits:
ColorStyle show all
Defined in:
lib/kamelopard/classes.rb

Overview

Corresponds to KML’s LabelStyle object

Instance Attribute Summary collapse

Attributes inherited from ColorStyle

#color, #colorMode

Attributes inherited from Object

#comment, #id

Instance Method Summary collapse

Methods inherited from ColorStyle

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

Constructor Details

#initialize(scale = 1, color = 'ffffffff', colormode = :normal) ⇒ LabelStyle

Returns a new instance of LabelStyle.



963
964
965
966
# File 'lib/kamelopard/classes.rb', line 963

def initialize(scale = 1, color = 'ffffffff', colormode = :normal)
    super(color, colormode)
    @scale = scale
end

Instance Attribute Details

#scaleObject

Returns the value of attribute scale.



961
962
963
# File 'lib/kamelopard/classes.rb', line 961

def scale
  @scale
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



968
969
970
971
972
973
974
975
976
# File 'lib/kamelopard/classes.rb', line 968

def to_kml(elem = nil)
    k = REXML::Element.new 'LabelStyle'
    super k
    s = REXML::Element.new 'scale'
    s.text = @scale
    k.elements << s
    elem.elements << k unless elem.nil?
    k
end