MarkerSymbol Class

  • MarkerSymbol
  • class Esri::ArcGISRuntime::MarkerSymbol

    A base class for marker symbols used to display graphics and features (collectively referred to as geoelements) that have points or multipoint geometry. More...

    Header: #include <MarkerSymbol.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::Symbol
    Inherited By:

    Esri::ArcGISRuntime::PictureMarkerSymbol, Esri::ArcGISRuntime::SimpleMarkerSymbol, and Esri::ArcGISRuntime::TextSymbol

    Public Functions

    virtual ~MarkerSymbol() override
    float angle() const
    Esri::ArcGISRuntime::SymbolAngleAlignment angleAlignment() const
    float leaderOffsetX() const
    float leaderOffsetY() const
    float offsetX() const
    float offsetY() const
    void setAngle(float angle)
    void setAngleAlignment(Esri::ArcGISRuntime::SymbolAngleAlignment angleAlignment)
    void setLeaderOffsetX(float offset)
    void setLeaderOffsetY(float offset)
    void setOffsetX(float offset)
    void setOffsetY(float offset)
    bool operator!=(const Esri::ArcGISRuntime::MarkerSymbol &other) const
    bool operator==(const Esri::ArcGISRuntime::MarkerSymbol &other) const

    Protected Functions

    MarkerSymbol(QObject *parent = nullptr)

    Detailed Description

    Symbols describe how graphics and features look on a map. Different symbols are used with different geometry types. Marker symbols are used to display graphics and features that are based on point or multipoint geometries such as cities, a route destination, or fire hydrants. Subclasses of this class represent specific types of marker symbols such as SimpleMarkerSymbol, PictureMarkerSymbol, or TextSymbol.

    You can specify the following two types of offsets:

    • Offset the visible symbol from the symbol's point geometry.
    • Offset a callout's leader line from the symbol's point geometry.

    For each offset, you can specify an x-offset and a y-offset in device independent pixels (DIPs) using a Cartesian coordinate system. For example, if you specify a callout x-offset of -5.0, the callout's leader line will offset to the left along the x-axis by five points.

    By default, the center of a PictureMarkerSymbol::image is placed at the Point location. If the image is a pushpin, for example, you may want the needle of the pushpin to end at the Point location. In this situation, you need to offset the symbol to make the needle's end coincide with that Point location.

    You can control the rotation of the marker symbol using the angle. However, you must also consider whether this rotation is relative to the map or screen (angleAlignment).

    Member Function Documentation

    [explicit protected] MarkerSymbol::MarkerSymbol(QObject *parent = nullptr)

    Default constructor with an optional parent.

    [override virtual] MarkerSymbol::~MarkerSymbol()


    float MarkerSymbol::angle() const

    Returns the angle (in degrees) that the marker symbol is rotated by.

    The marker symbol can be rotated relative to the map or the screen, depending on the angleAlignment.

    See also setAngle().

    Esri::ArcGISRuntime::SymbolAngleAlignment MarkerSymbol::angleAlignment() const

    Returns whether the marker symbol is rotated relative to the screen or map.

    If the value is SymbolAngleAlignment::Map, the marker symbol is rotated relative to the map and will be affected by the map's rotation. If the value is SymbolAngleAlignment::Screen, the marker symbol is rotated relative to the user's screen and is unaffected by the map's rotation.

    When the GraphicsOverlay::renderingMode is GraphicsRenderingMode::Static, each MarkerSymbol is aligned with the MapView. If the MapView rotates, every marker symbol on the Map will stay in the same orientation as the MapView. Even if you set angle and angleAlignment, they are not respected when the GraphicsRenderingMode is set to static.

    When the GraphicsOverlay::renderingMode is set to GraphicsRenderingMode::Dynamic, each MarkerSymbol rotates independently of a MapView rotation. If you set angle and angleAlignment, they are respected.

    The default value is SymbolAngleAlignment::Screen.

    See also setAngleAlignment.

    float MarkerSymbol::leaderOffsetX() const

    Returns the callout leader's X offset relative to the marker symbol.

    See also setLeaderOffsetX().

    float MarkerSymbol::leaderOffsetY() const

    Returns the callout leader's Y offset relative to the marker symbol.

    See also setLeaderOffsetY().

    float MarkerSymbol::offsetX() const

    Returns the offset X of the marker symbol relative to the graphic or feature's point geometry.

    See also setOffsetX().

    float MarkerSymbol::offsetY() const

    Returns the offset Y of the marker symbol relative to the graphic or feature's point geometry.

    See also setOffsetY().

    void MarkerSymbol::setAngle(float angle)

    Sets the rotation angle (in degrees) for the symbol.

    A positive rotation will turn the symbol in a counter-clockwise direction

    Note: If the angle was set via the fromJson method, it will be inverted (e.g. an angle of 20 will become -20).

    See also angle().

    void MarkerSymbol::setAngleAlignment(Esri::ArcGISRuntime::SymbolAngleAlignment angleAlignment)

    Sets whether the symbol should rotate with the map or stay at the same angleAlignment with regards to the screen.

    Default is SymbolAngleAlignment::Map. Only supported for GraphicsOverlay using GraphicsRenderingMode::Dynamic.

    See also angleAlignment().

    void MarkerSymbol::setLeaderOffsetX(float offset)

    Sets the leaderOffsetX to offset.

    See also leaderOffsetX.

    void MarkerSymbol::setLeaderOffsetY(float offset)

    Sets the leaderOffsetY to offset.

    See also leaderOffsetY.

    void MarkerSymbol::setOffsetX(float offset)

    Sets the offsetX to offset.

    See also offsetX.

    void MarkerSymbol::setOffsetY(float offset)

    Sets the offsetY to offset.

    See also offsetY.

    [since Esri::ArcGISRuntime 200.2] bool MarkerSymbol::operator!=(const Esri::ArcGISRuntime::MarkerSymbol &other) const

    Inequality operator. Returns true if this object and other are not equal.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    See also MarkerSymbol::operator==.

    [since Esri::ArcGISRuntime 200.1] bool MarkerSymbol::operator==(const Esri::ArcGISRuntime::MarkerSymbol &other) const

    Returns tests if this marker symbol is equal to another marker symbol.

    • other - The marker symbol to be compared.

    This function was introduced in Esri::ArcGISRuntime 200.1.

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