# World Wind Scripting Version 1.0

Last updated February 12, 2005

Scripting provides a way to automate a user's experience with World
Wind. A World Wind script contains settings that determine and vary the
user's view of the world, including their location and the features
annotating or overlaying the globe. A script can conduct a virtual tour,
calling out points of interest along the way. Scripts can be created by
anyone with a text editor. They can be used personally or shared with
others.

Scripting supports scenarios like the following:

1.  Smoothly take the user from one city, region or geographical feature
    to another, stopping momentarily at key or interesting spots. At
    each stop -- and between stops -- display descriptive messages on
    the screen indicating noteworthy information about the location or
    the move. For example, "Now we'll visit the Alps, and discover how
    markedly more rugged they are than the Pyrenees."

```{=html}
<!-- -->
```
1.  Play an animation, perhaps a sequence of WMS maps like those from
    NASA's Scientific Visualization Studio, but after first moving the
    user's position to a place in the sky that gives the best view of
    the animation's most interesting feature. Leave the animation
    running repeatedly, and move the user from one spot to another to
    see and compare the activity at each stop.

2.  Fly around the world as though in an airplane or high altitude jet,
    banking and turning to circle cities and other interesting places.
    Or zoom through mountain ranges and valleys, flying low over land
    and water at a constant altitude.

## Limitations

The current implementation of scripting does not provide the following
features, even though they are obviously of value and might be
considered important to include:

1.  The ability to get input or feedback from the user.

```{=html}
<!-- -->
```
1.  The ability to play and synchronize audio files with the script.

2.  The ability to invoke other scripts from within a script.

## Script Basics

Scripts automate World Wind by varying the values of certain parameters
over time. These parameters include the viewer's position on the globe,
the direction she's looking, and the World Wind features displayed as
the script runs. The full list of variable parameters is:

-   **View Position.** The viewer can be positioned anywhere around the
    globe at a specified elevation.

-   **View Direction.** The view direction can change to direct the
    user's gaze.

-   **Layers.** Place names and borders can be displayed or not. Display
    of other intrinsic or add-on layers of information can be controlled
    and their opacity specified.

-   **WMS Images.** Maps retrieved from WMS servers can be displayed on
    or over the globe. Sequences of overlays can be "played" as
    animations and synchronized to other actions in the script.

-   **Display Messages.** Short text messages can be displayed within
    World Wind as the script runs.

-   **Latitude & Longitude Grid.** The World Wind latitude/longitude
    grid can be turned on and off in a script.

Each of these parameters can be varied over time independently and
simultaneously. The independence of the parameters allows scenarios that
keep some parameters constant while others vary. Such a scenario is a
fly-by of an island or a city, with the user's gaze remaining focused on
one area during the approach, pass, and departure. In this scenario the
viewing position changes independently of the view direction, whose
focal point remains constant. Another example is a tour around the globe
while a weather animation is playing. Here, the view position changes
independently of the animation.

A script is a sequence of simple statements that specify the values that
certain World Wind parameters are to have at particular times. While the
script runs, World Wind sets the parameters to the specified values at
the indicated times. For some parameters, such as view position, World
Wind interpolates the changes over time to smooth the variation. The
user therefore sees steady change rather than sharp jumps.

Each of the available script parameters has its own timeline. World Wind
manages one timeline for each parameter. At each tick of its internal
clock it examines all the timelines to determine and set the value that
each parameter should have then.

Time in a script begins at zero when the script starts and increases
with clock time as the script runs. Time points are specified as the
number of seconds since the script started -- the elapsed time.

A script writer can choose to synchronize the timelines or not, and at
which points in time to synchronize them. Imagine, for example, a script
that starts an animation of global weather and specifies that the
viewing position should be over central Africa when the animation
starts, over India when the animation's tenth frame is displayed five
seconds later, and over Australia, South America and North America at
subsequent frame numbers and times. This synchronization is achieved by
specifying both the viewing position and the animation state at
successive identical times.

A script can be repeated indefinitely or a specific number of times by
indicating the desired behavior in the script header.

