# JSGhostSymbol

> Create a API with Module.createGhostSymbol.

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

## Function

### getBasePointX() → number

> Returns the X-axis offset value based on the center coordinates of the ghost symbol.

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

* Return
  * X-axis offset value (in meters).
* Sample
  * Refer to function displayGhostSymbolProperties.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### getBasePointY() → number

> Returns the Y-axis offset value based on the center coordinates of the ghost symbol.

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

* Return
  * Y-axis offset value (in meters).
* Sample
  * Refer to function displayGhostSymbolProperties.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### getBasePointZ() → number

> Returns the Z-axis offset value based on the center coordinates of the ghost symbol.

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

* Return
  * Z-axis offset value (in meters).
* Sample
  * Refer to function displayGhostSymbolProperties.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### getDescription() → string

> Returns the description of the object.

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

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

{% tab title="Template" %}

```javascript
var strDesc = object.getDescription();
```

{% endtab %}
{% endtabs %}

### getGhostSymbolMapKey() → string

> Returns the referenced object name of the ghost symbol.

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

* Return
  * string: Successful return of the referenced object name of the ghost symbol.
  * null: Failure to return the name.
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### getId() → string

> Returns the Key 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
var strKey = object.getId();
```

{% endtab %}
{% endtabs %}

### getPosition() → [JSVector3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jsvector3d)

> Returns the latitude and longitude position of the ghost symbol object.

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

* Return
  * [JSVector3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jsvector3d): Returns the centroid coordinates (longitude, latitude, altitude) of the ghost symbol successfully.
  * null: Coordinate return failed.
* Sample
  * Refer to function displayGhostSymbolProperties.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### getRotationX() → number

> Returns the X-axis rotation angle of the ghost symbol object.

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

* Return
  * X-axis rotation angle.
* Sample
  * Refer to function displayGhostSymbolProperties.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### getRotationY() → number

> Returns the Y-axis rotation angle of the ghost symbol object.

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

* Return
  * Y-axis rotation angle.
* Sample
  * Refer to function displayGhostSymbolProperties.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### getRotationZ() → number

> Returns the Z-axis rotation angle of the ghost symbol object.

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

* Return
  * Z-axis rotation angle.
* Sample
  * Refer to function displayGhostSymbolProperties.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### getScale() → [JSSize3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jssize3d)

> Returns the size of the ghost symbol object.

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

* Return
  * [JSSize3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jssize3d): Successful return of the ghost symbol size (x,y,z).
  * null: Failure to return size.
* Sample
  * Refer to function displayGhostSymbolProperties.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### moveVertically(alt) → boolean

> Moves the object vertically (up/down).

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

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| alt  | number | Vertical movement distance of the object. |

* Return
  * true: Successful specification of movement distance.
  * false: Failure to specify movement distance.
    {% endtab %}

{% tab title="Template" %}

```javascript
var newGhostSymbol = Module.createGhostSymbol("newGhostSymbol");
newGhostSymbol.moveVertically(150.0);
```

{% endtab %}
{% endtabs %}

### setBasePoint(x, y, z) → boolean

> Sets the movement based on the center coordinates of the ghost symbol by the input values.

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

| Name | Type   | Description                        |
| ---- | ------ | ---------------------------------- |
| x    | number | X-axis movement value (in meters). |
| y    | number | Y-axis movement value (in meters). |
| z    | number | Z-axis movement value (in meters). |

* Return
  * true: Successful object setting.
  * false: Failed object setting.
* Sample
  * Refer to function setBasePoint.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### setGhostSymbol(name) → boolean

> Specifies the object model registered in the ghost symbol map.

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

| Name | Type   | Description                    |
| ---- | ------ | ------------------------------ |
| name | string | Name of the registered object. |

* Return
  * true: Successful object setting.
  * false: Failed object setting.
* Sample
  * Refer to function createGhostSymbol.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### setPosition(position) → boolean

> Sets the position of the ghost symbol object.

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

| Name     | Type                                                                                        | Description                                                        |
| -------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| position | [JSVector3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jsvector3d) | Ghost symbol location coordinates (longitude, latitude, altitude). |

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

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### setScale(scale) → boolean

> Sets the size of the ghost symbol object.
>
> Input values for scale(x,y,z) must be greater than 0.
>
> Initial size setting for x,y,z is (1,1,1).

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

| Name  | Type                                                                                    | Description                        |
| ----- | --------------------------------------------------------------------------------------- | ---------------------------------- |
| scale | [JSSize3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jssize3d) | Size setting for the ghost symbol. |

* Return
  * true: Successful object setting.
  * false: Failed object setting.
* Sample
  * Refer to function createGhostSymbol.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### setRotation(x, y, z) → boolean

> Sets the rotation angles of the ghost symbol object.

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

| Name | Type   | Description                          |
| ---- | ------ | ------------------------------------ |
| x    | number | Rotation angle change on the X-axis. |
| y    | number | Rotation angle change on the Y-axis. |
| z    | number | Rotation angle change on the Z-axis. |

* Return
  * true: Successful object setting.
  * false: Failed object setting.
* Sample
  * Refer to function setRotation.
  * [Sandbox\_Ghost Symbol Editing](https://sandbox.egiscloud.com/code/main.do?id=object_ghost_symbol_edit)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

## Getter / Setter

### getColor(), setColor(color) → [JSColor](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jscolor)

> Sets the color of the object.

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

| Name  | Type                                                                                  | Description         |
| ----- | ------------------------------------------------------------------------------------- | ------------------- |
| color | [JSColor](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jscolor) | Color of the object |

* Return
  * The color of the object
    {% endtab %}

{% tab title="Template" %}

```javascript
```

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

### getOpacity(), setOpacity(opacity) → number

> Sets the opacity of the object.

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

| Name    | Type   | Description           |
| ------- | ------ | --------------------- |
| opacity | number | Opacity of the object |

* Return
  * The opacity of the object
    {% endtab %}

{% tab title="Template" %}

```javascript
```

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