Class: IconStyle
- Inherits:
-
ColorStyle
- Object
- KMLObject
- ColorStyle
- IconStyle
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML's IconStyle object.
Instance Attribute Summary (collapse)
-
- (Object) heading
Returns the value of attribute heading.
-
- (Object) hotspot
Returns the value of attribute hotspot.
-
- (Object) icon
Returns the value of attribute icon.
-
- (Object) scale
Returns the value of attribute scale.
Attributes inherited from ColorStyle
Attributes inherited from KMLObject
Instance Method Summary (collapse)
-
- (IconStyle) initialize(href, scale = 1, heading = 0, hs_x = 0.5, hs_y = 0.5, hs_xunits = :fraction, hs_yunits = :fraction, color = 'ffffffff', colormode = :normal)
constructor
A new instance of IconStyle.
- - (Object) to_kml(indent = 0)
Methods inherited from ColorStyle
#alpha, #alpha=, #blue, #blue=, #green, #green=, #red, #red=, #validate_colormode
Constructor Details
- (IconStyle) initialize(href, scale = 1, heading = 0, hs_x = 0.5, hs_y = 0.5, hs_xunits = :fraction, hs_yunits = :fraction, color = 'ffffffff', colormode = :normal)
A new instance of IconStyle
804 805 806 807 808 809 810 |
# File 'lib/kamelopard/classes.rb', line 804 def initialize(href, scale = 1, heading = 0, hs_x = 0.5, hs_y = 0.5, hs_xunits = :fraction, hs_yunits = :fraction, color = 'ffffffff', colormode = :normal) super(color, colormode) @scale = scale @heading = heading @icon = Icon.new(href) unless href.nil? @hotspot = KMLxy.new(hs_x, hs_y, hs_xunits, hs_yunits) unless (hs_x.nil? and hs_y.nil? and hs_xunits.nil? and hs_yunits.nil?) end |
Instance Attribute Details
- (Object) heading
Returns the value of attribute heading
802 803 804 |
# File 'lib/kamelopard/classes.rb', line 802 def heading @heading end |
- (Object) hotspot
Returns the value of attribute hotspot
802 803 804 |
# File 'lib/kamelopard/classes.rb', line 802 def hotspot @hotspot end |
- (Object) icon
Returns the value of attribute icon
802 803 804 |
# File 'lib/kamelopard/classes.rb', line 802 def icon @icon end |
- (Object) scale
Returns the value of attribute scale
802 803 804 |
# File 'lib/kamelopard/classes.rb', line 802 def scale @scale end |
Instance Method Details
- (Object) to_kml(indent = 0)
812 813 814 815 816 817 818 819 820 821 822 |
# File 'lib/kamelopard/classes.rb', line 812 def to_kml(indent = 0) k = <<-iconstyle1 #{ ' ' * indent }<IconStyle id="#{@id}"> #{ super(indent + 4) } iconstyle1 k << "#{ ' ' * indent } <scale>#{@scale}</scale>\n" unless @scale.nil? k << "#{ ' ' * indent } <heading>#{@heading}</heading>\n" unless @heading.nil? k << @icon.to_kml(indent + 4) unless @icon.nil? k << "#{ ' ' * indent } <hotSpot x=\"#{@hotspot.x}\" y=\"#{@hotspot.y}\" xunits=\"#{@hotspot.xunits}\" yunits=\"#{@hotspot.yunits}\" />\n" unless @hotspot.nil? k << "#{ ' ' * indent }</IconStyle>\n" end |