Class: Kamelopard::FlyTo
- Inherits:
-
TourPrimitive
- Object
- Object
- TourPrimitive
- Kamelopard::FlyTo
- Defined in:
- lib/kamelopard/classes.rb
Overview
Cooresponds to KML’s gx:FlyTo object. The @view parameter needs to look like an AbstractView object
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#view ⇒ Object
Returns the value of attribute view.
Attributes inherited from TourPrimitive
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
-
#initialize(view = nil, options = {}) ⇒ FlyTo
constructor
A new instance of FlyTo.
- #range=(range) ⇒ Object
- #to_kml(elem = nil) ⇒ Object
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?
Constructor Details
#initialize(view = nil, options = {}) ⇒ FlyTo
Returns a new instance of FlyTo.
1651 1652 1653 1654 1655 1656 |
# File 'lib/kamelopard/classes.rb', line 1651 def initialize(view = nil, = {}) @duration = 0 @mode = :bounce super self.view= view unless view.nil? end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
1649 1650 1651 |
# File 'lib/kamelopard/classes.rb', line 1649 def duration @duration end |
#mode ⇒ Object
Returns the value of attribute mode.
1649 1650 1651 |
# File 'lib/kamelopard/classes.rb', line 1649 def mode @mode end |
#view ⇒ Object
Returns the value of attribute view.
1649 1650 1651 |
# File 'lib/kamelopard/classes.rb', line 1649 def view @view end |
Instance Method Details
#range=(range) ⇒ Object
1668 1669 1670 1671 1672 |
# File 'lib/kamelopard/classes.rb', line 1668 def range=(range) if view.respond_to? 'range' and not range.nil? then @view.range = range end end |
#to_kml(elem = nil) ⇒ Object
1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 |
# File 'lib/kamelopard/classes.rb', line 1674 def to_kml(elem = nil) k = XML::Node.new 'gx:FlyTo' super k Kamelopard.kml_array(k, [ [ @duration, 'gx:duration' ], [ @mode, 'gx:flyToMode' ] ]) @view.to_kml k unless @view.nil? elem << k unless elem.nil? k end |