# 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

   ![](/files/ntIPzMGCLoIlPjRRyb4E)
2. In callback, add a console -> input function to view the result.

   ![](/files/VU2FoKRhzzulrnXaA9YL)

### Result

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

![](/files/QiWjEtWtfQoxIt6lkx14)

### Video

* N/A

## Links

* N/A


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/device/watchposition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
