# JSIndexMap

> Creates the Module.getIndexMap API.

```javascript
var map = Module.getIndexMap();
```

## Function

### setCameraTilt(tilt)

> Sets the index map camera option.
>
> Changes the camera tilt (in degrees).

{% tabs %}
{% tab title="Information" %}

| Name         | Type   | Description  |
| ------------ | ------ | ------------ |
| tilt         | number | Camera tilt. |
| {% endtab %} |        |              |

{% tab title="Template" %}

```javascript
var indexMap3D = Module.getIndexMap();
indexMap3D.setCameraTilt(89.9);
indexMap3D.setVisible(true);
```

{% endtab %}
{% endtabs %}

### setDistanceMinMax(min, max)

> Sets the index map camera option.
>
> Sets the minimum and maximum distance from the visible point to the camera.

{% tabs %}
{% tab title="Information" %}

| Name         | Type   | Description                                     |
| ------------ | ------ | ----------------------------------------------- |
| min          | number | Minimum camera visibility distance (in meters). |
| max          | number | Maximum camera visibility distance (in meters). |
| {% endtab %} |        |                                                 |

{% tab title="Template" %}

```javascript
var indexMap3D = Module.getIndexMap();
indexMap3D.setDistanceMinMax(50, 3000);
indexMap3D.setVisible(true);
```

{% endtab %}
{% endtabs %}

### setPosition(x, y)

> Sets the position of the index map.

{% tabs %}
{% tab title="Information" %}

| Name         | Type   | Description                                      |
| ------------ | ------ | ------------------------------------------------ |
| x            | number | Horizontal axis position coordinate (in pixels). |
| y            | number | Vertical axis position coordinate (in pixels).   |
| {% endtab %} |        |                                                  |

{% tab title="Template" %}

```javascript
var indexMap3D = Module.getIndexMap();
indexMap3D.setPosition(1300, 10);
indexMap3D.setVisible(true);
```

{% endtab %}
{% endtabs %}

### setSize(width, height)

> Sets the width and height of the index map.

{% tabs %}
{% tab title="Information" %}

| Name         | Type   | Description                          |
| ------------ | ------ | ------------------------------------ |
| width        | number | Width of the index map (in pixels).  |
| height       | number | Height of the index map (in pixels). |
| {% endtab %} |        |                                      |

{% tab title="Template" %}

```javascript
var indexMap3D = Module.getIndexMap();
indexMap3D.setSize(400, 200);
indexMap3D.setVisible(true);
```

{% endtab %}
{% endtabs %}

### setVisible(visible)

> Sets the visibility option for the index map.
>
> Sets the index map to a transparent/semi-transparent state.

{% tabs %}
{% tab title="Information" %}

| Name         | Type    | Description                                                                |
| ------------ | ------- | -------------------------------------------------------------------------- |
| visible      | boolean | <p>true to make the index map visible.<br>false to hide the index map.</p> |
| {% endtab %} |         |                                                                            |

{% tab title="Template" %}

```javascript
var indexMap3D = Module.getIndexMap();
indexMap3D.setVisible(true);
```

{% endtab %}
{% endtabs %}
