getLocation
Last updated
Last updated
Get the current location details (GPS coordinate) of the device.
No | Name | Description | Data Type | Required | Example |
---|---|---|---|---|---|
Users want to detect current location from current device.
Call the function. timeout: 30000 (connection timeout after 30 seconds) enableHighAccuracy: true
In callback, add a console -> use input function to view the result.
User will see the result below in console: { accuracy: 20 altitude: null altitudeAccuracy: null heading: null lat: 3.1319238 latLng: "3.1319238,101.63117249999999" latitude: 3.1319238 long: 101.63117249999999 longitude: 101.63117249999999 speed: null timestamp: 1554082377187 }
timeout format is in millisecond (ms).
1
timeout
Connection time out period in millisecond
Integer
Yes
1000, 2000, ...
2
enableHighAccuracy
Enable High Accuracy
Boolean
No