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

# JSPoint

> Create a API with Module.createPoint.

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

## Function

### getAltitude() → number

> Returns the altitude of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * number: Object's altitude (in meters).
{% endtab %}

{% tab title="Template" %}
```javascript
var dAltitude = point.getAltitude();
```
{% endtab %}
{% endtabs %}

### getFontColor() → [JSColor](../core/jscolor)

> Returns the text color of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * ([JSColor](../core/jscolor)): Successfully returns the text color.
  * null: text color return failed.
{% endtab %}

{% tab title="Template" %}
```javascript
var fontColor = object.getFontColor();
```
{% endtab %}
{% endtabs %}

### getFontName() → string

> Returns the font name of the object's text.

{% tabs %}
{% tab title="Information" %}
* Return
  * string: Successfully returns the text font name.
  * null: Font name return failed.
{% endtab %}

{% tab title="Template" %}
```javascript
var fontName = object.getFontName();
```
{% endtab %}
{% endtabs %}

### getFontOutColor() → [JSColor](../core/jscolor)

> Returns the text outline color of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * ([JSColor](../core/jscolor)): Successfully returns the text outline color.
  * null: Text outline return failed.
{% endtab %}

{% tab title="Template" %}
```javascript
var fontOutLineColor = object.getFontOutColor();
```
{% endtab %}
{% endtabs %}

### getFontSize() → number

> Returns the text size of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * number (0 or higher): Successfully returns the object's text size.
  * number (-1): If the object is null.
{% endtab %}

{% tab title="Template" %}
```javascript
var fontSize = object.getFontSize();
```
{% endtab %}
{% endtabs %}

### getFontWeight() → number

> Returns the text weight of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * number (0 or higher): Successfully returns the object's text weight.
  * number (-1): If the object is null.
{% endtab %}

{% tab title="Template" %}
```javascript
var fotnWeight = object.getFontWeight();
```
{% endtab %}
{% endtabs %}

### getHighlightIcon() → [JSIcon](jsicon)

> Returns the Highlight type icon object.

{% tabs %}
{% tab title="Information" %}
* Return
  * [JSIcon](jsicon): The set icon object.
{% endtab %}

{% tab title="Template" %}
```javascript
var icon_hg = object.getHighlightIcon();
```
{% endtab %}
{% endtabs %}

### getIcon() → [JSIcon](jsicon)

> Returns the default type icon object.

{% tabs %}
{% tab title="Information" %}
* Return
  * [JSIcon](jsicon): The set icon object.
{% endtab %}

{% tab title="Template" %}
```javascript
var icon_normal = object.getIcon();
```
{% 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 %}

### getLatitude() → number

> Returns the latitude of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * number: Object's latitude (in degrees).
{% endtab %}

{% tab title="Template" %}
```javascript
var dLatitude = point.getLatitude();
```
{% endtab %}
{% endtabs %}

### getLongitude() → number

> Returns the longitude of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * number: Object's longitude (in degrees).
{% endtab %}

{% tab title="Template" %}
```javascript
var dLongitude = point.getLongitude();
```
{% endtab %}
{% endtabs %}

### getPosition() → [JSVector3D](../core/jsvector3d)

> Returns the position of the object.

{% tabs %}
{% tab title="Information" %}
* Return
  * [JSVector3D](../core/jsvector3d): Returns the bottom center coordinates (longitude, latitude, altitude) of the object successfully.
  * null: Coordinate return failed.
{% endtab %}

{% tab title="Template" %}
```javascript
var vPos = point.getPosition();
```
{% endtab %}
{% endtabs %}

### getVisibleRangeActivate() → boolean

> Returns whether the visibility range value of the POI object is enabled or disabled.
>
> If the visibility range value is disabled, the POI object's visibility range references the visibility range value of the layer to which the POI object belongs.
>
> POI objects created through the service layer cannot have their visibility range values set.

{% tabs %}
{% tab title="Information" %}
* Return
  * true: Visibility range setting successful.
  * false: Visible range setting failed.
  * Failure conditions.
    * If the POI object is created from data loaded from an external server.
    * If the POI object is null.
{% endtab %}

{% tab title="Template" %}
```javascript
var bActive = object.getVisibleRangeActivate();
```
{% endtab %}
{% endtabs %}

### getVisibleRangeMax() → number

> Returns the maximum visibility range value of the POI object.

{% tabs %}
{% tab title="Information" %}
* Return
  * Valid number: Successfully returns the maximum visibility range value.
  * In the following cases, the API always returns a fixed value.
    * -999.0: If the POI object is null.
    * -998.0: If the POI object is created from data loaded from an external server.
    * -997.0: If the visibility range setting is deactivated.
{% endtab %}

{% tab title="Template" %}
```javascript
var rangeMax = object.getVisibleRangeMax();
```
{% endtab %}
{% endtabs %}

