Sightline

new SuperMap3D.Sightline(scene)

Line-of-sight analysis, that is, line-of-sight analysis, establishes line-of-sight analysis based on the observer point and target point, and analyzes the results in the scene.
Name Type Description
scene Scene scene object.
Throws:
Example:
//Create Line-of-Sight Analysis
var sightline = new SuperMap3D.Sightline(scene);
Demo:

Members

hiddenColor : Color

Get or set the color of the invisible part of the line-of-sight analysis.
Example:
var sightline = new SuperMap3D.Sightline(scene);
var color = new SuperMap3D.Color(1, 0, 0);
//Set the color of the invisible part
sightline .hiddenColor = color;
// Get the color of the invisible part
var value= sightline .hiddenColor ;

lineWidth : Number

Gets or sets the width of the line of sight.

viewPosition : Array

Get or set the observer's position. A location is represented by an array of longitude, latitude, and elevation.
Example:
var sightline = new SuperMap3D.Sightline(scene);
        //Set the position of the observer
        sightline.viewPosition = [120, 40, 100];
        // Get the position of the observer
var value= sightline .viewPosition;

visibleColor : Color

Get or set the visible part color of the line-of-sight analysis.
Example:
var sightline = new SuperMap3D.Sightline(scene);
var color = new SuperMap3D.Color(0, 1, 0);
//Set the visible part color
sightline.visibleColor = color;
//Get the visible part color
var value= sightline .visibleColor ;

Methods

addTargetPoint(options)Boolean

Add target points.
Name Type Description
options Object Objects have the following properties.
Name Type Description
position Array Location information, represented by an array of longitude, latitude, and elevation.
name String The name of the target point.
Returns:
Returns true if added successfully, otherwise returns false.
Example:
var sightline = new SuperMap3D.Sightline(scene);
sightline.addTargetPoint({
postion : [120, 40, 50],
name : “first”
               });

build()

Perform line-of-sight analysis.
Example:
var sightline = new SuperMap3D.Sightline(scene);
sightline.build();

getBarrierPoint(name, func)Object

Get handicap points.
Name Type Description
name String Target point name.
func Object Callback.
Returns:
Object.isViewer,Object.position Visible latitude and longitude height.

getObjectIds()Object

Obtain the IDS collection of all obstacle objects in the line-of-sight analysis.
Returns:
Returns a k-v object, the key is the S3M layer ID, and the value is the object IDS array.

getVisibleInViewport(index)Boolean

Get the viewport visibility corresponding to the layer.
Name Type Description
index Number Index
Returns:
visible
Throws:

removeAllTargetPoint()

Remove all target points.
Example:
var sightline = new SuperMap3D.Sightline(scene);
sightline.removeAllTargetPoint();

removeTargetPoint(name)Boolean

Removes the target point with the specified name.
Name Type Description
name String The name of the target point to be removed.
Returns:
Returns true if the removal is successful, otherwise returns false.
Example:
var sightline = new SuperMap3D.Sightline(scene);
var flag = sightline.removeTargetPoint(“first”);

setVisibleInViewport(index)

Sets the layer corresponding viewport visibility.
Name Type Description
index Number Index
Throws: