Class: Kamelopard::IconStyle
- Inherits:
-
ColorStyle
- Object
- Object
- ColorStyle
- Kamelopard::IconStyle
- Includes:
- Icon
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s IconStyle object.
Instance Attribute Summary collapse
-
#heading ⇒ Object
Returns the value of attribute heading.
-
#hotspot ⇒ Object
Returns the value of attribute hotspot.
-
#scale ⇒ Object
Returns the value of attribute scale.
Attributes included from Icon
#h, #href, #httpQuery, #refreshInterval, #refreshMode, #viewBoundScale, #viewFormat, #viewRefreshMode, #viewRefreshTime, #w, #x, #y
Attributes inherited from ColorStyle
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
- #hs_x=(a) ⇒ Object
- #hs_xunits=(a) ⇒ Object
- #hs_y=(a) ⇒ Object
- #hs_yunits=(a) ⇒ Object
-
#initialize(href = nil, options = {}) ⇒ IconStyle
constructor
A new instance of IconStyle.
- #to_kml(elem = nil) ⇒ Object
Methods included from Icon
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
Instance Attribute Details
#heading ⇒ Object
Returns the value of attribute heading.
1502 1503 1504 |
# File 'lib/kamelopard/classes.rb', line 1502 def heading @heading end |
#hotspot ⇒ Object
Returns the value of attribute hotspot.
1502 1503 1504 |
# File 'lib/kamelopard/classes.rb', line 1502 def hotspot @hotspot end |
#scale ⇒ Object
Returns the value of attribute scale.
1502 1503 1504 |
# File 'lib/kamelopard/classes.rb', line 1502 def scale @scale end |
Instance Method Details
#hs_x=(a) ⇒ Object
1512 1513 1514 |
# File 'lib/kamelopard/classes.rb', line 1512 def hs_x=(a) @hotspot.x = a end |
#hs_xunits=(a) ⇒ Object
1520 1521 1522 |
# File 'lib/kamelopard/classes.rb', line 1520 def hs_xunits=(a) @hotspot.xunits = a end |
#hs_y=(a) ⇒ Object
1516 1517 1518 |
# File 'lib/kamelopard/classes.rb', line 1516 def hs_y=(a) @hotspot.y = a end |
#hs_yunits=(a) ⇒ Object
1524 1525 1526 |
# File 'lib/kamelopard/classes.rb', line 1524 def hs_yunits=(a) @hotspot.yunits = a end |
#to_kml(elem = nil) ⇒ Object
1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 |
# File 'lib/kamelopard/classes.rb', line 1528 def to_kml(elem = nil) k = XML::Node.new 'IconStyle' super(k) Kamelopard.kml_array( k, [ [ @scale, 'scale' ], [ @heading, 'heading' ] ]) if not @hotspot.nil? then h = XML::Node.new 'hotSpot' h.attributes['x'] = @hotspot.x.to_s h.attributes['y'] = @hotspot.y.to_s h.attributes['xunits'] = @hotspot.xunits.to_s h.attributes['yunits'] = @hotspot.yunits.to_s k << h end icon_to_kml(k) elem << k unless elem.nil? k end |