Use the Get Current Position dynamic action to fetch
the device's current location.
It can return latitude and longitude, or a GeoJSON object, into page items
or a custom JavaScript function can receive a Geolocation object as a parameter.
The accuracy of the geolocation depends on the user's device.
For privacy reasons, each user is asked for permission upon the first use of
this dynamic action. If the user denies permission, the Geolocation returned
is null so your application should handle that possibility gracefully.
This table shows the supported combinations of operating systems and browsers for the Geolocation feature.
|
Chrome |
Edge |
Firefox |
Safari |
Android |
Yes |
Yes |
Yes |
N/A |
iOS |
Yes |
Yes |
Yes |
Yes |
macOS |
Yes |
Yes |
Yes |
Yes |
Windows |
Yes |
Yes |
Yes |
N/A |
Last updated: April 2023
- In Page Designer add two items: P1_LATITUDE and P1_LONGITUDE
- Create a Button
- Add a Dynamic Action to the button click event
- Change the Action to Get Current Position
- Set the Return Type to Latitude and Longitude
- Set the Latitude Item to P1_LATITUDE to return latitude into it
- Set the Longitude Item to P1_LONGITUDE to return longitude into it