• <Helps for GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
        • Accept Function
        • Advance Statement
        • Ask Statement
        • ChangeKeyboard Function
        • Connection Function
        • DeMode Function
        • Display Orientation
        • EditNote Function
        • EndLevel Statement
        • EndGroup Statement
        • Enter Statement
        • GetCaptureType Function
        • GetCaseLabel Function
        • GetDeviceID Function
        • GetImage Function
        • GetNote Function
        • GetOperatorId Function
        • GetOS Function
        • GetRecord Function
        • GetUserName Function
        • GPS Function
        • Interactive GPS Modes
        • HideOcc Function
        • Highlighted Function
        • InAdvance Function
        • IsPartial Function
        • IsVerified Function
        • Move Statement
        • NoInput Statement
        • OnChangeLanguage Global Function
        • OnChar Global Function
        • OnKey Global Function
        • OnStop Global Function
        • OnSystemMessage Global Function
        • Prompt Function
        • Protect Function
        • PutNote Function
        • RandomizeVS Function
        • Reenter Statement
        • SavePartial Function
        • SelCase Function
        • Set Attributes Statement
        • Set Behavior CanEnter Statement
        • SetCapturePos Function
        • SetCaptureType Function
        • SetCaseLabel Function
        • Set ErrMsg Statement
        • SetFont Function
        • SetOperatorId Function
        • Show Function
        • ShowArray Function
        • ShowOcc Function
        • Skip Statement
        • Userbar Function
        • VisualValue Function
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
      • Export Attributes
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for CSWeb>

Interactive GPS Modes

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.
Satellite Mode
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.
Map Mode: Current Location
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.
Map Mode: Select Location
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.
Return Value
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.
Examples
// 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");
See also: GPS Function, Base Map Specification