Class: Kamelopard::Track
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to Google Earth’s gx:Track extension to KML
Instance Attribute Summary collapse
-
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
-
#angles ⇒ Object
Returns the value of attribute angles.
-
#coord ⇒ Object
Returns the value of attribute coord.
-
#model ⇒ Object
Returns the value of attribute model.
-
#when ⇒ Object
Returns the value of attribute when.
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Track
constructor
A new instance of Track.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?, parse
Constructor Details
#initialize(options = {}) ⇒ Track
Returns a new instance of Track.
2605 2606 2607 2608 2609 2610 |
# File 'lib/kamelopard/classes.rb', line 2605 def initialize( = {}) @when = [] @coord = [] @angles = [] super end |
Instance Attribute Details
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
2604 2605 2606 |
# File 'lib/kamelopard/classes.rb', line 2604 def altitudeMode @altitudeMode end |
#angles ⇒ Object
Returns the value of attribute angles.
2604 2605 2606 |
# File 'lib/kamelopard/classes.rb', line 2604 def angles @angles end |
#coord ⇒ Object
Returns the value of attribute coord.
2604 2605 2606 |
# File 'lib/kamelopard/classes.rb', line 2604 def coord @coord end |
#model ⇒ Object
Returns the value of attribute model.
2604 2605 2606 |
# File 'lib/kamelopard/classes.rb', line 2604 def model @model end |
#when ⇒ Object
Returns the value of attribute when.
2604 2605 2606 |
# File 'lib/kamelopard/classes.rb', line 2604 def when @when end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 |
# File 'lib/kamelopard/classes.rb', line 2612 def to_kml(elem = nil) e = XML::Node.new 'gx:Track' [ [ @coord, 'gx:coord' ], [ @when, 'when' ], [ @angles, 'gx:angles' ], ].each do |a| a[0].each do |g| w = XML::Node.new a[1], g.to_s e << w end end elem << e unless elem.nil? e end |