Skip To Content ArcGIS for Developers Sign In Dashboard

VectorMarkerSymbolElement Class

(Esri::ArcGISRuntime::VectorMarkerSymbolElement)

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

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

Public Functions

VectorMarkerSymbolElement(const Geometry &geometry, MultilayerSymbol *multilayerSymbol, QObject *parent = nullptr)
~VectorMarkerSymbolElement()
Geometry geometry() const
void setGeometry(const Geometry &geometry)
void setSymbol(MultilayerSymbol *multilayerSymbol)
MultilayerSymbol *symbol() const
  • 31 public functions inherited from QObject

Additional Inherited Members

Detailed Description

Vector marker symbol element comprises the pieces of a VectorMarkerSymbolLayer.

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 Geometry &geometry, MultilayerSymbol *multilayerSymbol, QObject *parent = nullptr)

Constructor taking geometry, multilayerSymbol and an optional parent.

VectorMarkerSymbolElement::~VectorMarkerSymbolElement()

Destructor.

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 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(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().

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().


Feedback on this topic?