Add a Get Location Action

You add a Get Location action to get a user’s live location. This action requires the user's consent. As a best practice, it should only be fired on a user gesture, so users can associate the system permission prompt for access with the action they just initiated.

To add a Get Location action to an action chain:

  1. Open the Actions editor, for example, at the page level.
  2. Create an action chain, or open an existing action chain to add the action in the editor.
  3. Drag Get Location from the Actions palette into the action chain.

    You can drag the action onto the Add icon ( Add icon ) in the action chain, or between existing actions in the chain. The Properties pane opens when you add the action to the chain.



  4. Update the ID field in the Properties pane to make the action more easily identifiable.
  5. Set the Maximum Age (in milliseconds) of a possible cached position that is acceptable to return. If set to 0 (default), it means that the device cannot use a cached position and must attempt to retrieve the real current position. If set to Infinity, the device must return a cached position regardless of its age.
  6. Set the Timeout value, representing the maximum length of time (in milliseconds) that the device is allowed to take in order to return a position.
  7. Set the Enable High Accuracy value that indicates whether the application would like to receive the best possible results. If true and if the device is able to provide a more accurate position, it will do so. This can result in slower response times or increased power consumption. If false (default), the device can save resources by responding more quickly or using less power. For mobile devices, you should set this to true in order to use GPS sensors.