- 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
PropertiesTypePropertyDescriptionstatic 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
Nested ClassesModifier and TypeClassDescriptionstatic enumSpecifies the target's visibility.static final classAn event indicating that the target visibility has changed.static interfaceListener for changes in target visibility. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener for when the target visibility has changed.static floatGets the line width used to render line of sight.static ColorGets the value of theobstructedColorproperty.Gets the target's visibility.static ColorGets the value of thevisibleColorproperty.static ObjectProperty<Color> The color used to render segments that are obstructed along the line of sight.booleanRemoves a target visibility changed listener.static voidsetLineWidth(float lineWidth) Sets the line width used to render line of sight.static voidsetObstructedColor(int obstructedColor) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetObstructedColor(Color color) Sets the value of theobstructedColorproperty.static voidsetVisibleColor(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 voidsetVisibleColor(Color color) Sets the value of thevisibleColorproperty.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
visibleColorproperty - Since:
- 200.0.0
- See Also:
-
getVisibleColor
Gets the value of thevisibleColorproperty.- 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
visibleColorproperty - Since:
- 200.0.0
- See Also:
-
setVisibleColor
Sets the value of thevisibleColorproperty.- 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 thevisibleColorproperty- 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
obstructedColorproperty - Since:
- 200.0.0
- See Also:
-
getObstructedColor
Gets the value of theobstructedColorproperty.- 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
obstructedColorproperty - Since:
- 200.0.0
- See Also:
-
setObstructedColor
Sets the value of theobstructedColorproperty.- 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 theobstructedColorproperty- 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)