Class FeatureLayer

java.lang.Object
com.luciad.layers.Layer
com.luciad.layers.features.FeatureLayer
All Implemented Interfaces:
AutoCloseable

public final class FeatureLayer extends Layer implements AutoCloseable
A layer for feature models.

Use FeatureLayer#newBuilder to create a feature layer instance.

  • Field Details

    • PropertyEditable

      public static final String PropertyEditable
      Returns the property name for the LayerEvent that is fired as a result of changing the layer's editable flag.
      See Also:
    • PropertyLabeled

      public static final String PropertyLabeled
      Returns the property name for the LayerEvent that is fired as a result of changing the layer's labeled flag.
      See Also:
    • PropertyQueryable

      public static final String PropertyQueryable
      Returns the property name for the LayerEvent that is fired as a result of changing the layer's queryable flag.
      Since:
      2023.1
      See Also:
    • PropertyPainter

      public static final String PropertyPainter
      Returns the property name for the LayerEvent that is fired as a result of changing the layer's IFeaturePainter.
      Since:
      2023.1
      See Also:
  • Method Details

    • finalize

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

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class Layer
    • newBuilder

      @NotNull public static FeatureLayer.Builder newBuilder()
      Returns a new builder for creating a FeatureLayer.
      Returns:
      a new builder for creating a FeatureLayer.
    • getModel

      @NotNull public IFeatureModel getModel()
      Returns the layer's model, which provides the features to present.
      Returns:
      the layer's model, which provides the features to present.
    • getPainter

      @NotNull public IFeaturePainter getPainter()
      Returns the layer's painter, which determines how the features are presented.
      Returns:
      the layer's painter, which determines how the features are presented.
    • setPainter

      public void setPainter(@NotNull IFeaturePainter featurePainter) throws NullPointerException, IllegalArgumentException
      Sets the layer's painter, which determines how the features are presented.

      It will replace the IFeaturePainter that was set using the FeatureLayer.Builder#painter method, or if that method was not called, it will replace the default feature painter.

      Limitation: This method currently only supports setting a new IFeaturePainter with the exact same level of details as the previous painter. If this is not the case, this method will throw an exception.

      Parameters:
      featurePainter - the feature painter used to paint the feature model. Cannot be null.
      Throws:
      NullPointerException - when the given feature painter is null
      IllegalArgumentException - when the new painter has different detail levels than the previous painter
      Since:
      2023.1
    • getQueryConfiguration

      @NotNull public FeatureQueryConfiguration getQueryConfiguration()
      Returns the query configuration, which specifies which feature to present at different map scales.
      Returns:
      the query configuration, which specifies which feature to present at different map scales.
    • getEditConfiguration

      @Nullable public IFeatureEditConfiguration getEditConfiguration()
      Returns the edit configuration if editing is supported, or null.

      Whether or not the layer can be edited by the user is controlled using setEditable.

      Returns:
      the edit configuration, if editing is supported.
      See Also:
    • getEditCreateGeometryProvider

      @NotNull public IFeatureGeometryProvider getEditCreateGeometryProvider()
      Returns the edit/create geometry provider for a Feature.
      Returns:
      the edit/create geometry provider for a Feature.
      See Also:
    • isEditable

      public boolean isEditable()
      Returns whether this layer is editable.

      A layer is editable if it has an IFeatureEditConfiguration and if the editable flag is set.

      Returns:
      whether this layer is editable.
      See Also:
    • setEditable

      public void setEditable(boolean editable)
      Sets whether this layer is editable.

      If the new value is different from the old one, a LayerEvent is delivered to the observers with the property name FeatureLayer#propertyEditable.

      This flag is checked by the Editor when receiving events from the IFeatureEditCandidateProvider in conjunction with the model's IFeatureModelUpdater and the layer's IFeatureEditConfiguration.

      This flag is true by default. This flag has no effect if the layer does not contain an IFeatureEditConfiguration or if the model's IFeatureModelUpdater is missing.

      Parameters:
      editable - the new value for this property
    • isLabeled

      public boolean isLabeled()
      Returns whether this layer displays labels.
      Returns:
      whether this layer displays labels.
    • setLabeled

      public void setLabeled(boolean labeled)
      Sets whether this layer displays labels.

      Note that in order for the layer to display labels, its IFeaturePainter should also call the FeatureCanvas#drawLabel method for its features. If not, no labels will be displayed, regardless of this setting.

      Parameters:
      labeled - true to enable labels.
    • isQueryable

      public boolean isQueryable()
      Returns whether the features of this layer can be returned in the Map#queryFeatures method.
      Returns:
      whether the features of this layer can be returned in the Map#queryFeatures method.
      Since:
      2023.1
    • setQueryable

      public void setQueryable(boolean queryable)
      Sets whether the features of this layer can be returned in the Map#queryFeatures method.

      The default is true.

      It is useful to set this property to false when:

      • you don't want features to be selected or set to the hovered state by the SelectEventHandler or HoverEventHandler classes.
      • there is a performance issue with the Map#queryFeatures method, for example for a layer with many features that don't need to be selected.
      Parameters:
      queryable - whether the features of this layer can be returned in the Map#queryFeatures method
      Since:
      2023.1
    • getLoadingStrategy

      @NotNull public FeatureLayerLoadingStrategy getLoadingStrategy()
      Returns the loading strategy that is used.
      Returns:
      the loading strategy that is used.
      Since:
      2023.0.02
      See Also: