@magiclane/maps-sdk
    Preparing search index...

    Class DataSource

    SensorDataSource Through this interface data can be obtained from sensors, log files or any other means

    Hierarchy

    • GemAutoreleaseObject
      • DataSource
    Index

    Accessors

    • get availableDataTypes(): DataType[]

      The available data types.

      Returns DataType[]

      The available data types.

    • get dataSourceType(): DataSourceType

      The data source type

      Returns DataSourceType

      DataSourceType.live if the data source is live or external, DataSourceType.playback if the data source is playback or simulate

    • get isSDKInstance(): boolean

      Test if this is an SDK instance

      Returns boolean

      True if the interface is an SDK instance, false otherwise

    • get isStopped(): boolean

      Check if source is paused

      Returns boolean

      True if stopped, false if not.

    • get origin(): Origin

      The origin of the data source

      Returns Origin

      The origin of the data source

    • get playback(): Playback | null

      Get the playback interface

      Returns Playback | null

      The playback listener object if available, null otherwise

    • get pointerId(): number

      Returns number

    Methods

    • Register a listener for the data source

      Parameters

      Returns GemError

      GemError.success on success, other GemError values on failure

    • Returns void

    • The data type description

      Parameters

      • type: DataType

        The data type for which the description is requested.

      Returns string

      The description of the data type.

    • Get the latest produced data for a data type

      Parameters

      • type: DataType

        The data type for which the data is requested.

      Returns SenseData | null

      The latest produced data or null if not available

    • Test if a data type is provided by the data source.

      Parameters

      Returns boolean

      True if the data type is available, false otherwise.

    • Check if mock data is enabled for the given type

      Parameters

      Returns boolean

      True if the data is mocked, false otherwise

    • Push the data to the data source

      Parameters

      Returns boolean

      True if the push data type is available, false otherwise

    • Registers an object for auto release. When the object is not used anymore, it will be released automatically from C++.

      Parameters

      • pointerId: any

        The pointer ID to register

      Returns void

    • Unregister a listener for the data source for a specific data type

      Parameters

      • listener: DataSourceListener

        The listener to be unregistered

      • dataType: DataType

        The data type for which the listener will be unregistered

      Returns GemError

      GemError.success on success, other GemError values on failure

    • Unregister all listeners for the data source for all data types

      Parameters

      Returns void

    • Set mock position data

      Parameters

      Returns GemError

      GemError.success on success, GemError.notSupported if not supported, other GemError values on failure

    • Start the source

      Returns GemError

      GemError.success on success, other GemError values on failure

    • Stop the source

      Returns GemError

      GemError.success on success, other GemError values on failure

    • Create a new external data source

      Parameters

      • dataTypes: DataType[]

        List of available data types for this data source. It is mandatory to provide DataType.position within the dataTypes list.

      Returns DataSource | null

      The created DataSource or null if failed

    • Create a new live data source

      Returns DataSource | null

      The created DataSource or null if failed

    • Create a new log data source based on a log file

      Parameters

      • logPath: string

        The log file path. The log file should not be a .gm file. Other formats such as .gpx are supported.

      Returns DataSource | null

      The created DataSource or null if failed

    • Create a data source based on a route (a route simulation data source).

      Parameters

      • route: Route

        The route used for generating data source data.

      Returns DataSource | null

      The created DataSource or null if failed

    • Parameters

      • id: number

      Returns DataSource