- All Implemented Interfaces:
LayerContent
,Loadable
,PopupSource
Layer
that displays dynamic entity observations from real-time services.
A dynamic entity layer consumes DynamicEntityObservation
objects streamed from
a DynamicEntityDataSource
. A DynamicEntityDataSource
must be passed to
the constructor of the layer. The layer manages the display of observations as they are added to or removed from the
data source's local cache.
A dynamic entity layer's TrackDisplayProperties
allow you to control the display of previous observations by
setting a maximum number of observations to show, displaying a line that connects them (track line), and applying
renderers to the observations and/or track line.
As with other layers in the ArcGIS Maps SDK, display properties are managed with renderers. In the dynamic entity layer, three renderers are used to control display of observations:
-
rendererProperty()
: the main renderer property inherited fromLayer
is used to control the display of the latest observation in a track. All renderer types are supported. -
TrackDisplayProperties.previousObservationRendererProperty()
: used to control the display of previous observations in a track. All renderer types are supported. -
TrackDisplayProperties.trackLineRendererProperty()
: used to control the display of the track line between observations. All renderer types are supported; however, the track line attributes collection includes only the entity ID attribute that uniquely identifies the track. This attribute can be used to highlight a specific track using one of the attribute-based renderers.
Layer
labeling API. Labels only
appear on the latest observation in a track and are not placed on previous observations.
The dynamic entity layer has methods for selecting or unselecting dynamic entities and observations in the display.
When selecting a dynamic entity, the selection moves with the entity (the selection halo moves to the
latest observation in the track) as new observations are received from the stream. Since observations are static,
selected observations appear like any static GeoElement
on the display.
Dynamic entity layer also supports identify behavior in a map view or scene view. Be aware that the identify results
from this layer consist entirely of DynamicEntityObservation
objects. Use the
DynamicEntityObservation.dynamicEntity()
method to retrieve the
DynamicEntity
that the identified observation is associated with.
- Since:
- 200.1.0
-
Property Summary
TypePropertyDescriptionThe dynamic entity data source.True if labels should be displayed, false otherwise.TheRenderer
used to display the latest observation of dynamic entities.The scene properties for the dynamic entity layer.The track display properties.Properties inherited from class com.esri.arcgisruntime.layers.Layer
loadError, loadStatus
-
Constructor Summary
ConstructorDescriptionDynamicEntityLayer
(DynamicEntityDataSource dataSource) Creates a new dynamic entity layer from aDynamicEntityDataSource
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all selected dynamic entities and observations.The dynamic entity data source.Gets the value of thedataSource
property.Gets the collection ofLabelDefinition
objects for this layer.Gets the PopupDefinition that is currently defined or set on the entity.Gets the value of therenderer
property.Gets the value of thesceneProperties
property.Gets the value of thetrackDisplayProperties
property.boolean
Gets the value of thelabelsEnabled
property.boolean
Checks if the pop-up definition returned fromPopupSource.getPopupDefinition()
is enabled or disabled.True if labels should be displayed, false otherwise.TheRenderer
used to display the latest observation of dynamic entities.The scene properties for the dynamic entity layer.void
selectDynamicEntities
(Iterable<DynamicEntity> dynamicEntities) Selects the specified dynamic entities.void
selectDynamicEntity
(DynamicEntity dynamicEntity) Selects the given dynamic entity and adds it to the current list of selected dynamic entities.void
selectDynamicEntityObservation
(DynamicEntityObservation dynamicEntityObservation) Selects the given dynamic entity observation and adds it to the current list of selected observations.void
selectDynamicEntityObservations
(Iterable<DynamicEntityObservation> dynamicEntityObservations) Selects the given dynamic entity observations and adds them to the current list of selected observations.Gets all selected dynamic entities.Gets all selected dynamic entity observations.void
setLabelsEnabled
(boolean labelsEnabled) Sets the value of thelabelsEnabled
property.void
setPopupDefinition
(PopupDefinition popupDefinition) Sets a new PopupDefinition on the entity, overriding any previously existing one.void
setPopupEnabled
(boolean isPopupEnabled) Sets whether the pop-up definition returned fromPopupSource.getPopupDefinition()
is enabled or disabled.void
setRenderer
(Renderer renderer) Sets the value of therenderer
property.The track display properties.void
unselectDynamicEntities
(Iterable<DynamicEntity> dynamicEntities) Unselects the specified dynamic entities and removes them from the current list of selected dynamic entities.void
unselectDynamicEntity
(DynamicEntity dynamicEntity) Unselects the given dynamic entity and removes it from the current list of selected dynamic entities.void
unselectDynamicEntityObservation
(DynamicEntityObservation dynamicEntityObservation) Unselects the given dynamic entity observation and removes it from the current list of selected observations.void
unselectDynamicEntityObservations
(Iterable<DynamicEntityObservation> dynamicEntityObservations) Unselects the given dynamic entity observations and removes them from the current list of selected observations.Methods inherited from class com.esri.arcgisruntime.layers.Layer
addDoneLoadingListener, addLoadStatusChangedListener, addVisibilityChangedListener, cancelLoad, canChangeVisibility, canShowInLegend, fetchLegendInfosAsync, getAttribution, getDescription, getFullExtent, getId, getItem, getLoadError, getLoadStatus, getMaxScale, getMinScale, getName, getOpacity, getSpatialReference, getSubLayerContents, isIdentifyEnabled, isVisible, isVisibleAtScale, loadAsync, loadErrorProperty, loadStatusProperty, removeDoneLoadingListener, removeLoadStatusChangedListener, removeVisibilityChangedListener, retryLoadAsync, setCanShowInLegend, setDescription, setId, setMaxScale, setMinScale, setName, setOpacity, setVisible
-
Property Details
-
dataSource
The dynamic entity data source.- Since:
- 200.1.0
- See Also:
-
labelsEnabled
True if labels should be displayed, false otherwise.Dynamic entity layer supports labeling only on the latest observation of a track.
- Since:
- 200.1.0
- See Also:
-
renderer
TheRenderer
used to display the latest observation of dynamic entities.- Since:
- 200.1.0
- See Also:
-
sceneProperties
The scene properties for the dynamic entity layer.- Since:
- 200.1.0
- See Also:
-
trackDisplayProperties
The track display properties.TrackDisplayProperties
allow you to control the display of previous observations in a track by setting a maximum number of observations to show, displaying a line that connects them (track line), and applying renderers to the observations and/or track line.- Since:
- 200.1.0
- See Also:
-
-
Constructor Details
-
DynamicEntityLayer
Creates a new dynamic entity layer from aDynamicEntityDataSource
.- Parameters:
dataSource
- aDynamicEntityDataSource
data source- Throws:
NullPointerException
- if dataSource is null- Since:
- 200.1.0
-
-
Method Details
-
dataSourceProperty
The dynamic entity data source.- Returns:
- the
dataSource
property - Since:
- 200.1.0
- See Also:
-
getDataSource
Gets the value of thedataSource
property.- Property description:
- The dynamic entity data source.
- Returns:
- the value of the
dataSource
property - Since:
- 200.1.0
- See Also:
-
getLabelDefinitions
Gets the collection ofLabelDefinition
objects for this layer.Dynamic entity layer supports labeling only on the latest observation of a track.
- Returns:
- the collection of
LabelDefinition
objects for this layer - Since:
- 200.1.0
-
labelsEnabledProperty
True if labels should be displayed, false otherwise.Dynamic entity layer supports labeling only on the latest observation of a track.
- Returns:
- the
labelsEnabled
property - Since:
- 200.1.0
- See Also:
-
isLabelsEnabled
public boolean isLabelsEnabled()Gets the value of thelabelsEnabled
property.- Property description:
- True if labels should be displayed, false otherwise.
Dynamic entity layer supports labeling only on the latest observation of a track.
- Returns:
- the value of the
labelsEnabled
property - Since:
- 200.1.0
- See Also:
-
setLabelsEnabled
public void setLabelsEnabled(boolean labelsEnabled) Sets the value of thelabelsEnabled
property.- Property description:
- True if labels should be displayed, false otherwise.
Dynamic entity layer supports labeling only on the latest observation of a track.
- Parameters:
labelsEnabled
- the value for thelabelsEnabled
property- Since:
- 200.1.0
- See Also:
-
rendererProperty
TheRenderer
used to display the latest observation of dynamic entities.- Returns:
- the
renderer
property - Since:
- 200.1.0
- See Also:
-
getRenderer
Gets the value of therenderer
property.- Property description:
- The
Renderer
used to display the latest observation of dynamic entities. - Returns:
- the value of the
renderer
property - Since:
- 200.1.0
- See Also:
-
setRenderer
Sets the value of therenderer
property.- Property description:
- The
Renderer
used to display the latest observation of dynamic entities. - Parameters:
renderer
- the value for therenderer
property- Since:
- 200.1.0
- See Also:
-
scenePropertiesProperty
The scene properties for the dynamic entity layer.- Returns:
- the
sceneProperties
property - Since:
- 200.1.0
- See Also:
-
getSceneProperties
Gets the value of thesceneProperties
property.- Property description:
- The scene properties for the dynamic entity layer.
- Returns:
- the value of the
sceneProperties
property - Since:
- 200.1.0
- See Also:
-
trackDisplayPropertiesProperty
The track display properties.TrackDisplayProperties
allow you to control the display of previous observations in a track by setting a maximum number of observations to show, displaying a line that connects them (track line), and applying renderers to the observations and/or track line.- Returns:
- the
trackDisplayProperties
property - Since:
- 200.1.0
- See Also:
-
getTrackDisplayProperties
Gets the value of thetrackDisplayProperties
property.- Property description:
- The track display properties.
TrackDisplayProperties
allow you to control the display of previous observations in a track by setting a maximum number of observations to show, displaying a line that connects them (track line), and applying renderers to the observations and/or track line. - Returns:
- the value of the
trackDisplayProperties
property - Since:
- 200.1.0
- See Also:
-
clearSelection
public void clearSelection()Clears all selected dynamic entities and observations.Use this method to clear the list of selected
DynamicEntity
andDynamicEntityObservation
objects and clear the visible selection halos from the map or scene view.- Since:
- 200.1.0
-
selectedDynamicEntities
Gets all selected dynamic entities.- Returns:
- a
List
ofDynamicEntity
- Since:
- 200.1.0
-
selectedDynamicEntityObservations
Gets all selected dynamic entity observations.- Returns:
- a
List
ofDynamicEntityObservation
- Since:
- 200.1.0
-
selectDynamicEntities
Selects the specified dynamic entities.Selecting a
DynamicEntity
does the following:- adds the dynamic entity to the current list of selected dynamic entities.
- adds a visual selection halo around the latest observation of the dynamic entity. The selection halo is always placed on the latest observation of the dynamic entity, so the selection halo moves as new observations are received for the dynamic entity.
- Parameters:
dynamicEntities
- the dynamic entities to select- Throws:
NullPointerException
- if dynamicEntities is null- Since:
- 200.1.0
-
selectDynamicEntity
Selects the given dynamic entity and adds it to the current list of selected dynamic entities.Selecting a
DynamicEntity
does the following:- adds the dynamic entity to the current list of selected dynamic entities.
- adds a visual selection halo around the latest observation of the dynamic entity. The selection halo is always placed on the latest observation of the dynamic entity, so the selection halo moves as new observations are received for the dynamic entity.
- Parameters:
dynamicEntity
- the dynamic entity to select- Throws:
NullPointerException
- if dynamicEntity is null- Since:
- 200.1.0
-
selectDynamicEntityObservation
Selects the given dynamic entity observation and adds it to the current list of selected observations.Selecting a
DynamicEntityObservation
does the following:- adds the
DynamicEntityObservation
to the current list of selected dynamic entity observations. - adds a visual selection halo around the static
DynamicEntityObservation
.
selectDynamicEntity(DynamicEntity)
to achieve dynamic selection of the latest observation in a track.- Parameters:
dynamicEntityObservation
- the dynamic entity observation to select- Throws:
NullPointerException
- if dynamicEntityObservation is null- Since:
- 200.1.0
- adds the
-
selectDynamicEntityObservations
public void selectDynamicEntityObservations(Iterable<DynamicEntityObservation> dynamicEntityObservations) Selects the given dynamic entity observations and adds them to the current list of selected observations.Selecting a
DynamicEntityObservation
does the following:- adds the
DynamicEntityObservation
to the current list of selected dynamic entity observations. - adds a visual selection halo around the static
DynamicEntityObservation
.
selectDynamicEntity(DynamicEntity)
to achieve dynamic selection of the latest observation in a track.- Parameters:
dynamicEntityObservations
- the dynamic entity observations to select- Throws:
NullPointerException
- if dynamicEntityObservations is null- Since:
- 200.1.0
- adds the
-
unselectDynamicEntities
Unselects the specified dynamic entities and removes them from the current list of selected dynamic entities.- Parameters:
dynamicEntities
- the dynamic entities to remove from the selection- Throws:
NullPointerException
- if dynamicEntities is null- Since:
- 200.1.0
-
unselectDynamicEntity
Unselects the given dynamic entity and removes it from the current list of selected dynamic entities.- Parameters:
dynamicEntity
- the dynamic entity to be unselected- Throws:
NullPointerException
- if dynamicEntity is null- Since:
- 200.1.0
-
unselectDynamicEntityObservation
Unselects the given dynamic entity observation and removes it from the current list of selected observations.- Parameters:
dynamicEntityObservation
- the dynamic entity observation to be unselected- Throws:
NullPointerException
- if dynamicEntityObservation is null- Since:
- 200.1.0
-
unselectDynamicEntityObservations
public void unselectDynamicEntityObservations(Iterable<DynamicEntityObservation> dynamicEntityObservations) Unselects the given dynamic entity observations and removes them from the current list of selected observations.- Parameters:
dynamicEntityObservations
- the dynamic entity observations to be unselected- Throws:
NullPointerException
- if dynamicEntityObservations is null- Since:
- 200.1.0
-
isPopupEnabled
public boolean isPopupEnabled()Description copied from interface:PopupSource
Checks if the pop-up definition returned fromPopupSource.getPopupDefinition()
is enabled or disabled.- Specified by:
isPopupEnabled
in interfacePopupSource
- Returns:
- true if the pop-up definition is enabled; false otherwise. Will return false if an error occurs.
- See Also:
-
setPopupEnabled
public void setPopupEnabled(boolean isPopupEnabled) Description copied from interface:PopupSource
Sets whether the pop-up definition returned fromPopupSource.getPopupDefinition()
is enabled or disabled.- Specified by:
setPopupEnabled
in interfacePopupSource
- Parameters:
isPopupEnabled
- true to enable the PopupDefinition; false otherwise- See Also:
-
getPopupDefinition
Description copied from interface:PopupSource
Gets the PopupDefinition that is currently defined or set on the entity.- Specified by:
getPopupDefinition
in interfacePopupSource
- Returns:
- the current PopupDefinition. Will return null if an error occurs or if the pop-up source is not associated with a pop-up definition.
- See Also:
-
setPopupDefinition
Description copied from interface:PopupSource
Sets a new PopupDefinition on the entity, overriding any previously existing one.- Specified by:
setPopupDefinition
in interfacePopupSource
- Parameters:
popupDefinition
- the PopupDefinition to set- See Also:
-