---
description: API for creating and modifying frustum objects.
---

# JSViewFrustum

> Create a API with Module.createViewFrustum.

```javascript
var object = Module.createViewFrustum("ID");
```

## Function

### createViewFrustum(position, pan, tilt, x, y, distance)

> Creates a frustum object.
>
> Rotation information based on the pan input value: 0, 360 (north), 90 (east), 180 (south), 270 (west).
>
> Rotation information based on the tilt input value: 0 (front), tilt<0 (top), tilt>0 (bottom).

{% tabs %}
{% tab title="Information" %}
| Name     | Type                             | Description                                                     |
| -------- | -------------------------------- | --------------------------------------------------------------- |
| position | [JSVector3D](../core/jsvector3d) | Frustum's location coordinates (longitude, latitude, altitude). |
| pan      | number                           | Frustum's Y-axis rotation setting.                              |
| tilt     | number                           | Frustum's X-axis rotation setting.                              |
| x        | number                           | Frustum's field of view width setting.                          |
| y        | number                           | Frustum's field of view height setting.                         |
| distance | number                           | Frustum's length setting.                                       |

* Sample
  * Refer to function init.
  * [Sandbox\_Frustum](https://sandbox.egiscloud.com/code/main.do?id=object_frustum)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

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

> Returns the field of view size of the frustum.

{% tabs %}
{% tab title="Information" %}
* Return
  * [JSVector2D](../core/jsvector2d) : Returns the view size(width, height) of the frustum successfully.
  * null: Size return failed.
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

### getId() → string

> Returns the ID of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * string: Successful return of the object's Key string.
  * null: If the object is null.
{% endtab %}

{% tab title="Template" %}
```javascript
lat strKey = object.getId();
```
{% endtab %}
{% endtabs %}

### setFovX(value) → boolean

> Changes the field of view width of the frustum.

{% tabs %}
{% tab title="Information" %}
| Name  | Type   | Description           |
| ----- | ------ | --------------------- |
| value | number | Frustum width setting |

* Return
  * true: Setting successful.
  * false: Setting failed.
* Sample
  * Refer to function resutFrustum.
  * [Sandbox\_Frustum](https://sandbox.egiscloud.com/code/main.do?id=object_frustum)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

### setFovY(value) → boolean

> Changes the field of view height of the frustum.

{% tabs %}
{% tab title="Information" %}
| Name  | Type   | Description            |
| ----- | ------ | ---------------------- |
| value | number | Frustum height setting |

* Return
  * true: Setting successful.
  * false: Setting failed.
* Sample
  * Refer to function resutFrustum.
  * [Sandbox\_Frustum](https://sandbox.egiscloud.com/code/main.do?id=object_frustum)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

## Getter / Setter

### getColor(), setColor(color) → [JSColor](../core/jscolor)

> Changes the color of the frustum object.

{% tabs %}
{% tab title="Information" %}
| Name  | Type                       | Description                    |
| ----- | -------------------------- | ------------------------------ |
| color | [JSColor](../core/jscolor) | Frustum's visualization color. |

* Return
  * [JSColor](../core/jscolor): Returns the color of the frustum successfully.
  * null: Color return failed.
* Sample
  * Refer to function createViewFrustum.
  * [Sandbox\_Frustum](https://sandbox.egiscloud.com/code/main.do?id=object_frustum)
{% endtab %}

{% tab title="Template" %}
```javascript
// ... or ...
```
{% endtab %}
{% endtabs %}

### getDescription(), setDescription(desc) → string

> Set a description for the object.

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description                |
| ---- | ------ | -------------------------- |
| desc | string | Object description string. |

* Return
  * string: Successful return of the object's description string.
  * null: If the object is null.
{% endtab %}

{% tab title="Template" %}
```javascript
var strDesc = object.getDescription();
// ... or ...
object.setDescription("First Object.");
```
{% endtab %}
{% endtabs %}

### getName(), setName(name) → string

> Sets the name of the object.

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description                     |
| ---- | ------ | ------------------------------- |
| name | string | The name to set for the object. |

* Return
  * string: Successful return of the object's name.
  * null: If the object is null.
{% endtab %}

{% tab title="Template" %}
```javascript
var objName = object.getName();
// ... or ...
object.setName("MyObject");
```
{% endtab %}
{% endtabs %}

### getPan(), setPan(pan) → number

> Changes the Y-axis rotation value of the frustum.
>
> Rotation information based on the pan input value: 0, 360 (north), 90 (east), 180 (south), 270 (west).

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description                     |
| ---- | ------ | ------------------------------- |
| pan  | number | Frustum Y-axis rotation setting |

* Return
  * number: Y-axis rotation value.
* Sample
  * Refer to function resutFrustum.
  * [Sandbox\_Frustum](https://sandbox.egiscloud.com/code/main.do?id=object_frustum)
{% endtab %}

{% tab title="Template" %}
```javascript
// ... or ...
```
{% endtab %}
{% endtabs %}

### getTilt(), setTilt(tilt) → number

> Changes the X-axis rotation value of the frustum.
>
> Rotation information based on the tilt input value: 0 (front), tilt<0 (top), tilt>0 (bottom).

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description                     |
| ---- | ------ | ------------------------------- |
| tilt | number | Frustum X-axis rotation setting |

* Return
  * number: X-axis rotation value.
* Sample
  * Refer to function resutFrustum.
  * [Sandbox\_Frustum](https://sandbox.egiscloud.com/code/main.do?id=object_frustum)
{% endtab %}

{% tab title="Template" %}
```javascript
// ... or ...
```
{% endtab %}
{% endtabs %}

### getVisible(), setVisible(visible) → boolean

> Sets the visibility state of an object.

{% tabs %}
{% tab title="Information" %}
| Name    | Type    | Description                                                      |
| ------- | ------- | ---------------------------------------------------------------- |
| visible | boolean | <p>true: Make the object visible.<br>false: Hide the object.</p> |

* Return
  * true: Object visible state.
  * false: Object hidden state.
{% endtab %}

{% tab title="Template" %}
```javascript
var objName = object.getName();
// ... or ...
object.setVisible(true);
```
{% endtab %}
{% endtabs %}
