Skip To Content ArcGIS for Developers Sign In Dashboard

MultilayerPolylineSymbol Class

(Esri::ArcGISRuntime::MultilayerPolylineSymbol)

A multi-layer polyline symbol. More...

Header: #include <MultilayerPolylineSymbol>
Since: Esri::ArcGISRuntime 100.2
Inherits: MultilayerSymbol

Public Functions

MultilayerPolylineSymbol(const QList<SymbolLayer *> &symbolLayers, QObject *parent = nullptr)
~MultilayerPolylineSymbol()
void setWidth(float width)
float width() const

Additional Inherited Members

Detailed Description

A multi-layer polyline symbol.

This is a polyline symbol with multiple layers. Each layer has its own properties, like width and dash patterns, that can be combined to create line symbols with special effects (a solid road with dashed pattern on top to show the center line, for example). These symbols are rendered with polyline geometry.

Note: Symbol layers in a multilayer symbol are in reverse order of how they appear in the JSON representation.

// in this multilayer symbol pseudocode json, the 'symbolLayers' ordered list of symbol
// layers contains a black solid stroke symbol layer followed by a red solid stroke symbol layer.
{ "symbolLayers": [{"type": "CIMSolidStroke", "color": "black"},{"type": "CIMSolidStroke", "color": "red"}],"type": "CIMPolylineSymbol" }

// this is the red solid stroke symbol layer, the reverse order from the json representation
auto* symbolLayerIndexZero = multilayerSymbol->symboLayers()->at(0);

// this is the black solid stroke symbol layer, the reverse order from the json representation
auto* symbolLayerIndexOne = multilayerSymbol->symboLayers()->at(1);

Member Function Documentation

MultilayerPolylineSymbol::MultilayerPolylineSymbol(const QList<SymbolLayer *> &symbolLayers, QObject *parent = nullptr)

Constructor that takes a list of symbolLayers and an optional parent.

This function was introduced in Esri::ArcGISRuntime 100.5.

MultilayerPolylineSymbol::~MultilayerPolylineSymbol()

Destructor.

void MultilayerPolylineSymbol::setWidth(float width)

Sets the width to width in device independent pixels (DIPs).

When getting the width from a multilayer polyline symbol, the value reported is the largest width of all the symbol layers it contains. The symbol width is updated when its symbol layer widths change (if there is a new largest layer width). When setting a new width at the polyline symbol level, the width of the largest symbol layer is given the provided value, and all the smaller layers are sized proportionately. An individual symbol layer can be given a specific width without affecting the other layers.

See also width().

float MultilayerPolylineSymbol::width() const

Returns the width in device independent pixels (DIPs).

See also setWidth.


Feedback on this topic?