GeometryEditorReticle Class

  • GeometryEditorReticle
  • class Esri::ArcGISRuntime::GeometryEditorReticle

    A visual aid displayed on the map view to allow precise editing of a geometry on a touch device, using a GeometryEditor. More...

    Header: #include <GeometryEditorReticle.h>
    Since: Esri::ArcGISRuntime 200.5
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    GeometryEditorReticle(QObject *parent = nullptr)
    virtual ~GeometryEditorReticle() override
    float height() const
    QImage image() const
    void setImage(const QImage &image)
    void setImageWithSize(const QImage &image, float width, float height)
    float width() const

    Detailed Description

    A GeometryEditorReticle is a visual aid displayed on the map view to help precise targeting on a map, separate to the interaction position. It is ideal for use on touch devices, as it can provide an alternative to a mouse hover, allowing you to see a precise position before you tap the screen. This can be especially useful for snapping (see SnapSettings) to allow you to see visual snapping feedback during vertex addition and moves, without fingers hiding the screen and the snapping feedback.

    The GeometryEditorReticle is displayed on a map view when:

    The reticle is displayed centered in the map view accounting for the current insets and attribution bar (GeoView::isAttributionTextVisible). The default image shows a crosshair with a rounded square border, with black and white lines to help the reticle be distinguished clearly over a variety of different basemaps and operational layers. To customize the appearance of the reticle in order to suit your specific app style, accessibility requirements, or to suit a specific basemap, call setImage(const QImage&), or setImageWithSize(const QImage&, float, float).

    To avoid potential confusion, when the GeometryEditorReticle is visible the magnifier will not appear, regardless of the value of MapView::isMagnifierEnabled. If a magnifier is already visible then it will be hidden when the reticle is displayed.

    See also ReticleVertexTool.

    Member Function Documentation

    [explicit] GeometryEditorReticle::GeometryEditorReticle(QObject *parent = nullptr)

    Creates a reticle that can be assigned to a ReticleVertexTool.

    • parent - The optional parent QObject.

    The reticle will have a default image, height, and width.

    This constructor can be used to reset the reticle of an existing ReticleVertexTool back to the default size and image.

    [override virtual] GeometryEditorReticle::~GeometryEditorReticle()

    Destructor.

    float GeometryEditorReticle::height() const

    Returns the height of the image displayed on the MapView in device-independent pixels (DIPs).

    If the image has been set using setImage(const QImage&), then this property returns a value of 0, and the image will be rendered using the size of the image.

    QImage GeometryEditorReticle::image() const

    Returns the image representing the Reticle to display on the MapView.

    The default image shows a crosshair with a rounded square border, displayed at the current height and width. You can customize the appearance of the reticle at any point, by calling setImage(const QImage&) or setImageWithSize(const QImage&, float, float).

    To reset a customized ReticleVertexTool::reticle back to the default size and image, set the property to a new GeometryEditorReticle.

    See also setImage(), height, and width.

    void GeometryEditorReticle::setImage(const QImage &image)

    Sets the image that should be used to display the reticle at the design size on the MapView.

    • image - Image to be used for the reticle.

    Use this method to change the reticle image to your own choice of image, using the physical pixel size of the given image. If you need to scale the image, use setImageWithSize(const QImage&, float, float) instead.

    The center of the image is used as the target position for edits, so bear this in mind when creating your own custom reticle images and ensure the edit position is clear to your users.

    Using a reticle image with large areas of transparent or semi-transparent pixels allows you to see sufficient areas of the map to give appropriate context for the edit.

    {setImageWithSize(const QImage&, float, float)}, {Esri::ArcGISRuntime::GeometryEditorReticle::height} {height}, {Esri::ArcGISRuntime::GeometryEditorReticle::width} {width}

    See also image() and Esri::ArcGISRuntime::GeometryEditorReticle::setImageWithSize(const QImage&, float, float).

    void GeometryEditorReticle::setImageWithSize(const QImage &image, float width, float height)

    Sets the image that should be used to display the reticle at a desired size on the MapView.

    • image - Image to be used for the reticle.
    • width - The desired width of the image when displayed in the MapView in DIPS.
    • height - The desired height of the image when displayed in the MapView in DIPs.

    The center of the image is used as the target position for edits, so bear this in mind when creating your own custom reticle images and ensure the edit position is clear to your users. The image should be designed to avoid obscuring too much of the map and the geometry editor feedback, for example by using large areas of transparent or semi-transparent pixels.

    See also setImage(const QImage&), height, and width.

    float GeometryEditorReticle::width() const

    Returns the width of the image displayed on the MapView in device-independent pixels (DIPs).

    If the image has been set using setImage(const QImage&), then this property returns a value of 0, and the image will be rendered using the size of the image.

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