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, #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(scale = 1, options = {}) ⇒ LabelStyle

Returns a new instance of LabelStyle.



1032
1033
1034
1035
# File 'lib/kamelopard/classes.rb', line 1032

def initialize(scale = 1, options = {})
    @scale = scale 
    super nil, options
end

Instance Attribute Details

#scaleObject

Returns the value of attribute scale.



1030
1031
1032
# File 'lib/kamelopard/classes.rb', line 1030

def scale
  @scale
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1037
1038
1039
1040
1041
1042
1043
1044
1045
# File 'lib/kamelopard/classes.rb', line 1037

def to_kml(elem = nil)
    k = XML::Node.new 'LabelStyle'
    super k
    s = XML::Node.new 'scale'
    s << @scale.to_s
    k << s
    elem << k unless elem.nil?
    k
end