Class LineOfSight

  • Direct Known Subclasses:
    GeoElementLineOfSight, LocationLineOfSight

    public abstract class LineOfSight
    extends Analysis
    Line of Sight analysis calculates segments of visibility between two points.

    Maximum number of line of sights per GeoView is 64. Line of sights in excess of 64 will not be rendered.

    Notes on Android:

    • Line of Sight is supported only on devices that support OpenGL ES 3.0 or later. For unsupported devices, adding a Line of Sight may not render anything.
    • If Line of Sight is always required by your application and cannot be enabled/disabled, then add the following to the application's Manifest:
      <uses-feature android:glEsVersion="0x00030000" android:required="true" />
    • If Line of Sight is not always required by your application and can be enabled/disabled, then add the following to the application's Manifest:
      <uses-feature android:glEsVersion="0x00020000" android:required="true" />
      In this case, the application can query the version of OpenGL ES and enable Line of Sight if the supported version is at least 3.0. For more details see OpenGL ES
    Since:
    10.2.0
    • Method Detail

      • getVisibleColor

        public static int getVisibleColor()
        Gets the color used to render segments that are visible along the line of sight.

        Default is 0xff00ff00 (green).

        Returns:
        the color used to render segments that are visible along the line of sight, in 0xAARRGGBB format
        Since:
        10.2.0
      • setVisibleColor

        public static void setVisibleColor​(int visibleColor)
        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
      • getObstructedColor

        public static int getObstructedColor()
        Gets the color used to render segments that are obstructed along the line of sight.

        Default is 0xffff0000 (red).

        Returns:
        the color used to render segments that are obstructed along the line of sight, in 0xAARRGGBB format
        Since:
        10.2.0
      • setObstructedColor

        public static void setObstructedColor​(int obstructedColor)
        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

        public LineOfSight.TargetVisibility 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:
        java.lang.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