When a script starts, the initial values of scriptable parameters are
those currently in effect in the running World Wind program. If the
initial value of a parameter is significant to the purpose of the
script, the script author should specify the desired initial value in
the script at a time value of zero.

Scripts are defined in XML, and can therefore be created and edited in a
text editor. We assume, however, that most scripts will be created by
script-building software, and we therefore do not attempt to make the
script elements especially readable or understandable by a user reading
the XML. Nevertheless, the script elements are simple and
straightforward and are likely to be understood by many readers
knowledgeable of XML.

The term *script* in the context of computers has broad meaning. It's
often used to name a program in a language like Perl, JavaScript or
other procedural programming language. But World Wind scripts are not
procedural programs. They only declare parameter values and indicate
when to change them. They are more like HTML page definitions (without
embedded scripts), which merely declare, "This is what the user should
see." World Wind scripts additionally incorporate the variable of time:
what the user sees depends on what time it is (relative to when the
script started).

## Parameters

The previous section identified the parameters that scripts can control.
This section describes those parameters in more detail.

It's convenient to be able to specify some parameters in different ways.
View direction, for example, might in some cases be most easily given as
viewing angles relative to the viewing position, and in other cases by a
focal point on the globe's surface. The scripting language supports such
alternative definitions where they're useful.

### View Position

The view position places the user at a particular position about the
globe. It's specified by a latitude, a longitude and an elevation above
the globe's mean surface.

Zoom and image resolution are controlled in World Wind by the view
position's elevation. Decreasing the elevation zooms in, increasing it
zooms out. World Wind automatically selects the resolution of the
displayed imagery based on the elevation; image resolution can not be
directly controlled by a script.

The view position does not indicate the direction the user is looking or
the field of view. The view direction does this and is specified
separately, as described below. The field of view is fixed in World Wind
and is not a parameter that can be specified in a script.

### View Direction

The direction of the user's gaze is specified by the view direction. The
most common view direction is straight down, perpendicular to the
surface of the globe, but other view directions are of course also
useful and possible. A fly-over script, for example, would likely have
the view direction angled slightly downward from the horizontal.

View direction is specified in either of two ways. The most
straightforward way is as a point on or slightly above the globe's
surface to keep always in the view's center. This would be convenient in
a fly-by animation in which the viewing position changes to circle a
city, but the user's gaze remains focused on the city's center.

The other way to specify view direction is with two angles that indicate
where to point the view relative to the viewing position. The first
angle gives the compass direction the user is looking towards. An angle
of 0° indicates a directly northward gaze, an angle of 90° indicates a
gaze directly east. South is 180° and west is 270°. The second angle to
specify indicates how steeply the user is looking down towards the
surface. A value of 90° specifies a gaze perpendicular to the surface,
directly towards the globe's center. A value of 0° indicates a view
parallel to the surface, as though looking directly forward out a
cockpit window.

### Layers

Most adornments such as political borders, place names and informational
overlays are captured in World Wind as "layers." Scripts can toggle
these layers on or off and specify their opacity.

Scripts specify a collection of layers to be displayed at a given time
point during the script. When the time point is reached, World Wind
displays the indicated layers. The entire collection of layers remains
displayed until the script specifies another collection at a subsequent
time point. At that point, the previously displayed layers are removed
from display and the new collection is displayed. At any given time
there is only one collection of layers displayed. If the script
specifies no layers, then the layers already on display when the script
starts remain displayed throughout the running of the script.

Layers a script displays are "turned off" within a script by specifying
a subsequent *Layers* element with an empty layer collection.

### Vertical Exaggeration

The vertical exaggeration that World Wind applies to surface topography
can be controlled in a script.

### WMS Images

