---
description: API for setting and managing map navigation (compass) features.
---

# JSNavigationControl

You can create it using the Module.getNavigation API.

```javascript
var navigation = Module.getNavigation();
```

## Function

### getPadding() → [JSVector2D](../core/jsvector2d)

> Returns the padding value of the navigation (compass).

{% tabs %}
{% tab title="Information" %}
* Return
  * x : left Padding setting value.
  * y : top Padding setting value.
* Sample
  * Refer to the function getNavigationProperties.
  * [Sandbox\_Map Control](https://sandbox.egiscloud.com/code/main.do?id=option_control_map)
{% endtab %}

{% tab title="Template" %}
```javascript
var padding = Module.getNavigation().getPadding();
```
{% endtab %}
{% endtabs %}

### setPadding(number left, number top)

> Sets the padding value for the navigation (compass).

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description        |
| ---- | ------ | ------------------ |
| left | number | left Padding value |
| top  | number | top Padding value  |

* Sample
  * Refer to the function setNavigationPadding.
  * [Sandbox\_Map Control](https://sandbox.egiscloud.com/code/main.do?id=option_control_map)
{% endtab %}

{% tab title="Template" %}
```javascript
Module.getNavigation().setPadding(50, 50);
```
{% endtab %}
{% endtabs %}

## Getter / Setter

### getNaviPos(), setNaviPos(align) → number

> Sets the alignment (Align) of the navigation (compass).

{% tabs %}
{% tab title="Information" %}
| Name  | Type   | Description                                                                  |
| ----- | ------ | ---------------------------------------------------------------------------- |
| align | number | [Navigation alignment type.](../../etc/type-list#navigation-align-type-list) |

* Return
  * Returns [navigation alignment type](../../etc/type-list#navigation-align-type-list).
* Sample
  * Refer to the function getNavigationProperties.
  * [Sandbox\_Map Control](https://sandbox.egiscloud.com/code/main.do?id=option_control_map)
{% endtab %}

{% tab title="Template" %}
```javascript
var naviAlign = Module.getNavigation().getNaviPos();
// ... or ...
Module.getNavigation().setNaviPos(Module.JS_NAVIGATION_LT);
```
{% endtab %}
{% endtabs %}

### getNaviVisible(), setNaviVisible(display) → number

> Sets the visibility of the navigation (compass).

{% tabs %}
{% tab title="Information" %}
| Name    | Type   | Description                                                                     |
| ------- | ------ | ------------------------------------------------------------------------------- |
| display | number | [Navigation visibility type](../../etc/type-list#navigation-visible-type-list). |

* Return
  * number: [navigation visibility type](../../etc/type-list#navigation-visible-type-list).
* Sample
  * Refer to the function getNavigationProperties.
  * [Sandbox\_Map Control](https://sandbox.egiscloud.com/code/main.do?id=option_control_map)
{% endtab %}

{% tab title="Template" %}
```javascript
var naviDisplay = Module.getNavigation().getNaviVisible();
// ... or ...
Module.getNavigation().setNaviVisible(Module.JS_VISIBLE_AUTO);
```
{% endtab %}
{% endtabs %}
