# JSArrow

> Create a API with Module.CreateArrow.

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

## Function

### getId() → string

> Returns the object's Key.

{% 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
var strKey = object.getId();
```

{% endtab %}
{% endtabs %}

### Create(position, pan, tilt, distance, radius, head\_rate, arrow\_radius, color) → boolean

> Creates a 3D model arrow 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 (upward).
> * tilt > 0 (downward).

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

| Name          | Type                                                                                        | Description                                   |
| ------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------- |
| position      | [JSVector3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jsvector3d) | Starting latitude and longitude of the arrow. |
| pan           | number                                                                                      | Y-axis rotation setting for the arrow.        |
| tilt          | number                                                                                      | X-axis rotation setting for the arrow.        |
| distance      | number                                                                                      | Total length of the arrow.                    |
| radius        | number                                                                                      | Thickness of the arrow shaft.                 |
| head\_rate    | number                                                                                      | Ratio of the arrowhead.                       |
| arrow\_radius | number                                                                                      | Thickness of the arrowhead.                   |
| color         | [JSColor](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jscolor)       | Color of the arrow.                           |

* Return
  * true : Object creation successful.
  * false : Object creation failed.
* Sample
  * Refer to the init function.
  * [Sandbox\_Arrow(3D)](https://sandbox.egiscloud.com/code/main.do?id=object_arrow)
    {% 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 %}