World Wind lets users download and display images that overlay the
globe's base imagery. These images come from organizations such as NASA
and various national geological surveys. They are retrieved by World
Wind from the web servers of those organizations via the Web Map Service
(WMS) protocol defined by the Open Geospatial Consortium
([http://www.opengeospatial.org](http://www.opengeospatial.org/)).

World Wind scripts can specify WMS images to display and the times to
display them, They can also indicate the opacity to apply to their
display to control how much of the base imagery shows through. At any
point during a script, only one WMS image is displayed, but different
images can be displayed sequentially.

WMS images are identified in scripts by the WMS URL that indicates their
source and their retrieval parameters.

When a WMS image is called for in a script but World Wind has not
previously cached it on the local computer, the script will continue
running while World Wind retrieves the image from the internet. Because
initial retrieval typically takes an unknown amount of time -- sometimes
several seconds, sometimes several minutes -- the image may not appear
on the screen at the time specified in the script. It will, however,
appear when it arrives from its source, unless it fails to arrive before
a time point at which the script specifies a different image to display.

#### WMS Animations

Some organizations that provide images via WMS also provide sequences of
images that can be played sequentially to create an animated sequence.
Scripts can display these animations in World Wind. It's possible to
synchronize these animations to other parameter changes in the script.
Scripts can also specify the opacity that World Wind should apply when
displaying the animation images.

Like single images, animations are specified by their WMS URL indicating
their source and retrieval parameters. Animation providers indicate the
available animation frames -- the individual images -- and their correct
display sequence via information in the animation's WMS description,
available from the image server. This sequence information is typically
a range of dates or times. Scripts indicate which portion of this
sequence to display and the rate at which to display it by specifying at
time points within the script the sequence identifier of a specific
frame to display at that time. World Wind synchronizes the animation to
those times. The script need not specify every image of the animation:
When World Wind recognizes that the WMS image URL is the same at two
adjacent time points, differing only by sequence identifiers, it
interpolates the correct image to display from those identifiers. The
script can therefore specify only the first and last image of the
animation, for example, and World Wind will retrieve and display all the
intervening images.

Since animations are collections of WMS images, the same caveat
mentioned above about retrieval timing applies: An image in the sequence
will be displayed at the specified time if it is already available on
the local computer, otherwise its retrieval will only be initiated at
that time and the script will continue running. As the script repeats
and the animation images arrive, World Wind will display them

By specifying other parameter values at identical times as specific
animation frames, a script may synchronize the animation to other
parameter changes in the script.

### Display Messages

It's often helpful and important for a script to describe to the user
what it's doing and perhaps why. Display messages provide the ability to
do this. A script can specify messages to display and the locations and
times to display them. The messages are displayed within the World Wind
window in the window's default font style and size.

Several messages can be displayed simultaneously. A script specifies a
collection of messages to begin displaying at a specific time. Those
messages are displayed until the script, at a subsequent time point,
specifies a different set of messages, which replace the previous ones.
So at any point in time, only one message collection is on display.
(This is the same behavior as for Layers, as described above.)

## Script Specification

This section describes the syntax and structure of scripts. Scripts are
XML documents. The elements those documents may contain are described
here. See the accompanying script schema for their full XML definition,
organization and specification syntax.

Element names are case sensitive and use camel case: the first letter of
the name is capitalized and the first letter of each subsequent word in
the name is capitalized. For example, *ViewPosition*, *ViewDirection*,
and *DisplayMessages*. Attribute names, on the other hand, are all
lower-case. Acronyms are considered as one normal word, e.g.,
*WmsImage*.

### Script Structure

The root element of a script is the *Script* element. It encloses all
other elements of the script. It has an attribute to indicate the number
of times to repeatedly play the script.

The *Script* element contains one or more *At* elements, each of which
identifies a collection of parameter values to take effect at a
particular time. These *At* elements are the most significant parts of
the script. They define the parameter timelines, and they provide the
mechanism for synchronizing parameter changes.

An *At* element contains one time value, in units of seconds since the
script started running, and one or more parameter specifications. Each
of these parameter specifications takes effect at the *At* element's
time value.

An *At* element may contain at most one parameter specification of each
type (*ViewPosition*, *ViewDirection*, etc.).

A *Script* element may contain any number of *At* elements, but it must
contain at least one.

Parameter specifications may be given a unique identifier via their *id*
attribute. They can then be referred to by that *id* from within other
*At* elements, using the referring element's *idref* attribute. This
provides a means to reuse parameter specifications within the script.
All parameter specification elements may have an *id* or an *idref*
attribute specified.

It's important to realize that once a parameter setting takes effect,
that setting remains in effect until new values for the same parameter
are specified at a subsequent time point. To "turn off" something, the
script must contain an empty setting for that parameter at the time
point at which to "turn it off." For example, if a *WmsImage* is
specified to be displayed at 20 seconds, and the script author wants to
end the display of that image at 50 seconds, then in addition to the
script's containing the *time*=20 element to display the image, there
must be a *WmsImage* element with an empty URL at *time*=50 to end
display of the image. This convention applies to all script parameters
other than *ViewPosition* and *ViewDirection*, which have no sense of
displayed vs. not displayed.

Also, when a script ends, the settings it last specified prior to ending
remain in effect. The exception to this is display messages, which World
Wind automatically removes from the screen when the script ends. If a
script wants to remove the effect of its running when it ends, it must
include empty settings of parameters (except the viewing parameters) in
its final *At* element. And even though the script can reset the
parameters this way, there is no reliable way to restore the state of
World Wind to its state prior to the script's running. A script can only
"erase" what it's done, not restore what was in effect before it ran.
There is no means provided for the script to know what that state was.

### *Script* Element

The *Script* element encloses all the other elements in the script. It
is the root element of the XML file. It has an attribute to indicate
whether it should run once, repeat several times, or run continuously.
It must contain at least one *At* element.

+-----------------------+----------------------------------------------+
| ####                  |                                              |
|  Element Name: Script |                                              |
+-----------------------+----------------------------------------------+
| Attributes            |                                              |
+-----------------------+----------------------------------------------+
| -   name              | A short (80 or fewer characters) name by     |
|                       | which the script can be identified in a user |
|                       | interface. This attribute must be specified. |
+-----------------------+----------------------------------------------+
| -   repeat            | Positive integer indicating the number of    |
|                       | times to repeat the script. If not           |
|                       | specified, or if a value of zero is          |
|                       | specified, the script repeats continually.   |
+-----------------------+----------------------------------------------+
| Elements              |                                              |
+-----------------------+----------------------------------------------+
| -   At                | Declares a time at which to set indicated    |
|                       | parameters to new values and the values to   |
|                       | set them to. One *At* element must be        |
|                       | present in the script; any number of them    |
|                       | may be present.                              |
+-----------------------+----------------------------------------------+
| -   ShortDescription  | A brief (200 or fewer characters)            |
|                       | description of the script that conveys its   |
|                       | purpose or other information to a user. It   |
|                       | is not displayed within the World Wind       |
|                       | window, but is optionally displayed within   |
|                       | the user interface. A script may contain     |
|                       | only one of these elements, but need not     |
|                       | contain one.                                 |
+-----------------------+----------------------------------------------+

### *At* Element

The *At* element identifies a set of parameters and the values they are
to take on at a given time. The element may contain at most one
parameter specification of each parameter type. It must contain at least
one parameter specification and a time value.

+-----------------------+----------+-----------------------------------+
| #### Element Name: At |          |                                   |
+-----------------------+----------+-----------------------------------+
| Attributes            |          |                                   |
+-----------------------+----------+-----------------------------------+
| -   time              | Positive |                                   |
|                       | floating |                                   |
|                       | point    |                                   |
|                       | number   |                                   |
|                       | in       |                                   |
|                       | dicating |                                   |
|                       | the      |                                   |
|                       | number   |                                   |
|                       | of       |                                   |
|                       | seconds  |                                   |
|                       | since    |                                   |
|                       | the      |                                   |
|                       | script   |                                   |
|                       | started  |                                   |
|                       | running  |                                   |
|                       | to       |                                   |
|                       | effect   |                                   |
|                       | the      |                                   |
|                       | p        |                                   |
|                       | arameter |                                   |
|                       | changes  |                                   |
|                       | id       |                                   |
|                       | entified |                                   |
|                       | within   |                                   |
|                       | the      |                                   |
|                       | element. |                                   |
+-----------------------+----------+-----------------------------------+
| Elements              |          |                                   |
+-----------------------+----------+-----------------------------------+
| -   DisplayMessages   |          | -   ViewDirection                 |
+-----------------------+----------+-----------------------------------+
| -   LatLonGrid        |          | -   ViewPosition                  |
+-----------------------+----------+-----------------------------------+
| -   Layers            |          | -   WmsImage                      |
+-----------------------+----------+-----------------------------------+
| -                     |          |                                   |
|  VerticalExaggeration |          |                                   |
+-----------------------+----------+-----------------------------------+

### *DisplayMessages* Element

The *DisplayMessages* element specifies a collection of text messages to
display in the World Wind window. It contains a list of *DisplayMessage*
elements that each specify a message to display and the location to
display it.

+-----------------------+----------------------------------------------+
| #### Element          |                                              |
| Name: DisplayMessages |                                              |
+-----------------------+----------------------------------------------+
| Elements              |                                              |
+-----------------------+----------------------------------------------+
| -   DisplayMessage    | Contains a message to display and its        |
|                       | location. There can be up to ten of these in |
|                       | a single DisplayMessages element. If none    |
|                       | are present, then any previously displayed   |
|                       | messages are no longer displayed.            |
+-----------------------+----------------------------------------------+
|                       | Each DisplayMessage element contains the     |
|                       | following elements:                          |
|                       |                                              |
|                       | -   Message: The text of the message.        |
|                       |                                              |
|                       | -   X: The floating point X coordinate of    |
|                       |     the location to place the message.       |
|                       |     Coordinate values may range between 0    |
|                       |     and 1, inclusive. The coordinate origin  |
|                       |     is the upper left corner of the World    |
|                       |     Wind window. A value of 0 indicates the  |
|                       |     left edge of the window. A value of 1    |
|                       |     indicates the right edge.                |
|                       |                                              |
|                       | -   Y: The floating point Y coordinate of    |
|                       |     the location to place the message. A     |
|                       |     value of 0 indicates the top edge of the |
|                       |     window. A value of 1 indicates the       |
|                       |     bottom edge.                             |
+-----------------------+----------------------------------------------+

### *LatLonGrid* Element

The *LatLonGrid* element indicates whether or not to display a grid of
latitude and longitude lines.

+-----------------------+----------------------------------------------+
| #### Ele              |                                              |
| ment Name: LatLonGrid |                                              |
+-----------------------+----------------------------------------------+
| Elements              |                                              |
+-----------------------+----------------------------------------------+
| -   Show              | Boolean value indicating whether to display  |
|                       | the latitude/longitude grid. The value may   |
|                       | be either of the literal strings, *true* or  |
|                       | *false*.                                     |
+-----------------------+----------------------------------------------+

### *Layers* Element

The *Layers* element specifies a collection of layers to display and the
opacity of each.

+-----------------------+----------------------------------------------+
| ####                  |                                              |
|  Element Name: Layers |                                              |
+-----------------------+----------------------------------------------+
| Elements              |                                              |
+-----------------------+----------------------------------------------+
| -   Layer             | Identifies a layer to display and its        |
|                       | opacity. There can be up to twenty of these  |
|                       | in a single Layers element. If none are      |
|                       | present, then any layers previously          |
|                       | displayed by the script are no longer        |
|                       | displayed.                                   |
+-----------------------+----------------------------------------------+
|                       | Each Layer element contains the following    |
|                       | elements:                                    |
|                       |                                              |
|                       | -   Category: The layer category. For place  |
|                       |     names and political borders, the         |
|                       |     category is *DatasetType*.               |
|                       |                                              |
|                       | -   Name: The layer name. For place names    |
|                       |     this is *PlaceNames*. For political      |
|                       |     boundaries it is *Borders*.              |
|                       |                                              |
|                       | -   Opacity: A floating point value between  |
|                       |     0 and 100, inclusive, indicating the     |
|                       |     opacity of the overlay. A value of 100   |
|                       |     indicates the overlay is fully opaque; a |
|                       |     value of 0 indicates the overlay is      |
|                       |     fully transparent.                       |
+-----------------------+----------------------------------------------+

### *VerticalExaggeration* Element

The *VerticalExaggeration* element specifies a scale factor to apply to
the elevation of surface topography.

+-----------------------+----------------------------------------------+
| #### Element          |                                              |
| Name: ViewingPosition |                                              |
+-----------------------+----------------------------------------------+
| Elements              |                                              |
+-----------------------+----------------------------------------------+
| -   Scale             | A floating point number greater than or      |
|                       | equal to 1.0 indicating the scale factor to  |
|                       | apply to surface topography.                 |
+-----------------------+----------------------------------------------+

### *ViewDirection* Element

The *ViewDirection* element specifies the direction of the user's gaze,
as described [above](#view-direction). It can be specified in one of two
ways:

-   As a pair of angles, with the first indicating the compass
    direction, and the second indicating the downward direction.

-   As a position on or above the globe on which to center the view.

World Wind's default view direction is directly towards the center of
the globe: (0°, 90°) as specified as a pair of angles.

+-----------------------+----------------------------------------------+
| #### Elemen           |                                              |
| t Name: ViewDirection |                                              |
+-----------------------+----------------------------------------------+
| Elements *(only one   |                                              |
| group -- Horizontal   |                                              |
| and Vertical Angle,   |                                              |
| or Latitude,          |                                              |
| Longitude and         |                                              |
| Elevation---can be    |                                              |
| specified)*           |                                              |
+-----------------------+----------------------------------------------+
| -   Horizontal        | The compass direction, in floating point     |
|                       | degrees, when specifying the direction as    |
|                       | two angles. A value of 0° indicates North.   |
+-----------------------+----------------------------------------------+
| -   Vertical          | The downwards angle, in floating point       |
|                       | degrees. A value of 90° indicates a          |
|                       | direction perpendicular to the globe's       |
|                       | surface and towards the globe's center.      |
+-----------------------+----------------------------------------------+
| -   Latitude          | A floating point number indicating the       |
|                       | degrees of latitude of the position to       |
|                       | center in the view when specifying the       |
|                       | direction as a point to look at.             |
+-----------------------+----------------------------------------------+
| -   Longitude         | A floating point number indicating the       |
|                       | degrees of longitude of the position to      |
|                       | center in the view.                          |
+-----------------------+----------------------------------------------+
| -   Elevation         | A non-negative floating point number         |
|                       | indicating the meters of elevation of the    |
|                       | position to center in the view.              |
+-----------------------+----------------------------------------------+

### *ViewPosition* Element

The *ViewPosition* element specifies the location of the viewer. It's
given as a position of latitude, longitude and elevation above the
globe's mean surface. See the parameter description
[above](#view-position) for a complete description of this parameter.

+-----------------------+----------------------------------------------+
| #### Eleme            |                                              |
| nt Name: ViewPosition |                                              |
+-----------------------+----------------------------------------------+
| Elements              |                                              |
+-----------------------+----------------------------------------------+
| -   Latitude          | A floating point number indicating the view  |
|                       | position's degrees of latitude.              |
+-----------------------+----------------------------------------------+
| -   Longitude         | A floating point number indicating the view  |
|                       | position's degrees of longitude.             |
+-----------------------+----------------------------------------------+
| -   Elevation         | A non-negative floating point number         |
|                       | indicating the view position's elevation, in |
|                       | meters. A value of 0 indicates the globe's   |
|                       | mean surface.                                |
+-----------------------+----------------------------------------------+

### *WmsImage* Element

The *WmsImage* element specifies a WMS image to display over the globe.
The element gives the full URL of the image, including the WMS request
parameters, and the opacity with which to display the image.

+-----------------------+----------------------------------------------+
| #### E                |                                              |
| lement Name: WmsImage |                                              |
+-----------------------+----------------------------------------------+
| Elements              |                                              |
+-----------------------+----------------------------------------------+
| -   Url               | The full URL, including the WMS request      |
|                       | parameters, identifying the image. If empty, |
|                       | any WMS images previously displayed by the   |
|                       | script are no longer displayed.              |
+-----------------------+----------------------------------------------+
| -   Opacity           | A floating point value between 0 and 100,    |
|                       | inclusive, indicating the opacity of the     |
|                       | overlay. A value of 100 indicates the        |
|                       | overlay is fully opaque; a value of 0        |
|                       | indicates the overlay is fully transparent.  |
+-----------------------+----------------------------------------------+

##  Schema Diagram

The following figure illustrates the script elements and their
relationships.

![](media/image1.png){width="6.088888888888889in"
height="7.522222222222222in"}

## Examples

The following examples illustrate the specification of World Wind
scripts.

### Circling the Globe

This script circles the globe at various elevations over one minute. It
starts at 0° latitude and longitude, moving to 50° North latitude and
120 West longitude at 10 seconds, then to 50° South latitude and 120°
East longitude at 20 seconds, then back around to 0° latitude and
longitude at 30 seconds. The view direction is initially set to and
remains directly towards the surface and perpendicular to it. World Wind
repeats the script two times.

\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>

\<Script name=\"Around the Globe\" repeat=\"2\"\>

\<ShortDescription\>Fly completely around the
globe.\</ShortDescription\>

\<At time=\"0\"\>

\<ViewDirection\>

\<Angles\>

\<Horizontal\>0\</Horizontal\>

\<Vertical\>90\</Vertical\>

\</Angles\>

\</ViewDirection\>

\<ViewPosition\>

\<Latitude\>0\</Latitude\>

\<Longitude\>0\</Longitude\>

\<Elevation\>9.0e6\</Elevation\>

\</ViewPosition\>

\</At\>

\<At time=\"10\"\>

\<ViewPosition\>

\<Latitude\>50\</Latitude\>

\<Longitude\>-120\</Longitude\>

\<Elevation\>5.0e6\</Elevation\>

\</ViewPosition\>

\</At\>

\<At time=\"20\"\>

\<ViewPosition\>

\<Latitude\>-50\</Latitude\>

\<Longitude\>120\</Longitude\>

\<Elevation\>9.0e6\</Elevation\>

\</ViewPosition\>

\</At\>

\<At time=\"30\"\>

\<ViewPosition\>

\<Latitude\>0\</Latitude\>

\<Longitude\>0\</Longitude\>

\<Elevation\>9.0e6\</Elevation\>

\</ViewPosition\>

\</At\>

\</Script\>

### Displaying Messages

The following script displays two messages at different locations when
it starts. It displays two new messages at 5 seconds (and the original
two are no longer displayed). At 10 seconds it specifies an empty
*DisplayMessages* element in order to turn off the previous messages. At
15 seconds it displays a single new message, and at 18 seconds it turns
off that message. Because the Script element includes the attribute
setting, *repeat=3*, World Wind repeats the script 3 times.

\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>

\<Script name=\"Display Message Test 01\" repeat=\"3\"\>

\<At time=\"0\"\>

\<DisplayMessages\>

\<DisplayMessage\>

\<Message\>This is number one of two first messages.\</Message\>

\<X\>0.25\</X\>

\<Y\>0.25\</Y\>

\</DisplayMessage\>

\<DisplayMessage\>

\<Message\>This is number two of two first messages.\</Message\>

\<X\>0.5\</X\>

\<Y\>0.2\</Y\>

\</DisplayMessage\>

\</DisplayMessages\>

\</At\>

\<At time=\"5\"\>

\<DisplayMessages\>

\<DisplayMessage\>

\<Message\>This is the second message.\</Message\>

\<X\>0.5\</X\>

\<Y\>0.5\</Y\>

\</DisplayMessage\>

\<DisplayMessage\>

\<Message\>This is the second message repeated.\</Message\>

\<X\>0.5\</X\>

\<Y\>0.3\</Y\>

\</DisplayMessage\>

\</DisplayMessages\>

\</At\>

\<At time=\"10\"\>

\<DisplayMessages/\>

\</At\>

\<At time=\"15\"\>

\<DisplayMessages\>

\<DisplayMessage\>

\<Message\>End of Script!\</Message\>

\<X\>0.5\</X\>

\<Y\>0.5\</Y\>

\</DisplayMessage\>

\</DisplayMessages\>

\</At\>

\<At time=\"18\"\>

\<DisplayMessages/\>

\</At\>

\</Script\>