Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/eggyknap/Kamelopard
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlipinski committed Sep 11, 2012
2 parents c87524e + 340340c commit 135ff25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/kamelopard/classes.rb
Expand Up @@ -1585,12 +1585,13 @@ def to_kml(elem = nil)
class Tour < Object
attr_accessor :name, :description, :last_abs_view, :playlist, :icon

def initialize(name = nil, description = nil)
def initialize(name = nil, description = nil, no_wait = false)
super()
@name = name
@description = description
@playlist = []
Document.instance.tours << self
Wait.new(0.1, :comment => "This wait is automatic, and helps prevent animation glitches") unless no_wait
end

# Add another element to this Tour
Expand Down
7 changes: 3 additions & 4 deletions lib/kamelopard/functions.rb
Expand Up @@ -328,8 +328,7 @@ def tour_from_points(points, options = {})
def make_view_from(options = {})
o = {}
o.merge! options
options.each do |k, v|
o[k.to_sym] = v unless k.kind_of? Symbol
options.each do |k, v| o[k.to_sym] = v unless k.kind_of? Symbol
end

# Set defaults
Expand Down Expand Up @@ -392,7 +391,7 @@ def fly_to(view = nil, options = {})
end

# k = an XML::Document containing KML
# Pulls the Placemarks from the KML document and flys to each one in turn
# Pulls the Placemarks from the KML document d and yields each in turn to the caller
def each_placemark(d)
i = 0
d.find('//kml:Placemark').each do |p|
Expand All @@ -417,7 +416,7 @@ def each_placemark(d)
all_values[k == "gx:altitudeMode" ? :altitudeMode : k.to_sym ] = tmp.content
end
view_values = {}
view_fields.each do |v| view_values[v] = all_values[v].clone if all_values.has_key? v end
view_fields.each do |v| view_values[v.to_sym] = all_values[v.to_sym].clone if all_values.has_key? v.to_sym end
yield make_view_from(view_values), all_values
end
end
Expand Down

0 comments on commit 135ff25

Please sign in to comment.