Tour¶
GxAnimatedUpdate¶
-
class
simplekml.GxAnimatedUpdate(gxduration=None, gxdelayedstart=None, update=None)¶ Controls changes during a tour to KML features.
The arguments are the same as the properties. See
simplekml.GxTourfor usage.-
gxdelayedstart¶ Double of number of seconds to wait before starting.
-
gxduration¶ Double indicating how long the camera remains still.
-
id¶ The id string.
-
update¶ Instance of
simplekml.Update
-
GxFlyTo¶
-
class
simplekml.GxFlyTo(gxduration=None, gxflytomode=None, camera=None, lookat=None)¶ Allows unbroken flight from point to point.
The arguments are the same as the properties. See
simplekml.GxTourfor usage.-
addfile(path)¶
-
bounce= 'bounce'¶
-
camera¶ Camera that views the scene, accepts
simplekml.Camera
-
gxduration¶ Double indicating how long the camera remains still.
-
gxflytomode¶ How the camera behaves, accepts
simplekml.GxFlyToModeconstants.
-
id¶ The id string.
-
lookat¶ Camera relative to the feature, accepts
simplekml.LookAt
-
smooth= 'smooth'¶
-
GxPlaylist¶
-
class
simplekml.GxPlaylist(gxtourprimitives=None)¶ Defines a part of a tour.
The arguments are the same as the properties. See
simplekml.GxTourfor usage.-
addgxtourprimitive(value)¶
-
newgxanimatedupdate(**kwargs)¶ Creates a new
simplekml.GxAnimatedUpdateand adds it to the playlist.Accepts the same agruments as
simplekml.GxAnimatedUpdateand returns an instance ofsimplekml.GxAnimatedUpdate
-
newgxflyto(**kwargs)¶ Creates a new
simplekml.GxFlyToand adds it to the playlist.Accepts the same agruments as
simplekml.GxFlyToand returns an instance ofsimplekml.GxFlyTo
-
newgxsoundcue(**kwargs)¶ Creates a new
simplekml.GxSoundCueand adds it to the playlist.Accepts the same agruments as
simplekml.GxSoundCueand returns an instance ofsimplekml.GxSoundCue
-
newgxtourcontrol(**kwargs)¶ Creates a new
simplekml.GxTourControland adds it to the playlist.Accepts the same agruments as
simplekml.GxTourControland returns an instance ofsimplekml.GxTourControl
-
newgxwait(**kwargs)¶ Creates a new
simplekml.GxWaitand adds it to the playlist.Accepts the same agruments as
simplekml.GxWaitand returns an instance ofsimplekml.GxWait
-
GxSoundCue¶
-
class
simplekml.GxSoundCue(href=None, gxdelayedstart=None)¶ Specifies a sound to be played in a tour.
The arguments are the same as the properties. See
simplekml.GxTourfor usage.-
gxdelayedstart¶ Double telling the number of seconds to delay playing the file.
-
href¶ A string reference to a sound file to play.
-
id¶ The id string.
-
GxTour¶
-
class
simplekml.GxTour(name=None, description=None, gxplaylists=None)¶ Defines a tour.
The arguments are the same as the properties.
Usage:
# Demonstrates touring with the reproduction of the tour sample in the KML Reference # https://developers.google.com/kml/documentation/kmlreference#gxtour with the addition of GxSoundCue import os import simplekml # Create an instance of kml kml = simplekml.Kml(name="Tours", open=1) # Create a new point and style it pnt = kml.newpoint(name="New Zealand's Southern Alps", coords=[(170.144,-43.605)]) pnt.style.iconstyle.scale = 1.0 # Create a tour and attach a playlist to it tour = kml.newgxtour(name="Play me!") playlist = tour.newgxplaylist() # Attach a gx:SoundCue to the playlist and delay playing by 2 second (sound clip is about 4 seconds long) soundcue = playlist.newgxsoundcue() soundcue.href = "http://simplekml.googlecode.com/hg/samples/resources/drum_roll_1.wav" soundcue.gxdelayedstart = 2 # Attach a gx:AnimatedUpdate to the playlist animatedupdate = playlist.newgxanimatedupdate(gxduration=6.5) animatedupdate.update.change = '<IconStyle targetId="{0}"><scale>10.0</scale></IconStyle>'.format(pnt.style.iconstyle.id) # Attach a gx:FlyTo to the playlist flyto = playlist.newgxflyto(gxduration=4.1) flyto.camera.longitude = 170.157 flyto.camera.latitude = -43.671 flyto.camera.altitude = 9700 flyto.camera.heading = -6.333 flyto.camera.tilt = 33.5 flyto.camera.roll = 0 # Attach a gx:Wait to the playlist to give the gx:AnimatedUpdate time to finish wait = playlist.newgxwait(gxduration=2.4) # Save to file kml.save(os.path.splitext(__file__)[0] + ".kml")
-
description¶ String description of the tour.
-
name¶ String name of the tour
-
newgxplaylist(gxtourprimitives=None)¶ Adds a
simplekml.GxPlaylistand returns it.
-
GxTourControl¶
Update¶
-
class
simplekml.Update(targethref=None, change=None, create=None, delete=None)¶ Action to take when animation updates.
The arguments are the same as the properties. See
simplekml.GxTourfor usage.-
change¶ KML string representing a change in animation.
-
create¶ KML string representing a creation during animation.
-
delete¶ KML string representing a deletion during animation.
-
targethref¶ The target url.
-
GxWait¶
-
class
simplekml.GxWait(gxduration=None)¶ Allows a tour to be paused.
The arguments are the same as the properties. See
simplekml.GxTourfor usage.-
gxduration¶ Double indicating how long the camera remains still.
-
id¶ The id string.
-