A GeoElement that represents a real-world object received from a DynamicEntityDataSource. More...
Header: | #include <DynamicEntity.h> |
Since: | Esri::ArcGISRuntime 200.1 |
Inherits: | Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::GeoElement |
Public Functions
virtual | ~DynamicEntity() override |
quint64 | entityId() const |
Esri::ArcGISRuntime::DynamicEntityObservation * | latestObservation() const |
QList<Esri::ArcGISRuntime::DynamicEntityObservation *> | observations(int maximumObservations) const |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::AttributeListModel * | attributes() const override |
virtual Esri::ArcGISRuntime::Geometry | geometry() const override |
virtual void | setGeometry(const Esri::ArcGISRuntime::Geometry &geometry) override |
Signals
void | dynamicEntityChanged(Esri::ArcGISRuntime::DynamicEntityChangedInfo *changedInfo) |
void | geometryChanged() |
Detailed Description
Dynamic entities are updated with data coming from a stream. These updates are referred to as observations and are represented by the DynamicEntityObservation class. An observation is a static snapshot of the state of a dynamic entity at a given time. This snapshot includes the associated dynamic entity's location (geometry) as well as all its attributes. For example, an observation for a moving aircraft may include updates to attributes like speed, altitude, and heading in addition to its updated location. While observations remain static, a dynamic entity changes because it's essentially a pointer to the most recent observation.
The properties of a DynamicEntity, such as its attributes and geometry, are updated when new observations are received from the server. You should not cache the geometry or attributes collection properties as they are completely replaced when a new observation is received for the associated DynamicEntity.
Relevant samples:
- Add custom dynamic entity data source: Create a custom dynamic entity data source and display it using a dynamic entity layer.
- Add dynamic entity layer: Display data from an ArcGIS stream service using a dynamic entity layer.
See also DynamicEntityLayer.
Member Function Documentation
[override virtual]
DynamicEntity::~DynamicEntity ()
Destructor.
[override virtual]
Esri::ArcGISRuntime::AttributeListModel *DynamicEntity::attributes() const
Reimplements: GeoElement::attributes() const.
Returns the attributes of the GeoElement as a collection of name/value pairs.
[signal]
void DynamicEntity::dynamicEntityChanged (Esri::ArcGISRuntime::DynamicEntityChangedInfo *changedInfo )
Notification that DynamicEntity has changed.
- changedInfo - a new DynamicEntityChangedInfo with the details of the event.
Note: Please use RAII techniques to ensure this object is cleaned up after you are done with it. This could be a high frequency event, depending on your data source. The DynamicEntity will be the QObject parent of the changedInfo object.
This signal will be a no-op if you are not connected to it. No DynamicEntityChangedInfo objects will be created until this signal is connected.
See also DynamicEntityChangedInfo and Returned QObjects Parenting.
quint64 DynamicEntity::entityId () const
Returns a unique identifier for the DynamicEntity.
The entityId property uniquely identifies a DynamicEntity.
[override virtual]
Esri::ArcGISRuntime::Geometry DynamicEntity::geometry() const
Reimplements: GeoElement::geometry() const.
Returns the geometry defines the shape and location of the GeoElement.
See also setGeometry().
[signal]
void DynamicEntity::geometryChanged ()
Signal emitted when the geometry is changed.
See also GeoElement.
Esri::ArcGISRuntime::DynamicEntityObservation *DynamicEntity::latestObservation () const
Returns the latest DynamicEntityObservation associated with this dynamic entity.
The observation returned by this method represents a snapshot of the state of this dynamic entity at the time the observation was received. This method may return nullptr
if the dynamic entity has been purged from the local data cache.
See also DynamicEntityDataSourcePurgeOptions.
QList<Esri::ArcGISRuntime::DynamicEntityObservation *> DynamicEntity::observations(int maximumObservations ) const
Returns the collection of DynamicEntityObservation objects associated with this dynamic entity.
- maximumObservations - The maximum number of observations to return, including the latest. The default value is -1, which returns all available observations.
Use this method to get a collection of DynamicEntityObservation objects associated with this dynamic entity. Observations are associated with a dynamic entity through a shared track ID. For ArcGISStreamService data sources, the track ID field is defined by the ArcGISStreamServiceInfo::trackIdField property.
The returned observations are sorted from the most recent to the oldest.
This method may return an empty collection if the dynamic entity has been purged from the local data cache.
See also ArcGISStreamServiceInfo and DynamicEntityDataSourcePurgeOptions.
[override virtual]
void DynamicEntity::setGeometry (const Esri::ArcGISRuntime::Geometry &geometry)
Reimplements: GeoElement::setGeometry(const Esri::ArcGISRuntime::Geometry &geometry).
Sets the geometry to geometry.
See also geometry.