The Geolocation API
One of the most fundamental requirements of any mobile ArcGIS app is its ability to enable users to find and show their current location on a map. This is where the Geolocation API comes in handy.
Note
The Geolocation API is a browser API that's part of JavaScript, but it is not related to ArcGIS.
On mobile devices, current location is derived from either GPS or cell tower triangulation. The Geolocation API taps into this data. Built-in security means that users need to provide permission before this functionality can be used in an application. Usually a popup will be displayed that will ask "The website x would like to use your current location". Clicking on the Allow
button will give permission to the application. Building apps with the Geolocation API allows users to see and track their position on a map, and it is shown in the following screenshot:
Most modern mobile browsers support the Geolocation API...