DirectionManeuverListModel Class

  • DirectionManeuverListModel
  • class Esri::ArcGISRuntime::DirectionManeuverListModel

    A list model storing a list of DirectionManeuver for a Route. More...

    Header: #include <DirectionManeuverListModel.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: QAbstractListModel

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Types

    enum DirectionManeuverRoles { DirectionManeuverTypeRole, DirectionTextRole, DurationRole, EstimatedArrivalTimeRole, EstimatedArrivalTimeShiftRole, …, LengthRole }

    Public Functions

    virtual ~DirectionManeuverListModel() override
    QList<Esri::ArcGISRuntime::DirectionManeuver> directionManeuvers() const

    Reimplemented Public Functions

    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override

    Detailed Description

    Direction maneuvers give you a step-by-step explanation of how you would get from one location to another along a transportation network. Each direction maneuver contains information such as the description of what you should do (e.g. "Turn right on Main St"), the duration of that maneuver (e.g. 2 minutes), and the local arrival time. DirectionManeuverListModel is meant to simplify the workflow of obtaining direction maneuvers from a RouteResult, and populating the resulting information into a view. For example, you may want to get all of your route's direction maneuvers and display them in a list view for a user to scroll through. Since each direction maneuver contains geometry, you can zoom to each direction maneuver on the map as the user clicks on the different items in the list.

    The model returns data for the following roles:

    RoleTypeDescriptionDirectionManeuverRoles
    directionManeuverTypeDirectionManeuverTypeThe type of direction maneuver.DirectionManeuverTypeRole
    directionTextQStringThe step-by-step directions of the maneuver.DirectionTextRole
    durationdoubleThe duration of the maneuver in minutes.DurationRole
    estimatedArrivalTimeQDateTimeThe estimated arrival time in UTC time.EstimatedArrivalTimeRole
    estimatedArrivalTimeShiftdoubleThe time zone shift in minutes of the estimated arrival time.EstimatedArrivalTimeShiftRole
    geometryGeometryThe geometry of the maneuver, typically a Polyline or a Point.GeometryRole
    lengthdoubleThe length of the maneuver in meters.LengthRole

    See also RouteTask, Route, RouteResult, and DirectionManeuver.

    Member Type Documentation

    enum DirectionManeuverListModel::DirectionManeuverRoles

    This enum specifies the custom roles which can be used with DirectionManeuverListModel::data.

    ConstantValueDescription
    Esri::ArcGISRuntime::DirectionManeuverListModel::DirectionManeuverTypeRoleQt::UserRole + 1The type of direction maneuver.
    Esri::ArcGISRuntime::DirectionManeuverListModel::DirectionTextRoleQt::UserRole + 2The step-by-step directions of the maneuver.
    Esri::ArcGISRuntime::DirectionManeuverListModel::DurationRoleQt::UserRole + 3The duration of the maneuver in minutes.
    Esri::ArcGISRuntime::DirectionManeuverListModel::EstimatedArrivalTimeRoleQt::UserRole + 4The estimated arrival time in UTC time.
    Esri::ArcGISRuntime::DirectionManeuverListModel::EstimatedArrivalTimeShiftRoleQt::UserRole + 5The time zone shift in minutes of the estimated arrival time.
    Esri::ArcGISRuntime::DirectionManeuverListModel::GeometryRoleQt::UserRole + 6The geometry of the maneuver, typically a Polyline or a Point.
    Esri::ArcGISRuntime::DirectionManeuverListModel::LengthRoleQt::UserRole + 7The length of the maneuver in meters.

    Member Function Documentation

    [override virtual] DirectionManeuverListModel::~DirectionManeuverListModel()

    Destructor.

    [override virtual] QVariant DirectionManeuverListModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const

    Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.

    Returns the data stored under the given role for the maneuver referred to by the index.

    • index. The index in the model for which to return data.
    • role. The role for which to return data.

    QList<Esri::ArcGISRuntime::DirectionManeuver> DirectionManeuverListModel::directionManeuvers() const

    Returns the list of DirectionManeuver contained in the list model.

    Use this to directly obtain the list of DirectionManeuver objects, as opposed to hooking up the list model to a view.

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