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?
Constructor Details
#initialize(options = {}) ⇒ Track
Returns a new instance of Track.
2421 2422 2423 2424 2425 2426 |
# File 'lib/kamelopard/classes.rb', line 2421 def initialize( = {}) @when = [] @coord = [] @angles = [] super end |
Instance Attribute Details
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
2420 2421 2422 |
# File 'lib/kamelopard/classes.rb', line 2420 def altitudeMode @altitudeMode end |
#angles ⇒ Object
Returns the value of attribute angles.
2420 2421 2422 |
# File 'lib/kamelopard/classes.rb', line 2420 def angles @angles end |
#coord ⇒ Object
Returns the value of attribute coord.
2420 2421 2422 |
# File 'lib/kamelopard/classes.rb', line 2420 def coord @coord end |
#model ⇒ Object
Returns the value of attribute model.
2420 2421 2422 |
# File 'lib/kamelopard/classes.rb', line 2420 def model @model end |
#when ⇒ Object
Returns the value of attribute when.
2420 2421 2422 |
# File 'lib/kamelopard/classes.rb', line 2420 def when @when end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 |
# File 'lib/kamelopard/classes.rb', line 2428 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 |