### getVisibleRangeMin() → number

> Returns the minimum visibility range value of the POI object.

{% tabs %}
{% tab title="Information" %}
* Return
  * Valid number: Successfully returns the minimum visibility range value.
  * In the following cases, the API always returns a fixed value.
    * -999.0: If the POI object is null.
    * -998.0: If the POI object is created from data loaded from an external server.
    * -997.0: If the visibility range setting is deactivated.
{% endtab %}

{% tab title="Template" %}
```javascript
var rangeMin = object.getVisibleRangeMin();
```
{% endtab %}
{% endtabs %}

### isExistHighlightIcon() → boolean

> Returns whether a highlight type icon is specified.

{% tabs %}
{% tab title="Information" %}
* Return
  * true: An icon is specified.
  * false: No icon is specified.
{% endtab %}

{% tab title="Template" %}
```javascript
var bExistHighlightIcon = object.isExistHighlightIcon();
```
{% endtab %}
{% endtabs %}

### isExistIcon() → boolean

> Returns whether a default type icon is specified.

{% tabs %}
{% tab title="Information" %}
* Return
  * true: An icon is specified.
  * false: No icon is specified.
{% endtab %}

{% tab title="Template" %}
```javascript
var bExistNormalIcon = object.isExistIcon();
```
{% endtab %}
{% endtabs %}

### setAltitude(alt) → boolean

> Sets the altitude value of the object (object latitude and longitude remain unchanged).

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description           |
| ---- | ------ | --------------------- |
| alt  | number | Altitude (in meters). |

* Return
  * true: Location setting successful.
  * false: Location setting failed.
{% endtab %}

{% tab title="Template" %}
```javascript
point.setAltitude(50.0);
```
{% endtab %}
{% endtabs %}

### setFontStyle(name, size, weight, fill\_color, outline\_color) → boolean

> Sets the text style of the POI.
>
> Font, size, weight, and color settings.

{% tabs %}
{% tab title="Information" %}
| Name           | Type                       | Description        |
| -------------- | -------------------------- | ------------------ |
| name           | string                     | Font name          |
| size           | number                     | Text size          |
| weight         | number                     | Text weight        |
| fill\_color    | [JSColor](../core/jscolor) | Text color         |
| outline\_color | [JSColor](../core/jscolor) | Text outline color |

* Return
  * true: Object setting successful.
  * false: Object setting failed.
