This guide explains how to retrieve a user's location using the **JavaScript Geolocation API** in a **RunJS query** and display it on a **Map component**.
For privacy reasons, Geolocation requires user permission before locating the device. Upon permission, you gain access to data like latitude, longitude, altitude, and speed.
Navigate to **Settings** enable the _Run this query on application load_ option. This ensures that the JavaScript query runs each time the app is opened, providing the user's location.
<imgclassName="screenshot-full img-full"src="/img/how-to/access-location/v2/appLoad.png"alt="RunJS Query: Run on App Load"/>
4.**Grant Location Permission**
Upon clicking _Run_, your browser prompts you to grant permission for the ToolJet app to access your location. Allow this permission to receive location data.
Once the query succesfully runs, the coordinates will be returned and displayed in the **Preview** section of query editor. To inspect the data returned by the query, go to the **Inspector** on the left sidebar, expand Queries and click `getLocation` (query name), and open *Preview*.
6.**Add the Map Component**
Add a map component to the canvas and edit its properties. In the **Initial location** property, enter: