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.
Return
"success": Creation successful.
Other error messages including the cause of the error
Sample
Refer to function createLine.
getBoundary() → JSAABBox3D
Returns the object's boundary.
Return
JSAABBox3D: The function successfully returns the object's bounds.
null: Object bounds return failed.
var boundary = object.getBoundary();
var boundary_min = boundary.min;
var boundary_max = boundary.max;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.
var vCenter = object.getCenter();
var dCenterLon = vCenter.Longitude;
var dCenterLat = vCenter.Latitude;
var dCenterAlt = vCenter.Altitude;getExtent() → number
Returns the distance between Min-Max of the object boundary Box.
Return
number: Distance between Min-Max of the object boundary Box.
var bExtends = object.getExtent();getId() → string
Returns the ID of the object.
Return
string: Successful return of the object's Key string.
null: If the object is null.
lat strKey = object.getId();getLength(terrain) → number
Returns the length of the line.
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.
var length = object.getLength();SetDashType(dash) → boolean
Set line spacing.
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.
Sample
Refer to function createBufferPolygon.
setUnionMode(type)
Line visualization option.
Sets whether the line is combined with the terrain.
type
boolean
true for terrain union visualization (RTT) false for basic visualization.
Sample
Refer to function createObjectToPathPosition .
Getter / Setter
getDescription(), setDescription(desc) → string
Set a description for the object.
desc
string
Object description string.
Return
string: Successful return of the object's description string.
null: If the object is null.
var strDesc = object.getDescription();
// ... or ...
object.setDescription("First Object.");getName(), setName(name) → string
Sets the name of the object.
name
string
The name to set for the object.
Return
string: Successful return of the object's name.
null: If the object is null.
var objName = object.getName();
// ... or ...
object.setName("MyObject");getVisible(), setVisible(visible) → boolean
Sets the visibility state of an object.
visible
boolean
true: Make the object visible. false: Hide the object.
Return
true: Object visible state.
false: Object hidden state.
var objName = object.getName();
// ... or ...
object.setVisible(true);getCoordinates(), setCoordinates(coordinates) → Collection
Sets the list of coordinates for the line object.
A minimum of 3 components for coordinates is required.
Return
Collection: List of coordinates.
Sample
Refer to function createPathLine.
var coorList = object.getCoordinates();getStyle(), setStyle(style) → JSPolyLineStyle
Changes the line style with options applied in JSPolyLineStyle.
Sets color, thickness, and opacity.
Return
Valid object style (JSPolyLineStyle): Successful return of the object style.
Simple initialized state of object style (JSPolyLineStyle): If the object is null.
Sample
Refer to function createBufferPolygon.
var objectStyle = polyLine.getStyle();Type Definitions
JSLineString.CreateOptions
Options for creating a line object.
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
Last updated