> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/device/watchposition.md).

# watchPosition

## Description

Return the location details (GPS coordinate) of the device if detect changes.

## Input / Parameters

| No | Name               | Description                               | Data Type | Required | Example         |
| -- | ------------------ | ----------------------------------------- | --------- | -------- | --------------- |
| 1  | timeout            | Connection time out period in millisecond | Integer   | Yes      | 1000, 2000, ... |
| 2  | maximumAge         | maximumAge period in millisecond          | Integer   | No       | 100             |
| 3  | enableHighAccuracy | Enable High Accuracy                      | Boolean   | No       |                 |
| 4  | enableHighAccuracy | Enable High Accuracy                      | Boolean   | No       |                 |

## Output

## Callback

## Video

## Example

Users want to get the current location of mobile device if the location are changed.

### Step

1. Call the function.\
   timeout: 30000 (connection timeout after 30 seconds)\
   maximumAge: 100 enableHighAccuracy: true

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-ec8e1a0bae9ec804826d0ae0b35ba42f0fcfbb12%2FwatchPosition-step-1.png?alt=media)
2. In callback, add a console -> input function to view the result.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-0a86fecbd29ba359a0958518804994c69ff48f00%2FwatchPosition-step-2.png?alt=media)

### Result

User will see the result below in console (the latlng will have different value):

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-d7f3b6fa395cf6ffdf4bb0c76b8ce427e07484e4%2FwatchPosition-result-1.png?alt=media)

### Video

* N/A

## Links

* N/A
