Class ParameterizedFeatureCanvas.IconsDrawCommand

java.lang.Object
com.luciad.layers.features.ParameterizedFeatureCanvas.IconsDrawCommand
All Implemented Interfaces:
AutoCloseable
Enclosing class:
ParameterizedFeatureCanvas

public static final class ParameterizedFeatureCanvas.IconsDrawCommand extends Object implements AutoCloseable
Command to draw a set of icons for a geometry using expression-based styling.
Since:
2025.0
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • iconExpression

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand iconExpression(@NotNull StyleExpression<IIcon> iconExpression)
      Specifies the style expression that determines which icon must be drawn.

      For the best performance, re-use the same StyleExpression instance when calling this function multiple times.

      Parameters:
      iconExpression - the icon expression.
      Returns:
      this IconsDrawCommand
    • visibilityExpression

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand visibilityExpression(@NotNull StyleExpression<Boolean> visibilityExpression)
      Specifies the style expression that determines which icons must be visible.

      This property is optional. If not provided, it defaults to an expression that always evaluates to true.

      Parameters:
      visibilityExpression - the visibility expression.
      Returns:
      this IconsDrawCommand
    • scaleExpression

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand scaleExpression(@NotNull StyleExpression<Double> scaleExpression)
      Specifies the style expression that determines the scale of the icons.

      This property is optional. If not provided, it defaults to an expression that always evaluates to 1.0.

      Parameters:
      scaleExpression - the scale expression.
      Returns:
      this IconsDrawCommand
    • colorExpression

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand colorExpression(@NotNull StyleExpression<android.graphics.Color> colorExpression)
      Specifies the style expression that determines the color used to tint the icons.

      Note that you can use the alpha value of this color to make the icons translucent.

      This property is optional. If not provided, it defaults to an expression that always evaluates to fully opaque white.

      Parameters:
      colorExpression - the color expression.
      Returns:
      this IconsDrawCommand
    • geometryProvider

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand geometryProvider(@NotNull IFeatureGeometryProvider geometryProvider)
      Specifies the geometry provider that gets the geometry from the feature.

      This property is optional. If not provided, DefaultFeatureGeometryProvider will be used.

      Parameters:
      geometryProvider - the geometry provider.
      Returns:
      this IconsDrawCommand
    • draped

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand draped(boolean isDrapingEnabled)
      Indicates whether to drape icons on top of the terrain or not.

      Draping means that the icon is painted directly on top of the terrain’s surface relief.

      By default, icons are not draped. You can override the default behavior by setting this flag true or false. If you explicitly drape for a 3D point with height, its height is discarded.

      This setting is only relevant for 3D maps and is ignored for 2D maps.

      Parameters:
      isDrapingEnabled - true if the icons should be draped over terrain.
      Returns:
      this IconsDrawCommand.
    • zOrder

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand zOrder(int zOrder)
      The Z-order of the icons.

      DrawCommands are painted from the lowest to the highest Z-order, so DrawCommands with a higher Z-order are painted on top of DrawCommands with a lower Z-order. Note that the Z-order only affects the ordering of features within the same layer. A feature from a certain layer will always get painted above any other feature from a layer that comes lower in the map's layer order, regardless of their Z-order. The default value is 0.

      Parameters:
      zOrder - the Z-order for this set of icons.
      Returns:
      this IconsDrawCommand.
    • queryable

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand queryable(boolean queryable)
      Indicates whether the icons should be considered when a Map#queryFeatures is requested.

      The default is true.

      Parameters:
      queryable - true if the icon should be considered.
      Returns:
      this IconsDrawCommand.
    • orientationProvider

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand orientationProvider(@NotNull IFeatureOrientationProvider orientationProvider)
      Specifies the orientation provider that gets an orientation from the feature.

      This property is optional. If not provided, all features are considered non-oriented and displayed with the top of the icon pointing to the top of the view.

      Parameters:
      orientationProvider - the orientation provider.
      Returns:
      this IconsDrawCommand
    • size

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand size(double width, double height) throws IllegalArgumentException
      This method overrides the size of the icon resulting from the style expression provided in iconExpression.

      This method is optional. If it is not called, the icon's natural size is used.

      The following methods determine the icon size and position on the map:

      • iconExpression: the icon has a natural size
      • size: the icon's size can be overridden
      • scaleExpression: the scale resulting from the scale expression is applied to either the icon size, or the overridden size
      Parameters:
      width - the width of the icon, defined in device-independent pixels.
      height - the height of the icon, defined in device-independent pixels.
      Returns:
      this IconsDrawCommand
      Throws:
      IllegalArgumentException - if a value equal to or smaller than 0 is provided
    • occlusionMode

      @NotNull public ParameterizedFeatureCanvas.IconsDrawCommand occlusionMode(@NotNull OcclusionMode occlusionMode)
      Determines how to show this set of icons in 3D in relation to other 3D data.

      Details and limitations:

      • Mode OcclusionMode#VisibleOnly shows only the part of the icon that is not obscured by other 3D data. This is the default.
      • Mode OcclusionMode#AlwaysVisible shows the entire icon even if it is behind other 3D data. The icon will appear in front of other objects.
      • Mode OcclusionMode#OccludedOnly shows only the part of the icon that is behind other 3D data. You typically use this to display obscured icons in combination with another style that uses OcclusionMode#VisibleOnly mode.
      • This parameter is only relevant in 3D. It is ignored on a 2D map.
      • This parameter is only applied to non-draped icons.

      Note that occlusion depends on layer ordering. For instance, a feature submitted with OcclusionMode#OccludedOnly will only be visible if it is occluded by other features belonging to layers painted before the layer with this feature.

      The default is OcclusionMode#VisibleOnly.

      Parameters:
      occlusionMode - the occlusion mode to use
      Returns:
      this IconsDrawCommand
    • submit

      public void submit() throws IllegalStateException
      Submits this draw command.

      Nothing will be painted if the draw command is not submitted.

      Throws:
      IllegalStateException - when there are missing icon command calls or the command is already submitted.