# Geo Location

On secure(https) pages browser like default navigator functions will work.

```
navigator.geolocation.getCurrentPosition(success, error, [options])
```

For reference can follow the link below.

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition>" %}

{% hint style="info" %}

<pre><code>You'll need to import the javascript file in your website before starting from this <a data-footnote-ref href="#user-content-fn-1">link</a>.
</code></pre>

{% endhint %}

To get GPS Status of device

{% tabs %}
{% tab title="Plain Javascript" %}

```
WTN.isDeviceGPSEnabled({
    callback:function(data){
        console.log(data.value);
    }
});
```

{% endtab %}

{% tab title="ES5+" %}

```
import { isDeviceGPSEnabled } from "webtonative"
```

```
isDeviceGPSEnabled({
    callback:function(data){
        console.log(data.value);
    }
});
```

{% endtab %}
{% endtabs %}

```
```

[^1]: <https://docs.webtonative.com/javascript-apis/getting-started>
