# Functions

## 1. Geolocation API method

Use this method to launch the native location permission popup in the browser and use pointNG to predict the location based on users' GPS coordinates securely

```
pointng.getLocation()
    .then(function(prediction) {
        console.log(prediction)
        //Do your magic here with the predictions
    }) 
```

## 2. Reverse Geocoding method

If you already have GPS data available, you can use this method to insert the latitude and longitude coordinates to pointNG and execute reverse geocoding directly on the browser.

```
pointng.latLonLocate(62.2443, 34.35435)
    .then(function(prediction) {
        console.log(prediction)
        //Do your magic here with the predictions
    }) 
```

## 3. pointNG widget

Use this function to add a pointNG widget to your website. You empower your users to determine the level (continent, country, state or city) they wish that your site uses their location data. You users can also choose when they want to give your site the location permission or update their current location.

![](/files/-MJYS2-_FpM1J3VDwz2d)


---

# 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://globalreactioncompany.gitbook.io/pointng/functions.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.
