CustomDynamicEntityDataSource QML Type

  • Esri.ArcGISRuntime
  • CustomDynamicEntityDataSource
  • A concrete dynamic entity data source that allows for implementing custom data feeds. More...

    Import Statement: import Esri.ArcGISRuntime
    Since: Esri.ArcGISRuntime 200.2
    Inherits:

    DynamicEntityDataSource

    Signals

    Methods

    Detailed Description

    The CustomDynamicEntityDataSource inherits from DynamicEntityDataSource but has additional capabilities to allow customizing how the data is read and provided.

    In your code, you must provide a few different handlers that will be called. For example:

    onConnectAsync: {
      // connect your data source to begin streaming/reading data
      // ...
    
      // call this method when you are done
      if (error)
        connectAsyncCompleted(errorMsg);
      else
        connectAsyncCompleted();
    }
    
    onDisconnectAsync: {
      // disconnect your data source to end streaming/reading data
      // ...
    
      // call this method when you are done
      if (error)
        disconnectAsyncCompleted(errorMsg);
      else
        disconnectAsyncCompleted();
    }
    
    onLoadAsync: {
      // read the metadata from your custom data source here.
      // ...
    
      // call this method when you are done
      if (error)
        loadAsyncCompleted(null, errorMsg);
      else
        loadAsyncCompleted(dynamicEntityDataSourceInfo);
    }

    This classes allows you to use custom data to drive a DynamicEntityLayer. This is a custom implementation of DynamicEntityDataSource.

    See also DynamicEntityDataSource.

    Signal Documentation

    connectAsync()

    Handles the connection process of a data source.

    Emitted to perform operations that initiate a connection and start the flow of data from an underlying data source. For instance, operations like connecting a websocket, opening a source file, or starting a polling timer are all operations that may be performed in this method.

    This signal is emitted by the ArcGIS Maps SDK when the connection is required. This can be due to an explicit call to connectDataSource or called implicitly when a layer that contains the data source needs to be rendered.

    Handler function must call connectAsyncCompleted method with userDefinedError if the connect operation fails. The error message is passed back to the data source and is available in the connectionError property.

    Note: The corresponding handler is onConnectAsync.


    disconnectAsync()

    Handles the disconnection process of a data source.

    Emitted to perform operations that stop the flow of data from an underlying data source.

    Handler function must call disconnectAsyncCompleted method with userDefinedError if the disconnect operation fails. The error message is passed back to the data source and is available in the connectionError property.

    Note: The corresponding handler is onDisconnectAsync.


    loadAsync()

    Handles the loading process of a data source and returns DynamicEntityDataSourceInfo}.

    Emitted to populate and return a DynamicEntityDataSourceInfo object. This object defines the schema and metadata used by the internal data cache of the DynamicEntityDataSource. If the returned DynamicEntityDataSourceInfo object does not contain all required values, the data source will fail to load and will not be usable.

    This signal is emitted by the ArcGIS Maps SDK when loading is required. This can be due to an explicit call to load the data source using load or called implicitly when a layer that contains the data source needs to be rendered.

    Handler function must call loadAsyncCompleted method with userDefinedError if the load operation fails. The error message is passed back to the data source and is available in the loadError property.

    Note: The corresponding handler is onLoadAsync.


    Method Documentation

    void connectAsyncCompleted(string userDefinedError)

    Must be called when the connection is finished.

    Sets userDefinedError if the connect operation fails. The error message is passed back to the data source and is available in the connectionError property.

    See also connectAsync.


    void disconnectAsyncCompleted(string userDefinedError)

    Must be called when the disconnection is finished.

    Sets userDefinedError if the disconnect operation fails. The error message is passed back to the data source and is available in the connectionError property.

    See also disconnectAsync.


    void loadAsyncCompleted(DynamicEntityDataSourceInfo info, string userDefinedError)

    Must be called when the loadAsync handler function is finished.

    Sets info if the load operation succeed. This object defines the schema and metadata used by the internal data cache of the DynamicEntityDataSource. If the returned DynamicEntityDataSourceInfo object does not contain all required values, the data source will fail to load and will not be usable.

    Sets userDefinedError if the load operation fails. The error message is passed back to the data source and is available in the loadError property.

    See also loadAsync.


    void setConnectionFailed(string userDefinedError, bool reconnect)

    Handles the error when the connection fails and may attempt to reconnect.

    • userDefinedError - The error that was encountered during connection failure.
    • reconnect - Indicates whether reconnection should be attempted after failure.

    Use this method when an established connection is interrupted. Pass the exception that caused the connection to fail and a flag that indicates whether to attempt reconnection.


    void setConnectionStatusAndError(Enums.ConnectionStatus status, string userDefinedError, bool reconnect)

    Sets the connection status and error.

    • status - The connection status.
    • userDefinedError - The user defined error.
    • reconnect - Indicates whether reconnection should be attempted.

    void setLoadInfoAndError(DynamicEntityDataSourceInfo dynamicEntityDataSourceInfo, string userDefinedError)

    Sets the load info object and error.

    • dynamicEntityDataSourceInfo - The metadata of the DynamicEntityDataSource.
    • userDefinedError - The user defined error.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.