VectorMarkerSymbolElement Class

  • VectorMarkerSymbolElement
  • class Esri::ArcGISRuntime::VectorMarkerSymbolElement

    Vector marker symbol element comprises the pieces of a VectorMarkerSymbolLayer. More...

    Header: #include <VectorMarkerSymbolElement.h>
    Since: Esri::ArcGISRuntime 100.5
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    VectorMarkerSymbolElement(const Esri::ArcGISRuntime::Geometry &geometry, Esri::ArcGISRuntime::MultilayerSymbol *multilayerSymbol, QObject *parent = nullptr)
    virtual ~VectorMarkerSymbolElement() override
    Esri::ArcGISRuntime::Geometry geometry() const
    void setGeometry(const Esri::ArcGISRuntime::Geometry &geometry)
    void setSymbol(Esri::ArcGISRuntime::MultilayerSymbol *multilayerSymbol)
    Esri::ArcGISRuntime::MultilayerSymbol *symbol() const

    Detailed Description

    Vector marker symbol element is a combination of a symbol and a geometry.

    The symbol held by the VectorMarkerSymbolElement is itself a MultilayerSymbol. The geometry of the VectorMarkerSymbolElement does not pertain to the geography of the Map or Scene. Rather, the geometry property describes the shape of the Multilayer_symbol held by the VectorMarkerSymbolElement. The coordinate values defining the geometry are in points. This behavior facilitates creating a custom VectorMarkerSymbolElement of custom shape and symbol, then combining it with zero or more other elements to form a vector marker.

    To create a red square, for example, construct a VectorMarkerSymbolElement with a MultilayerPolygonSymbol that contains a red SolidFillSymbolLayer and a square geometry. When combined in a VectorMarkerSymbolElement and placed in a VectorMarkerSymbolLayer a red square displays.

    For example,

    auto simpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle::Solid, QColor(Qt::red), this);
    auto symbolElementPolygon = new VectorMarkerSymbolElement(Geometry::fromJson("{\"rings\":[[[17,17],[17, 0],[0,0],[0,17]]]}"), simpleFillSymbol->toMultilayerSymbol(this), this);
    auto symbolLayer = new VectorMarkerSymbolLayer(QList<VectorMarkerSymbolElement*> {symbolElementPolygon}, this);
    auto symbol = new MultilayerPolygonSymbol(QList<SymbolLayer*> {symbolLayer}, this);

    The symbol and geometry properties must create a meaningful combination to have a visual effect. For example, a MultilayerPolygonSymbol does not draw anything if the corresponding geometry is a point, but does draw if the geometry is a polygon.

    When rendering, the symbol draws according to the shape of the geometry, which is defined relative to other elements in the layer. (The coordinates used to define element geometry are not in real units.)

    Member Function Documentation

    VectorMarkerSymbolElement::VectorMarkerSymbolElement(const Esri::ArcGISRuntime::Geometry &geometry, Esri::ArcGISRuntime::MultilayerSymbol *multilayerSymbol, QObject *parent = nullptr)

    Constructor taking geometry, multilayerSymbol and an optional parent.

    [override virtual] VectorMarkerSymbolElement::~VectorMarkerSymbolElement()

    Destructor.

    Esri::ArcGISRuntime::Geometry VectorMarkerSymbolElement::geometry() const

    Returns the geometry associated with the vector marker symbol element.

    The default value is an empty geometry. When rendering, the symbol draws according to the shape of the geometry.

    See also setGeometry().

    void VectorMarkerSymbolElement::setGeometry(const Esri::ArcGISRuntime::Geometry &geometry)

    Sets the geometry to geometry.

    The geometry can be a point, polyline, or polygon. When rendering, the symbol draws according to the shape of the geometry. When setting a geometry, make sure that the corresponding symbol is appropriate for the desired drawing effect. For instance, a polygon geometry would pair best with a MultilayerPolygonSymbol, drawing the symbol with the polygon geometry.

    See also geometry().

    void VectorMarkerSymbolElement::setSymbol(Esri::ArcGISRuntime::MultilayerSymbol *multilayerSymbol)

    Sets the symbol to multilayerSymbol.

    The symbol, a MultilayerSymbol, can be any arbitrary multilayer symbol. When rendering, the symbol draws according to the shape of the geometry. When setting a symbol, make sure that the corresponding geometry is appropriate for the desired drawing effect. For instance, a MultilayerPolygonSymbol would pair best with a polygon geometry, drawing the symbol with the polygon geometry.

    See also symbol().

    Esri::ArcGISRuntime::MultilayerSymbol *VectorMarkerSymbolElement::symbol() const

    Returns the symbol associated with the vector marker symbol element.

    The default value is nullptr. When rendering, the symbol draws according to the shape of the geometry.

    See also setSymbol().

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