> For the complete documentation index, see [llms.txt](https://docs.wisej.com/extensions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/extensions/extensions/geolocation.md).

# Geolocation

The Geolocation extension component adds geolocation capabilities to the container it is dropped on. Provides methods to retrieve the current location of the client and raises events when the location changes.

{% embed url="<https://github.com/iceteagroup/wisej-extensions/tree/master/Wisej.Ext.Geolocation>" %}
Geolocation Source Code
{% endembed %}

## How to Use

The **Geolocation** extension can be added to a Wisej.NET project using NuGet Package Manager.

{% embed url="<https://www.nuget.org/packages/Wisej-3-Geolocation>" %}

You can add a Geolocation component by dragging it from the toolbox into the designer.

Geolocation supports an *ActiveWatch* which fires a *PositionChanged* event when the location of the Device changes.

Depending on your device you can control the Geolocation component with *EnableHighAccuracy* and by defining a *Timeout* for detecting the position.

Retrieve the current position with *GetCurrentPositionAsync*.

```csharp
// Get location and show location information in an AlertBox on button click
private async void button1_Click(object sender, EventArgs e)
	{
		var position = await this.geolocation1.GetCurrentPositionAsync();
		AlertBox.Show(position.ToJSON());
	}
```

{% hint style="info" %}
The user may need to allow the browser to read the geolocation.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.wisej.com/extensions/extensions/geolocation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
