# JSAntenna

> Create the Module.CreateAntenna API.

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

## Function

### CreateCoverageCone(position, height, radius, angle, x, segment) → boolean

> Create a 3D model object for radio coverage range.

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

| Name     | Type                                                                                        | Description                                                                |
| -------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| position | [JSVector3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jsvector3d) | Starting latitude and longitude for the radio signal                       |
| height   | number                                                                                      | Height setting for radio modeling from the starting latitude and longitude |
| radius   | number                                                                                      | Radius setting for radio modeling (input radius>0)                         |
| angle    | number                                                                                      | Angle setting for radio modeling waveform (input angle>-90, angle<90)      |
| x        | number                                                                                      | Width setting for radio modeling waveform angle                            |
| segment  | number                                                                                      | Precision setting for radio modeling (input segment>3)                     |

* Return
  * true : Object creation successful
  * false : Object creation failed
  * Failure conditions.
    * effect\_radius < 0 value is set
    * effect\_angle < -90, effect\_angle > 90 value is set
    * effect\_radius < 3 value is set
* Sample
  * Refer to the create function.
  * [Sandbox\_Radio Coverage](https://sandbox.egiscloud.com/code/main.do?id=object_antenna)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### SetCoverageDistance(radius) → boolean

> Change the model radius of the radio coverage.

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

| Name   | Type   | Description                                          |
| ------ | ------ | ---------------------------------------------------- |
| radius | number | Radius setting for radio modeling (input radius > 0) |

* Return
  * true : Radius setting successful
  * false : Radius setting failed
  * Failure conditions.
    * radius < 0 value is set
* Sample
  * Refer to the SetCoverageDistance function.
  * [Sandbox\_Radio Coverage](https://sandbox.egiscloud.com/code/main.do?id=object_antenna)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

## Getter / Setter

### 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 %}

### 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 %}
