The interactive GPS modes provide three easy-to-use approaches to taking GPS readings. Each mode displays a widget which lessens the need to design and implement a custom interface. Additionally, each interactive GPS mode automatically opens and closes the GPS unit, so there is no need to call
gps(open) and
gps(close). All three interactive GPS modes are only supported on Android.
Displays a widget with a satellite image and a message. The satellite image can be tapped to take a GPS reading. The latitude, longitude, and accuracy are displayed in the bottom-left corner. The message is displayed across the top. Exit the widget by pressing the CLOSE button.
b = gps(readInteractiveʃ, message,ʅ
baseMap := None,
ʃreadDuration := duration_in_seconds,ʅ
ʃmessage := messageʅ);
The
gps function must be passed the
readInteractive command with the
named argument baseMap set to
None. The numeric expression
duration_in_seconds may be used to set the read duration If it is not specified, the read duration will default to 15 seconds. A message can be provided as a string expression as the optional second argument, or via the
message named argument.
Displays a widget with a map, message, and current location indicator. Press the CAPTURE CURRENT GPS LOCATION to take a GPS reading specified by the current location indicator. The latitude, longitude, and accuracy are displayed in the bottom-left corner. In the bottom-right corner there is a center location button that will center the view on the current location. The message is displayed across the top. Exit the widget by pressing the CLOSE button.
b = gps(readInteractiveʃ, message,ʅ
ʃbaseMap := base_map,ʅ
ʃmessage := messageʅ);
The
gps function must be passed the
readInteractive command. The optional
named argument base_map can be set to one of four map types (
Normal,
Satellite,
Hybrid, and
Terrain), or a filename. The filename can specify a TPK or MBTile, so an
offline map can be displayed. If no
base_map is specified, then the base map will be calculated using
defined rules. A message can be provided as a string expression as the optional second argument, or via the
message named argument.
Displays a widget with a map, message, current location indicator, and a reticle. The reticle allows a location to be selected. Press the CAPTURE SELECTED LOCATION to take a GPS reading indicated by the reticle. The latitude, longitude, and accuracy are displayed in the bottom-left corner. In the bottom-right corner there is a center location button that will center the view on the current location. The message is displayed across the top. Exit the widget by pressing the CLOSE button at the bottom.
b = gps(selectʃ, message,ʅ
ʃbaseMap := base_map,ʅ
ʃmessage := messageʅ);
The
gps function must be passed the
select command. The optional
named argument base_map can set to one of five map types (
Normal,
Satellite,
Hybrid,
Terrain, and
None), or a filename. The filename can specify a TPK or MBTile, so an
offline map can be displayed. If no
base_map is specified, then the base map will be calculated using
defined rules. A message can be provided as a string expression as the optional second argument, or via the
message named argument.
When using these interactive modes, the
gps function returns a logical value of 1 (true) if successful, 0 (false) if unsuccessful, and -1 if the read is cancelled by pressing the close button. If the function is run on Windows, the function returns
default.
// Satellite Mode
gps(readInteractive,
baseMap := None,
readDuration := 60,
message := "Click on the satellite to take a GPS reading for up to one minute:");
// Map Mode: Current Location
gps(readInteractive, "Take a GPS reading at your current location:");
// Map Mode: Select Location
gps(select, "Select your current location on the map:",
baseMap := "Suitland.mbtiles");