Class: AnimatedUpdate
- Inherits:
-
TourPrimitive
- Object
- KMLObject
- TourPrimitive
- AnimatedUpdate
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s gx:AnimatedUpdate object. For now at least, this isn’t very intelligent; you’ve got to manually craft the <Change> tag(s) within the object.
Instance Attribute Summary collapse
-
#delayedstart ⇒ Object
For now, the user has to specify the change / create / delete elements in the <Update> manually, rather than creating objects.
-
#duration ⇒ Object
For now, the user has to specify the change / create / delete elements in the <Update> manually, rather than creating objects.
-
#target ⇒ Object
For now, the user has to specify the change / create / delete elements in the <Update> manually, rather than creating objects.
-
#updates ⇒ Object
For now, the user has to specify the change / create / delete elements in the <Update> manually, rather than creating objects.
Attributes inherited from KMLObject
Instance Method Summary collapse
-
#<<(a) ⇒ Object
Adds another update string, presumably containing a <Change> element.
-
#initialize(updates = [], duration = 0, target = '', delayedstart = nil) ⇒ AnimatedUpdate
constructor
The updates argument is an array of strings containing <Change> elements.
- #to_kml(indent = 0) ⇒ Object
Constructor Details
#initialize(updates = [], duration = 0, target = '', delayedstart = nil) ⇒ AnimatedUpdate
The updates argument is an array of strings containing <Change> elements
1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 |
# File 'lib/kamelopard/classes.rb', line 1180 def initialize(updates = [], duration = 0, target = '', delayedstart = nil) super() begin raise "incorrect object type" unless @target.kind_of? KMLObject @target = target.id rescue RuntimeError @target = target end @updates = updates @duration = duration @delayedstart = delayedstart end |
Instance Attribute Details
#delayedstart ⇒ Object
For now, the user has to specify the change / create / delete elements in the <Update> manually, rather than creating objects.
1177 1178 1179 |
# File 'lib/kamelopard/classes.rb', line 1177 def delayedstart @delayedstart end |
#duration ⇒ Object
For now, the user has to specify the change / create / delete elements in the <Update> manually, rather than creating objects.
1177 1178 1179 |
# File 'lib/kamelopard/classes.rb', line 1177 def duration @duration end |
#target ⇒ Object
For now, the user has to specify the change / create / delete elements in the <Update> manually, rather than creating objects.
1177 1178 1179 |
# File 'lib/kamelopard/classes.rb', line 1177 def target @target end |
#updates ⇒ Object
For now, the user has to specify the change / create / delete elements in the <Update> manually, rather than creating objects.
1177 1178 1179 |
# File 'lib/kamelopard/classes.rb', line 1177 def updates @updates end |
Instance Method Details
#<<(a) ⇒ Object
Adds another update string, presumably containing a <Change> element
1194 1195 1196 |
# File 'lib/kamelopard/classes.rb', line 1194 def <<(a) @updates << a << "\n" end |
#to_kml(indent = 0) ⇒ Object
1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 |
# File 'lib/kamelopard/classes.rb', line 1198 def to_kml(indent = 0) k = super + <<-animatedupdate_kml #{ ' ' * indent }<gx:AnimatedUpdate> #{ ' ' * indent } <gx:duration>#{@duration}</gx:duration> animatedupdate_kml k << "#{ ' ' * indent } <gx:delayeStart>#{@delayedstart}</gx:delayedStart>\n" unless @delayedstart.nil? k << "#{ ' ' * indent } <Update>\n" k << "#{ ' ' * indent } <targetHref>#{@target}</targetHref>\n" k << "#{ ' ' * indent } " << @updates.join("\n#{ ' ' * (indent + 1) }") k << "#{ ' ' * indent } </Update>\n#{ ' ' * indent }</gx:AnimatedUpdate>\n" k end |