Class DynamicEntityLayer

java.lang.Object
com.esri.arcgisruntime.layers.Layer
com.esri.arcgisruntime.layers.DynamicEntityLayer
All Implemented Interfaces:
LayerContent, Loadable, PopupSource

public final class DynamicEntityLayer extends Layer implements PopupSource
A 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 from Layer 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.
Labels in a dynamic entity layer are controlled through the inherited 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 Details

  • Constructor Details

  • Method Details

    • dataSourceProperty

      public ReadOnlyObjectProperty<DynamicEntityDataSource> dataSourceProperty()
      The dynamic entity data source.
      Returns:
      the dataSource property
      Since:
      200.1.0
      See Also:
    • getDataSource

      public DynamicEntityDataSource getDataSource()
      Gets the value of the dataSource property.
      Property description:
      The dynamic entity data source.
      Returns:
      the value of the dataSource property
      Since:
      200.1.0
      See Also:
    • getLabelDefinitions

      public List<LabelDefinition> getLabelDefinitions()
      Gets the collection of LabelDefinition 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

      public BooleanProperty 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 the labelsEnabled 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 the labelsEnabled 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 the labelsEnabled property
      Since:
      200.1.0
      See Also:
    • rendererProperty

      public ObjectProperty<Renderer> rendererProperty()
      The Renderer used to display the latest observation of dynamic entities.
      Returns:
      the renderer property
      Since:
      200.1.0
      See Also:
    • getRenderer

      public Renderer getRenderer()
      Gets the value of the renderer 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

      public void setRenderer(Renderer renderer)
      Sets the value of the renderer property.
      Property description:
      The Renderer used to display the latest observation of dynamic entities.
      Parameters:
      renderer - the value for the renderer property
      Since:
      200.1.0
      See Also:
    • scenePropertiesProperty

      public ReadOnlyObjectProperty<LayerSceneProperties> scenePropertiesProperty()
      The scene properties for the dynamic entity layer.
      Returns:
      the sceneProperties property
      Since:
      200.1.0
      See Also:
    • getSceneProperties

      public LayerSceneProperties getSceneProperties()
      Gets the value of the sceneProperties 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

      public ReadOnlyObjectProperty<TrackDisplayProperties> 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

      public TrackDisplayProperties getTrackDisplayProperties()
      Gets the value of the trackDisplayProperties 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 and DynamicEntityObservation objects and clear the visible selection halos from the map or scene view.

      Since:
      200.1.0
    • selectedDynamicEntities

      public List<DynamicEntity> selectedDynamicEntities()
      Gets all selected dynamic entities.
      Returns:
      a List of DynamicEntity
      Since:
      200.1.0
    • selectedDynamicEntityObservations

      public List<DynamicEntityObservation> selectedDynamicEntityObservations()
      Gets all selected dynamic entity observations.
      Returns:
      a List of DynamicEntityObservation
      Since:
      200.1.0
    • selectDynamicEntities

      public void selectDynamicEntities(Iterable<DynamicEntity> dynamicEntities)
      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

      public void selectDynamicEntity(DynamicEntity dynamicEntity)
      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

      public void selectDynamicEntityObservation(DynamicEntityObservation dynamicEntityObservation)
      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.
      Use 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
    • 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.
      Use 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
    • unselectDynamicEntities

      public void unselectDynamicEntities(Iterable<DynamicEntity> dynamicEntities)
      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

      public void unselectDynamicEntity(DynamicEntity dynamicEntity)
      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

      public void unselectDynamicEntityObservation(DynamicEntityObservation dynamicEntityObservation)
      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 from PopupSource.getPopupDefinition() is enabled or disabled.
      Specified by:
      isPopupEnabled in interface PopupSource
      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 from PopupSource.getPopupDefinition() is enabled or disabled.
      Specified by:
      setPopupEnabled in interface PopupSource
      Parameters:
      isPopupEnabled - true to enable the PopupDefinition; false otherwise
      See Also:
    • getPopupDefinition

      public PopupDefinition getPopupDefinition()
      Description copied from interface: PopupSource
      Gets the PopupDefinition that is currently defined or set on the entity.
      Specified by:
      getPopupDefinition in interface PopupSource
      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

      public void setPopupDefinition(PopupDefinition popupDefinition)
      Description copied from interface: PopupSource
      Sets a new PopupDefinition on the entity, overriding any previously existing one.
      Specified by:
      setPopupDefinition in interface PopupSource
      Parameters:
      popupDefinition - the PopupDefinition to set
      See Also: