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

    Class DriverBehaviour

    The driver behaviour class.

    Provides methods for starting, stopping, managing and getting driver behaviour analysis.

    Index

    Constructors

    • Create a new driver behaviour instance.

      Parameters

      • dataSource: DataSource

        The data source to use.

      • useMapMatch: boolean

        Whether to use map match or not.

      Returns DriverBehaviour

    Accessors

    • get pointerId(): number

      Returns number

    Methods

    • Returns void

    • Erase analysis older than the specified time.

      Parameters

      • time: Date

        The reference time.

      Returns void

      An exception if it fails.

    • Get all driver behavior analysis.

      Returns DriverBehaviourAnalysis[]

      A list of all driver behavior analysis.

      An exception if it fails.

    • Get an analysis constructed from all analysis from the specified time period.

      Parameters

      • startTime: Date

        The start time of the period.

      • endTime: Date

        The end time of the period.

      Returns DriverBehaviourAnalysis

      The combined analysis. Use DriverBehaviourAnalysis.isValid to check if the analysis is valid.

      An exception if it fails.

    • Get the instantaneous scores (related to the ongoing analysis).

      Returns DrivingScores

      The instantaneous scores.

      An exception if it fails.

    • Get the last analysis (most recent created).

      Returns DriverBehaviourAnalysis

      The last analysis. Use DriverBehaviourAnalysis.isValid to check if the analysis is valid.

      An exception if it fails.

    • Get the ongoing analysis.

      Returns DriverBehaviourAnalysis

      The ongoing analysis. Use DriverBehaviourAnalysis.isValid to check if the analysis is valid.

      An exception if it fails.

    • Start a new analysis.

      Returns boolean

      True if the analysis was started successfully, false otherwise.

      An exception if it fails.

    • Stop the current analysis and get its result.

      Returns DriverBehaviourAnalysis

      The analysis result if the analysis was stopped successfully, null otherwise.

      An exception if it fails.