JSLineString

API for creating and modifying line objects.

Create a API with Module.createLineString.

var object = Module.createLineString("ID");

Function

createbyJson(option) → string

Creates a line object.

Set the line object using the argument variable.

Name
Type
Description

option

Initialization option properties

  • Return

    • "success": Creation successful.

    • Other error messages including the cause of the error

  • Sample

getBoundary() → JSAABBox3D

Returns the object's boundary.

  • Return

    • JSAABBox3D: The function successfully returns the object's bounds.

    • null: Object bounds return failed.

getCenter() → JSVector3D

Returns the center point of the object.

  • Return

    • JSVector3D: Returns the centroid coordinates (longitude, latitude, altitude) of the object successfully.

    • null: Coordinate return failed.

getExtent() → number

Returns the distance between Min-Max of the object boundary Box.

  • Return

    • number: Distance between Min-Max of the object boundary Box.

getId() → string

Returns the ID of the object.

  • Return

    • string: Successful return of the object's Key string.

    • null: If the object is null.

getLength(terrain) → number

Returns the length of the line.

Name
Type
Description

terrain

boolean

Whether to consider terrain union. true: Calculates the length considering terrain height by combining the line with the terrain. false: Calculates the length through distance calculation of the input coordinate list without combining the line with the terrain.

  • Return

    • number(0 or higher): Successful return of the line length.

    • number(-1.0): If the object is null.

SetDashType(dash) → boolean

Set line spacing.

Name
Type
Description

dash

number

Dash interval

  • Return

    • true: Successful object option setting.

    • false: Failed object option setting.

setPartCoordinates(coordinates, parts)

Creates a line object.

A minimum of 3 components for coordinates is required.

A minimum of 1 component for parts is required.

Name
Type
Description

coordinates

List of longitude, latitude, altitude coordinates.

parts

List of point counts composing the line.

setUnionMode(type)

Line visualization option.

Sets whether the line is combined with the terrain.

Name
Type
Description

type

boolean

true for terrain union visualization (RTT) false for basic visualization.

Getter / Setter

getDescription(), setDescription(desc) → string

Set a description for the object.

Name
Type
Description

desc

string

Object description string.

  • Return

    • string: Successful return of the object's description string.

    • null: If the object is null.

getName(), setName(name) → string

Sets the name of the object.

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.

getVisible(), setVisible(visible) → boolean

Sets the visibility state of an object.

Name
Type
Description

visible

boolean

true: Make the object visible. false: Hide the object.

  • Return

    • true: Object visible state.

    • false: Object hidden state.

getCoordinates(), setCoordinates(coordinates) → Collection

Sets the list of coordinates for the line object.

A minimum of 3 components for coordinates is required.

Name
Type
Description

coordinates

List of longitude, latitude, altitude coordinates.

getStyle(), setStyle(style) → JSPolyLineStyle

Changes the line style with options applied in JSPolyLineStyle.

Sets color, thickness, and opacity.

Name
Type
Description

style

Object style

Type Definitions

JSLineString.CreateOptions

Options for creating a line object.

Name
Type
Attributes
Default
Description

coordinates

Vertex management options.

type

number

optional

0

Line visualization type.

skip

number

optional

1

Animation detail option.

width

number

optional

1

Line thickness option.

dash

number

optional

0

Dash interval option.

speed

number

optional

0

Animation speed option.

union

boolean

optional

false

true for terrain union visualization (RTT) false for basic visualization.

depth

boolean

optional

true

color

optional

JSColor(200, 255, 255, 255)

Line visualization color.

Last updated