Class: 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 KMLObject

#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.



901
902
903
904
# File 'lib/kamelopard/classes.rb', line 901

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

Instance Attribute Details

#scaleObject

Returns the value of attribute scale.



899
900
901
# File 'lib/kamelopard/classes.rb', line 899

def scale
  @scale
end

Instance Method Details

#to_kml(indent = 0) ⇒ Object



906
907
908
909
910
911
912
913
914
# File 'lib/kamelopard/classes.rb', line 906

def to_kml(indent = 0)

    <<-labelstyle
#{ ' ' * indent }<LabelStyle id="#{@id}">
#{ super(indent + 4) }
#{ ' ' * indent }    <scale>#{@scale}</scale>
#{ ' ' * indent }</LabelStyle>
    labelstyle
end