Class FeatureLayer
- All Implemented Interfaces:
AutoCloseable
Use FeatureLayer#newBuilder
to create a feature layer instance.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Returns the property name for theLayerEvent
that is fired as a result of changing the layer's editable flag.static final String
Returns the property name for theLayerEvent
that is fired as a result of changing the layer's labeled flag.static final String
Returns the property name for theLayerEvent
that is fired as a result of changing the layer'sIFeaturePainter
.static final String
Returns the property name for theLayerEvent
that is fired as a result of changing the layer's queryable flag.Fields inherited from class com.luciad.layers.Layer
PropertyTitle, PropertyVisible
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
finalize()
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.boolean
Returns whether this layer is editable.boolean
Returns whether this layer displays labels.boolean
Returns whether the features of this layer can be returned in theMap#queryFeatures
method.static FeatureLayer.Builder
Returns a new builder for creating aFeatureLayer
.void
setEditable
(boolean editable) Sets whether this layer is editable.void
setLabeled
(boolean labeled) Sets whether this layer displays labels.void
setPainter
(IFeaturePainter featurePainter) Sets the layer's painter, which determines how the features are presented.void
setQueryable
(boolean queryable) Sets whether the features of this layer can be returned in theMap#queryFeatures
method.Methods inherited from class com.luciad.layers.Layer
addObserver, getId, getTitle, isVisible, removeObserver, setTitle, setVisible
-
Field Details
-
PropertyEditable
Returns the property name for theLayerEvent
that is fired as a result of changing the layer's editable flag.- See Also:
-
PropertyLabeled
Returns the property name for theLayerEvent
that is fired as a result of changing the layer's labeled flag.- See Also:
-
PropertyQueryable
Returns the property name for theLayerEvent
that is fired as a result of changing the layer's queryable flag.- Since:
- 2023.1
- See Also:
-
PropertyPainter
Returns the property name for theLayerEvent
that is fired as a result of changing the layer'sIFeaturePainter
.- Since:
- 2023.1
- See Also:
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classLayer
-
newBuilder
Returns a new builder for creating aFeatureLayer
.- Returns:
- a new builder for creating a
FeatureLayer
.
-
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
IFeaturePainter
that was set using theFeatureLayer.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 samelevel 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 benull
.- Throws:
NullPointerException
- when the given feature painter isnull
IllegalArgumentException
- 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:
-
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 nameFeatureLayer#propertyEditable
.This flag is checked by the
Editor
when receiving events from theIFeatureEditCandidateProvider
in conjunction with the model'sIFeatureModelUpdater
and the layer'sIFeatureEditConfiguration
.This flag is true by default. This flag has no effect if the layer does not contain an
IFeatureEditConfiguration
or if the model'sIFeatureModelUpdater
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 theFeatureCanvas#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 theMap#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 theMap#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
orHoverEventHandler
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 theMap#queryFeatures
method- 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:
-