CoordinateConversionController Class

CoordinateConversion view."> CoordinateConversionController Class | ArcGISQtToolkit 200.0
  • CoordinateConversionController
  • class Esri::ArcGISRuntime::Toolkit::CoordinateConversionController

    In MVC architecture, this is the controller for the corresponding CoordinateConversion view. More...

    Header: #include <CoordinateConversionController>
    Inherits: QObject

    Properties

    Public Functions

    CoordinateConversionController(QObject *parent = nullptr)
    virtual ~CoordinateConversionController() override
    Esri::ArcGISRuntime::Toolkit::GenericListModel *conversionResults() const
    Esri::ArcGISRuntime::Toolkit::GenericListModel *coordinateFormats() const
    Esri::ArcGISRuntime::Point currentPoint() const
    QObject *geoView() const
    bool inPickingMode() const
    QPointF screenCoordinate() const
    void setGeoView(QObject *geoView)
    void setInPickingMode(bool mode)
    void setZoomToDistance(double distance)
    double zoomToDistance() const

    Public Slots

    void addNewCoordinateResultForOption(Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption *option)
    void removeCoordinateResultAtIndex(int index)
    void setCurrentPoint(const Esri::ArcGISRuntime::Point &point)
    void setCurrentPoint(const QString &point, Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption *option)
    void setCurrentPoint(const QString &point, const Esri::ArcGISRuntime::SpatialReference &spatialReference, Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption *option)
    void zoomToCurrentPoint()

    Signals

    void currentPointChanged(const Esri::ArcGISRuntime::Point &point)
    void geoViewChanged()
    void inPickingModeChanged()
    void zoomToDistanceChanged()

    Detailed Description

    A CoordinateConversionController stores a single point, and 0 or more textual representations of this point in a variety of user-defined formats.

    CoordinateConversion also accepts a MapView or SceneView. This allows for:

    • The controller to zoom to the point's location on the GeoView.
    • The user to select the point with a mouse-event on the GeoView.
    • The controller to calculate the screen coordinate of the current point relative to the window containing the GeoView.

    Property Documentation

    [read-only] formats : QAbstractListModel* const

    List of all coordinate format objects held by this controller.

    Access functions:

    Esri::ArcGISRuntime::Toolkit::GenericListModel *coordinateFormats() const

    See also Esri::ArcGISRuntime::Toolkit::CoordinateConversionController::coordinateFormats().

    geoView : QObject*

    This property holds the geoview the controller is utilizing for interactions.

    Access functions:

    QObject *geoView() const
    void setGeoView(QObject *geoView)

    Notifier signal:

    See also Esri::ArcGISRuntime::Toolkit::CoordinateConversionController::geoView().

    inPickingMode : bool

    Flag stating whether this controller is listening for input events on the geoView.

    Access functions:

    bool inPickingMode() const
    void setInPickingMode(bool mode)

    Notifier signal:

    See also Esri::ArcGISRuntime::Toolkit::CoordinateConversionController::inPickingMode().

    [read-only] results : QAbstractListModel* const

    List of all conversion result objects held by this controller.

    Access functions:

    Esri::ArcGISRuntime::Toolkit::GenericListModel *conversionResults() const

    See also Esri::ArcGISRuntime::Toolkit::CoordinateConversionController::conversionResults().

    zoomToDistance : double

    Distance between camera and target point when performing a zoom.

    Access functions:

    double zoomToDistance() const
    void setZoomToDistance(double distance)

    Notifier signal:

    See also Esri::ArcGISRuntime::Toolkit::CoordinateConversionController::zoomToDistance().

    Member Function Documentation

    [invokable] CoordinateConversionController::CoordinateConversionController(QObject *parent = nullptr)

    Constructor.

    • parent owning parent object.

    Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

    [override virtual] CoordinateConversionController::~CoordinateConversionController()

    Destructor

    [slot] void CoordinateConversionController::addNewCoordinateResultForOption(Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption *option)

    Given option, generates a new result.

    A new CoordinateConversionResult is added to the list-model returned by coordinateResults. This result is tied to the conversion parameters as given by option.

    • option option to generate result for.

    Esri::ArcGISRuntime::Toolkit::GenericListModel *CoordinateConversionController::conversionResults() const

    Returns the list of textual representations of the current point in different formats.

    Internally, this is a GenericListModel with an elementType of CoordinateConversionResult.

    Note: Getter function for property results.

    Esri::ArcGISRuntime::Toolkit::GenericListModel *CoordinateConversionController::coordinateFormats() const

    Returns the known list of available coordinate conversion formats which can be consumed to generate different textual representations of the same point.

    Internally, this is a GenericListModel with an elementType of CoordinateConversionOption.

    Note: Getter function for property formats.

    [invokable] Esri::ArcGISRuntime::Point CoordinateConversionController::currentPoint() const

    Returns the current point. The current point represents the one point that all elements within the conversionResults list-model are tied to.

    Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

    See also setCurrentPoint().

    [signal] void CoordinateConversionController::currentPointChanged(const Esri::ArcGISRuntime::Point &point)

    Emitted when the currentPoint has changed. point represents the new point.

    QObject *CoordinateConversionController::geoView() const

    Returns the GeoView as a QObject.

    Note: Getter function for property geoView.

    See also setGeoView().

    [signal] void CoordinateConversionController::geoViewChanged()

    Emitted when the geoView has changed.

    Note: Notifier signal for property geoView.

    bool CoordinateConversionController::inPickingMode() const

    Returns whether this controller is actively listening for mouse events.

    When listening for mouse events, this controller will update the current point to whatever point is returned by a click event on the GeoView.

    Returns true if this controller is listening to mouse events on the GeoView.

    Note: Getter function for property inPickingMode.

    See also setInPickingMode().

    [signal] void CoordinateConversionController::inPickingModeChanged()

    Emitted when the inPickingMode property has changed.

    Note: Notifier signal for property inPickingMode.

    [slot] void CoordinateConversionController::removeCoordinateResultAtIndex(int index)

    Removes a given CoordinateConversionResult at index.

    This function is for deleting results in the list-model returned by coordinateResults.

    [invokable] QPointF CoordinateConversionController::screenCoordinate() const

    Converts the current point held by this controller as a 2D point relative to the current window.

    Returns the point returned by currentPoint as a screen coordinate.

    Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

    [slot] void CoordinateConversionController::setCurrentPoint(const Esri::ArcGISRuntime::Point &point)

    Set the current point to point. This updates all textual representations owned by this controller.

    • point new point to convert.

    See also currentPoint().

    [slot] void CoordinateConversionController::setCurrentPoint(const QString &point, Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption *option)

    Set the current point to point. Point is a string which will be converted as defined by the formatting hints given in option. This updates all textual representations owned by this controller.

    The SpatialReference is taken from the GeoView.

    If conversion fails this function is treated as a no-op.

    • point string representation of point.
    • option Option dictating hints on how to convert the string to a point.

    [slot] void CoordinateConversionController::setCurrentPoint(const QString &point, const Esri::ArcGISRuntime::SpatialReference &spatialReference, Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption *option)

    Set the current point to point. point is a string which will be converted as defined by the formatting hints given in option. This updates all textual representations owned by this controller.

    If conversion fails this function is treated as a no-op.

    • point string representation of point.
    • spatialReference An explicit SpatialReference for conversion.
    • option Option dictating hints on how to convert the string to a Point.

    void CoordinateConversionController::setGeoView(QObject *geoView)

    Set the GeoView object this Controller uses.

    Internally this is cast to a MapView or SceneView using qobject_cast, which is why the paremeter is of form QObject and not GeoView.

    • geoView Object which must inherit from GeoView* and QObject*.

    Note: Setter function for property geoView.

    See also geoView().

    void CoordinateConversionController::setInPickingMode(bool mode)

    Set whether the controller should actively be listening to mouse and/or touch events on the GeoView.

    • mode True for listening to mouse events, false for ignoring mouse events.

    Note: Setter function for property inPickingMode.

    See also inPickingMode.

    void CoordinateConversionController::setZoomToDistance(double distance)

    Set the zoomToDistance.

    • distance distance value in the units of the GeoView SpatialReference.

    Note: Setter function for property zoomToDistance.

    See also zoomToDistance.

    [slot] void CoordinateConversionController::zoomToCurrentPoint()

    Updates the GeoView camera to point to the current point's location on the map.

    See also zoomToDistance.

    double CoordinateConversionController::zoomToDistance() const

    Distance between camera and current point when zoomToCurrentPoint is invoked.

    If geoView is a SceneView, then this value represents the distance between the camera and the point returned by currentPoint when zoomToCurrentPoint is called.

    If geoView is a MapView, this value has no effect on zoom calculations.

    The distance is in the units of the GeoView SpatialReference.

    Defaults to 1500.

    Returns distance between current point and viewpoint camera.

    Note: Getter function for property zoomToDistance.

    See also setZoomToDistance().

    [signal] void CoordinateConversionController::zoomToDistanceChanged()

    Emitted when the zoomToDistance property has changed.

    Note: Notifier signal for property zoomToDistance.

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