* Sample
  * Refer to function createPoint.
  * [Sandbox\_Path Analysis](https://sandbox.egiscloud.com/code/main.do?id=analysis_line_path_distance)
{% endtab %}

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

### setHighlightIcon(icon) → boolean

> Sets the Highlight type icon.

{% tabs %}
{% tab title="Information" %}
| Name | Type             | Description |
| ---- | ---------------- | ----------- |
| icon | [JSIcon](jsicon) | image icon. |

* Return
  * true: Icon setting successful.
  * false: If the object does not exist or the texture does not exist.
{% endtab %}

{% tab title="Template" %}
```javascript
var icon_hg = Module.getSymbol().getIcon("Icon_hg");
object.setHighlightIcon(icon_hg);
```
{% endtab %}
{% endtabs %}

### setIcon(icon) → boolean

> Sets the default type icon.

{% tabs %}
{% tab title="Information" %}
| Name | Type             | Description             |
| ---- | ---------------- | ----------------------- |
| icon | [JSIcon](jsicon) | The icon object to set. |

* Return
  * true: Icon setting successful.
  * false: If the object does not exist or the texture does not exist.
{% endtab %}

{% tab title="Template" %}
```javascript
var icon = Module.getSymbol().getIcon("Icon2");
object.setIcon(icon);
```
{% endtab %}
{% endtabs %}

### setImage(data, width, height) → boolean

> Sets an image for the POI.
>
> The data variable is based on a Uint8Array of binary array data.
>
> Actual size of width, height must be entered (>1).

{% tabs %}
{% tab title="Information" %}
| Name   | Type   | Description              |
| ------ | ------ | ------------------------ |
| data   | array  | Image pixel value array. |
| width  | number | Image width.             |
| height | number | Image height.            |

* Return
  * true: image setting successful.
  * false: image setting failed.
  * Failure conditions.
    * If data value is null.
    * If width, height < 0
* Sample
  * Refer to function createPOI.
  * [Sandbox\_POI](https://sandbox.egiscloud.com/code/main.do?id=object_point)
{% endtab %}

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

### setLatitude(lat) → boolean

> Sets the latitude value of the object (object longitude and altitude remain unchanged).

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description            |
| ---- | ------ | ---------------------- |
| lat  | number | Latitude (in degrees). |

* Return
  * true: Location setting successful.
  * false: If the object does not exist.
{% endtab %}

{% tab title="Template" %}
```javascript
point.setLatitude(35.1713096);
```
{% endtab %}
{% endtabs %}

### setLongitude(lon) → boolean

> Sets the longitude value of the object (object latitude and altitude remain unchanged).

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description             |
| ---- | ------ | ----------------------- |
| lon  | number | Longitude (in degrees). |

* Return
  * true: Location setting successful.
  * false: If the object does not exist.
{% endtab %}

{% tab title="Template" %}
```javascript
point.setLongitude(129.1270931);
```
{% endtab %}
{% endtabs %}

### setLonLat(lon, lat) → boolean

> Sets the location (longitude, latitude) of the object (object altitude remains unchanged).

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description             |
| ---- | ------ | ----------------------- |
| lon  | number | Longitude (in degrees). |
| lat  | number | Latitude (in degrees).  |

* Return
  * true: Location setting successful.
  * false: Location setting failed.
{% endtab %}

{% tab title="Template" %}
```javascript
point.setLonLat(129.1270931, 35.1713096);
```
{% endtab %}
{% endtabs %}

### setPosition(position) → boolean

> Sets the location of the POI.

{% tabs %}
{% tab title="Information" %}
| Name     | Type                             | Description                                               |
| -------- | -------------------------------- | --------------------------------------------------------- |
| position | [JSVector3D](../core/jsvector3d) | POI location coordinates (longitude, latitude, altitude). |

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

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

### setPositionLine(length, color) → boolean

> Sets a line perpendicular to the ground to be visible for the specified length.
>
> A length input value > 0 is required.

{% tabs %}
{% tab title="Information" %}
| Name   | Type                       | Description                     |
| ------ | -------------------------- | ------------------------------- |
| length | number                     | POI vertical line length.       |
| color  | [JSColor](../core/jscolor) | Color of the POI vertical line. |

* Return
  * true: Object setting successful.
  * false: Object setting failed.
  * Failure conditions.
    * If type<0 value is set.
* Sample
  * Refer to function createPOI.
  * [Sandbox\_POI Line](https://sandbox.egiscloud.com/code/main.do?id=object_point_line)
{% endtab %}

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

### setRenderToTerrainTexture(type) → boolean

> Sets the POI to be drawn on the terrain based on RTT.

{% tabs %}
{% tab title="Information" %}
| Name | Type    | Description                                                                              |
| ---- | ------- | ---------------------------------------------------------------------------------------- |
| type | boolean | <p>true for terrain-combined visualization (RTT)<br>false for default visualization.</p> |

* Return
  * true: Object setting successful.
  * false: Object setting failed.
* Sample
  * Refer to function createPOI.
  * [Sandbox\_POI RTT](https://sandbox.egiscloud.com/code/main.do?id=object_point_rtt)
{% endtab %}

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

### setText(text) → boolean

> Sets the visualization text for the POI.

{% tabs %}
{% tab title="Information" %}
| Name | Type   | Description |
| ---- | ------ | ----------- |
| text | string | POI text    |

* Return
  * true: Object setting successful.
  * false: Object setting failed.
* Sample
  * Refer to function createPOI.
  * [Sandbox\_POI](https://sandbox.egiscloud.com/code/main.do?id=object_point)
{% endtab %}

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

### setVisibleRange(enable, min, max) → boolean

> Sets the visibility range of the POI object.
>
> If the min value is greater than the max, it automatically switches the smaller value to min and the larger value to max.
>
> If the POI object is created from data loaded from an external server, the visibility range cannot be set.

{% tabs %}
{% tab title="Information" %}
| Name   | Type    | Description                                     |
| ------ | ------- | ----------------------------------------------- |
| enable | boolean | Whether to activate the visibility range value. |
| min    | number  | Minimum visibility distance.                    |
| max    | number  | Maximum visibility distance.                    |

* Return
  * true: Visibility range setting successful.
  * false: Visibility range setting failed.
  * Failure conditions.
    * In the following cases, the API always returns false.
    * If the POI object is created from data loaded from an external server.
    * If the POI object is null.
{% endtab %}

{% tab title="Template" %}
```javascript
object.setVisibleRange(true, 50.0, 20000.0);
```
{% 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 %}

### getHighlight(), setHighlight(highlight) → boolean

> Sets whether to use the Highlight type icon.

{% tabs %}
{% tab title="Information" %}
| Name      | Type    | Description                                                                                              |
| --------- | ------- | -------------------------------------------------------------------------------------------------------- |
| highlight | boolean | <p>true: Sets to display the Highlight icon image.<br>false: Sets to display the default icon image.</p> |

* Return
  * true: Setting successful.
  * false: Setting failed.
  * Failure conditions.
    * In the following cases, the API always returns false.
    * If the POI object is null.
    * If there is no icon set for the Highlight type.
{% endtab %}

{% tab title="Template" %}
```javascript
var bHighlightUsed = object.getHighlight();
// ... or ...
object.setHighlight(true);
```
{% 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 %}
