- Direct Known Subclasses:
GeoElementLineOfSight
,LocationLineOfSight
The LineOfSight analysis result is a line rendered between the observer and target with distinct colors representing visible and obstructed segments.
When at least one of the two ends (the observer and the target) of the line is placed outside the view, the colors of the visible part of the line may not accurately represent the hidden part. In such cases, the line is rendered gray. To display the color, move both the observer and the target into the view.
Maximum number of line of sights per GeoView is 64. Line of sights in excess of 64 will not be rendered.
- Since:
- 10.2.0
-
Property Summary
TypePropertyDescriptionstatic ObjectProperty
<Color> The color used to render segments that are obstructed along the line of sight.static ObjectProperty
<Color> The color used to render segments that are visible along LineOfSight analysis results. -
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Specifies the target's visibility.static final class
An event indicating that the target visibility has changed.static interface
Listener for changes in target visibility. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener for when the target visibility has changed.static float
Gets the line width used to render line of sight.static Color
Gets the value of theobstructedColor
property.Gets the target's visibility.static Color
Gets the value of thevisibleColor
property.static ObjectProperty
<Color> The color used to render segments that are obstructed along the line of sight.boolean
Removes a target visibility changed listener.static void
setLineWidth
(float lineWidth) Sets the line width used to render line of sight.static void
setObstructedColor
(int obstructedColor) Deprecated, for removal: This API element is subject to removal in a future version.static void
setObstructedColor
(Color color) Sets the value of theobstructedColor
property.static void
setVisibleColor
(int visibleColor) Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetVisibleColor(Color)
static void
setVisibleColor
(Color color) Sets the value of thevisibleColor
property.static ObjectProperty
<Color> The color used to render segments that are visible along LineOfSight analysis results.Methods inherited from class com.esri.arcgisruntime.geoanalysis.Analysis
isVisible, setVisible
-
Property Details
-
visibleColor
The color used to render segments that are visible along LineOfSight analysis results.Sections of the line between the observer and the target that are visible are drawn with the specified color. This property is applied to all LineOfSight analyses in the view.
Default is
Color.LIME
.Attempting to set the color to null will throw an exception.
- Since:
- 200.0.0
- See Also:
-
obstructedColor
The color used to render segments that are obstructed along the line of sight.Sections of the line between the observer and the target that are obstructed (not visible) are drawn with the specified color. This property is applied to all LineOfSight analyses in the view.
Default is
Color.RED
.Attempting to set the color to null will throw an exception.
- Since:
- 200.0.0
- See Also:
-
-
Method Details
-
visibleColorProperty
The color used to render segments that are visible along LineOfSight analysis results.Sections of the line between the observer and the target that are visible are drawn with the specified color. This property is applied to all LineOfSight analyses in the view.
Default is
Color.LIME
.Attempting to set the color to null will throw an exception.
- Returns:
- the
visibleColor
property - Since:
- 200.0.0
- See Also:
-
getVisibleColor
Gets the value of thevisibleColor
property.- Property description:
- The color used to render segments that are visible along LineOfSight analysis results.
Sections of the line between the observer and the target that are visible are drawn with the specified color. This property is applied to all LineOfSight analyses in the view.
Default is
Color.LIME
.Attempting to set the color to null will throw an exception.
- Returns:
- the value of the
visibleColor
property - Since:
- 200.0.0
- See Also:
-
setVisibleColor
Sets the value of thevisibleColor
property.- Property description:
- The color used to render segments that are visible along LineOfSight analysis results.
Sections of the line between the observer and the target that are visible are drawn with the specified color. This property is applied to all LineOfSight analyses in the view.
Default is
Color.LIME
.Attempting to set the color to null will throw an exception.
- Parameters:
color
- the value for thevisibleColor
property- Since:
- 200.0.0
- See Also:
-
setVisibleColor
Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetVisibleColor(Color)
Sets the color used to render segments that are visible along the line of sight.This is applied to all instances.
- Parameters:
visibleColor
- the color used to render segments that are visible along the line of sight, in 0xAARRGGBB format- Since:
- 10.2.0
-
obstructedColorProperty
The color used to render segments that are obstructed along the line of sight.Sections of the line between the observer and the target that are obstructed (not visible) are drawn with the specified color. This property is applied to all LineOfSight analyses in the view.
Default is
Color.RED
.Attempting to set the color to null will throw an exception.
- Returns:
- the
obstructedColor
property - Since:
- 200.0.0
- See Also:
-
getObstructedColor
Gets the value of theobstructedColor
property.- Property description:
- The color used to render segments that are obstructed along the line of sight.
Sections of the line between the observer and the target that are obstructed (not visible) are drawn with the specified color. This property is applied to all LineOfSight analyses in the view.
Default is
Color.RED
.Attempting to set the color to null will throw an exception.
- Returns:
- the value of the
obstructedColor
property - Since:
- 200.0.0
- See Also:
-
setObstructedColor
Sets the value of theobstructedColor
property.- Property description:
- The color used to render segments that are obstructed along the line of sight.
Sections of the line between the observer and the target that are obstructed (not visible) are drawn with the specified color. This property is applied to all LineOfSight analyses in the view.
Default is
Color.RED
.Attempting to set the color to null will throw an exception.
- Parameters:
color
- the value for theobstructedColor
property- Since:
- 200.0.0
- See Also:
-
setObstructedColor
@Deprecated(since="200.0.0", forRemoval=true) public static void setObstructedColor(int obstructedColor) Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetObstructedColor(Color)
Sets the color used to render segments that are obstructed along the line of sight.This is applied to all instances.
- Parameters:
obstructedColor
- the color used to render segments that are obstructed along the line of sight, in 0xAARRGGBB format- Since:
- 10.2.0
-
getLineWidth
public static float getLineWidth()Gets the line width used to render line of sight.Default is 1.0.
- Returns:
- the line width used to render line of sight, in dp
- Since:
- 10.2.0
-
setLineWidth
public static void setLineWidth(float lineWidth) Sets the line width used to render line of sight.Default is 1.0.
This is applied to all instances.
- Parameters:
lineWidth
- the line width used to render line of sight, in dp- Since:
- 10.2.0
-
getTargetVisibility
Gets the target's visibility.- Returns:
- the target's visibility
- Since:
- 10.2.0
-
addTargetVisibilityChangedListener
public void addTargetVisibilityChangedListener(LineOfSight.TargetVisibilityChangedListener listener) Adds a listener for when the target visibility has changed.- Parameters:
listener
- the listener- Throws:
IllegalArgumentException
- if the listener is null- Since:
- 100.2.0
-
removeTargetVisibilityChangedListener
public boolean removeTargetVisibilityChangedListener(LineOfSight.TargetVisibilityChangedListener listener) Removes a target visibility changed listener.- Parameters:
listener
- the listener- Returns:
- true if successful, otherwise false
- Since:
- 100.2.0
-
setObstructedColor(Color)