Class FeatureLayer
- All Implemented Interfaces:
AutoCloseable
Use FeatureLayer#newBuilder to create a feature layer instance.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringReturns the property name for theLayerEventthat is fired as a result of changing the layer'sDensitySettings.static final StringThe property name for theLayerEventthat is fired as a result of changing the layer's editable flag.static final StringThe property name for theLayerEventthat is fired as a result of changing the layer's labeled flag.static final StringThe property name for theLayerEventthat is fired as a result of changing the layer'sIFeaturePainter.static final StringThe property name for theLayerEventthat is fired as a result of changing the layer's queryable flag.Fields inherited from class com.luciad.layers.Layer
PropertyBusy, PropertyTitle, PropertyVisible -
Method Summary
Modifier and TypeMethodDescriptionReturns a new builder based on this layer instance.voidclose()booleanprotected voidfinalize()Returns the currently set density settings, ornullif density painting is not active.Returns the edit configuration if editing is supported, ornull.Returns the edit/create geometry provider for aFeature.Returns the loading strategy that is used.getModel()Returns the layer's model, which provides the features to present.Returns the layer's painter, which determines how the features are presented.Returns the query configuration, which specifies which feature to present at different map scales.inthashCode()booleanReturns whether this layer is editable.booleanReturns whether this layer displays labels.booleanReturns whether the features of this layer can be returned in theMap#queryFeaturesmethod.static FeatureLayer.BuilderReturns a new builder for creating aFeatureLayer.voidsetDensitySettings(DensitySettings densitySettings) Sets the layer's density settings.voidsetEditable(boolean editable) Sets whether this layer is editable.voidsetLabeled(boolean labeled) Sets whether this layer displays labels.voidsetPainter(IFeaturePainter featurePainter) Sets the layer's painter, which determines how the features are presented.voidsetQueryable(boolean queryable) Sets whether the features of this layer can be returned in theMap#queryFeaturesmethod.Methods inherited from class com.luciad.layers.Layer
addObserver, getId, getTitle, isBusy, isVisible, removeObserver, setTitle, setVisible
-
Field Details
-
PropertyEditable
The property name for theLayerEventthat is fired as a result of changing the layer's editable flag.- See Also:
-
PropertyLabeled
The property name for theLayerEventthat is fired as a result of changing the layer's labeled flag.- See Also:
-
PropertyQueryable
The property name for theLayerEventthat is fired as a result of changing the layer's queryable flag.- Since:
- 2023.1
- See Also:
-
PropertyPainter
The property name for theLayerEventthat is fired as a result of changing the layer'sIFeaturePainter.- Since:
- 2023.1
- See Also:
-
PropertyDensitySettings
Returns the property name for theLayerEventthat is fired as a result of changing the layer'sDensitySettings.- Since:
- 2024.1
- See Also:
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classLayer
-
newBuilder
Returns a new builder for creating aFeatureLayer.- Returns:
- a new builder for creating a
FeatureLayer.
-
asBuilder
Returns a new builder based on this layer instance.You can use this builder, for example, to create a copy of this layer.
Note that this function will not make copies of the used
IFeatureModelorIFeaturePainter, but use the same instances that are present on this layer. You need to make sure that these are thread-safe and can handle concurrent usage.Also note that observers will not be transferred to a new layer.
- Returns:
- a new builder based on this layer instance.
- Since:
- 2025.0
-
getModel
Returns the layer's model, which provides the features to present.- Returns:
- the layer's model, which provides the features to present.
-
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
IFeaturePainterthat was set using theFeatureLayer.Builder#paintermethod, or if that method was not called, it will replace the default feature painter.Limitation: This method currently only supports setting a new
IFeaturePainterwith the exact samelevel of detailsas 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 benull.- Throws:
NullPointerException- when the given feature painter isnullIllegalArgumentException- when the new painter has different detail levels than the previous painter- Since:
- 2023.1
-
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
Returns the edit configuration if editing is supported, ornull.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
Returns the edit/create geometry provider for aFeature.- Returns:
- the edit/create geometry provider for a
Feature. - See Also:
-
getDensitySettings
Returns the currently set density settings, ornullif density painting is not active.- Returns:
- the currently set density settings, or
nullif density painting is not active. - Since:
- 2024.1
-
setDensitySettings
Sets the layer's density settings.Can be set to
nullto deactivate density painting.When density painting is active, the color map in the density settings is used to determine the colors of shapes drawn by the
IFeaturePainter.- Parameters:
densitySettings- the density painting settings.- Since:
- 2024.1
- See Also:
-
isEditable
public boolean isEditable()Returns whether this layer is editable.A layer is editable if it has an
IFeatureEditConfigurationand 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
LayerEventis delivered to the observers with the property nameFeatureLayer#propertyEditable.This flag is checked by the
Editorwhen receiving events from theIFeatureEditCandidateProviderin conjunction with the model'sIFeatureModelUpdaterand the layer'sIFeatureEditConfiguration.This flag is true by default. This flag has no effect if the layer does not contain an
IFeatureEditConfigurationor if the model'sIFeatureModelUpdateris 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
IFeaturePaintershould also call theFeatureCanvas#drawLabelmethod 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 theMap#queryFeaturesmethod.- Returns:
- whether the features of this layer can be returned in the
Map#queryFeaturesmethod. - Since:
- 2023.1
-
setQueryable
public void setQueryable(boolean queryable) Sets whether the features of this layer can be returned in theMap#queryFeaturesmethod.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
SelectEventHandlerorHoverEventHandlerclasses. - there is a performance issue with the
Map#queryFeaturesmethod, 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 theMap#queryFeaturesmethod- Since:
- 2023.1
- you don't want features to be selected or set to the hovered state by the
-
getLoadingStrategy
Returns the loading strategy that is used.- Returns:
- the loading strategy that is used.
- Since:
- 2023.0.02
- See Also:
-
hashCode
public int hashCode() -
equals
-