The Read Geo Data action enters the current geolocation data into the $MT_GEOLOCATION tree. In order for the action to be able to read the current geolocation, the mobile device's geolocation tracking must have been started before this action is executed.
The $MT_GEOLOCATION tree is automatically added to the page sources of the page when the Start/Stop Geo Tracking action or the Read Geo Data action is added to design. The $MT_GEOLOCATION tree has two parts: Location and Address (see listings below). The Location element contains the geolocation coordinates. The Address element contains the address equivalent plus other details of the geolocation coordinates as determined by a directory look-up. If no postal address equivalent is available, then this part of the tree will not be filled; other child elements of Address (such as URL) might also not be filled if the relevant data is not available.
Geolocation retrieval options
In the dropdown box of the action's setting, you can select one of the following:
•Current Geolocation: Enters the mobile device's geolocation data in the Location element of the $MT_GEOLOCATION tree. Only the tree's Location element attributes will therefore contain data. The tree will not have an Address element.
•Current Geolocation + Address: Enters data into both the Location and Address element nodes.
•Address at Given Geolocation: Enters Address element data in the $MT_GEOLOCATION tree. This data corresponds to the For Geolocation coordinates you enter. The For Geolocation coordinates must be entered as a string having one of the lexical formats described in the Geolocation input string formats section below.The address data is obtained by looking up a geolocation directory.
•Geolocation at Given Address: Geolocation coordinates are fetched for the string that you enter as the value of the For Address field. This string is looked up in a geolocation directory, and if coordinates for this address are available, then the Location element of the $MT_GEOLOCATION tree is updated with these coordinates. You can enter any sub-part of the address for the directory lookup.
•Geolocation at Given Address: Returns the geolocation of the address submitted in the For Address option. The address is entered as a string, for example: "Address Line 1, Address Line 2". This string is submitted for a geolocation lookup, and the returned geolocation data components are stored in the $MT_GEOLOCATION tree (see the tree structure listing at the beginning of the section).
In order to use geolocation data, it must first be entered in the $MT_GEOLOCATION tree with the Read Geo Data action. The screenshot below, for example, shows a Read Geo Data action that enters data for both the Location and Address elements. It then accesses the Location/@Latitude data in the $MT_GEOLOCATION tree to update a node in another tree.
For information about specifying geolocation data for designer and server simulations, see the section Geolocation Settings.