Uses predefined patterns and colors to symbolize graphics and features that have polyline geometry. More...
Header: | #include <SimpleLineSymbol.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::LineSymbol |
Public Functions
SimpleLineSymbol(QObject *parent = nullptr) | |
SimpleLineSymbol(Esri::ArcGISRuntime::SimpleLineSymbolStyle style, const QColor &color, float width, QObject *parent = nullptr) | |
SimpleLineSymbol(Esri::ArcGISRuntime::SimpleLineSymbolStyle style, const QColor &color, float width, Esri::ArcGISRuntime::SimpleLineSymbolMarkerStyle markerStyle, Esri::ArcGISRuntime::SimpleLineSymbolMarkerPlacement markerPlacement, QObject *parent = nullptr) | |
virtual | ~SimpleLineSymbol() override |
Esri::ArcGISRuntime::SimpleLineSymbolMarkerPlacement | markerPlacement() const |
Esri::ArcGISRuntime::SimpleLineSymbolMarkerStyle | markerStyle() const |
void | setMarkerPlacement(Esri::ArcGISRuntime::SimpleLineSymbolMarkerPlacement markerPlacement) |
void | setMarkerStyle(Esri::ArcGISRuntime::SimpleLineSymbolMarkerStyle markerStyle) |
void | setStyle(Esri::ArcGISRuntime::SimpleLineSymbolStyle style) |
Esri::ArcGISRuntime::SimpleLineSymbolStyle | style() const |
Esri::ArcGISRuntime::MultilayerPolylineSymbol * | toMultilayerSymbol(QObject *parent = nullptr) const |
bool | operator!=(const Esri::ArcGISRuntime::SimpleLineSymbol &other) const |
bool | operator==(const Esri::ArcGISRuntime::SimpleLineSymbol &other) const |
Detailed Description
Simple line symbols display graphics using predefined line style patterns such as SimpleLineSymbolStyle::Solid, SimpleLineSymbolStyle::Dash, or SimpleLineSymbolStyle::Dot.
Symbols describe how graphics and features look on a map. Different symbols are used with different geometry types. Instances of this class represent simple line symbols. Line symbols are used to display graphics and features which are based on polyline geometries. Simple line symbols display predefined line style patterns such as solid, dash, dot, and so on.
Example:
Create a SimpleLineSymbol and set its style, color, and width:
auto* simpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle::Dash, QColor(Qt::green), 2.0, this);
Relevant samples:
- Add graphics with renderer: A renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style.
- Add graphics with symbols: Use a symbol style to display a graphic on a graphics overlay.
- Densify and generalize: A multipart geometry can be densified by adding interpolated points at regular intervals.
- Display a grid: Display coordinate system grids including Latitude/Longitude, MGRS, UTM and USNG on a map view. Also, toggle label visibility and change the color of grid lines and grid labels.
- Offline routing: This sample demonstrates how to solve a route on-the-fly using offline data.
- Symbolize a shapefile: Display a shapefile with custom symbology.
- Unique value renderer: Render features in a layer using a distinct symbol for each unique attribute value.
See also Symbol.
Member Function Documentation
[explicit]
SimpleLineSymbol::SimpleLineSymbol (QObject *parent = nullptr)
Creates a simple line symbol object.
- parent - The optional parent QObject.
The default values are:
- style - SimpleLineSymbolStyle::Solid
- LineSymbol::width - 1.0
- LineSymbol::color - gray
This is useful if the properties of the symbol are only known after the application is running.
SimpleLineSymbol::SimpleLineSymbol (Esri::ArcGISRuntime::SimpleLineSymbolStyle style, const QColor &color, float width, QObject *parent = nullptr)
Creates a simple line symbol object with a style, color and width.
- style - The type of simple line symbol to create.
- color - The color of the simple line symbol.
- width - The width of the simple line symbol.
- parent - The optional parent QObject.
[since Esri::ArcGISRuntime 100.2]
SimpleLineSymbol::SimpleLineSymbol (Esri::ArcGISRuntime::SimpleLineSymbolStyle style, const QColor &color, float width, Esri::ArcGISRuntime::SimpleLineSymbolMarkerStyle markerStyle , Esri::ArcGISRuntime::SimpleLineSymbolMarkerPlacement markerPlacement , QObject *parent = nullptr)
Creates a simple line symbol object with a style, color, width, and line end marker
- style - The type of simple line symbol to create.
- color - The color of the simple line symbol.
- width - The width of the simple line symbol.
- markerStyle - The style of simple line symbol end marker(s).
- markerPlacement - The placement of simple line symbol end marker(s).
- parent - The optional parent QObject.
Note: The SimpleLineSymbolMarkerStyle::Arrow marker style is not supported in 3D scenes with GraphicsRenderingMode::Dynamic graphics rendering mode. It will not render correctly.
This function was introduced in Esri::ArcGISRuntime 100.2.
[override virtual]
SimpleLineSymbol::~SimpleLineSymbol ()
Destructor.
[since Esri::ArcGISRuntime 100.2]
Esri::ArcGISRuntime::SimpleLineSymbolMarkerPlacement SimpleLineSymbol::markerPlacement () const
Returns the simple line symbol end marker placement of the simple line symbol.
This function was introduced in Esri::ArcGISRuntime 100.2.
See also setMarkerPlacement().
[since Esri::ArcGISRuntime 100.2]
Esri::ArcGISRuntime::SimpleLineSymbolMarkerStyle SimpleLineSymbol::markerStyle () const
Returns the simple line symbol end marker style of the simple line symbol.
This function was introduced in Esri::ArcGISRuntime 100.2.
See also setMarkerStyle().
[since Esri::ArcGISRuntime 100.2]
void SimpleLineSymbol::setMarkerPlacement (Esri::ArcGISRuntime::SimpleLineSymbolMarkerPlacement markerPlacement )
Sets the marker placement, which determines to which ends the markerStyle is applied, to markerPlacement.
This function was introduced in Esri::ArcGISRuntime 100.2.
See also markerPlacement().
[since Esri::ArcGISRuntime 100.2]
void SimpleLineSymbol::setMarkerStyle (Esri::ArcGISRuntime::SimpleLineSymbolMarkerStyle markerStyle )
Sets the end marker style of the line, which is applied to the ends of the line symbol, to markerStyle.
Note: The SimpleLineSymbolMarkerStyle::Arrow marker style is not supported in 3D scenes with GraphicsRenderingMode::Dynamic graphics rendering mode. It will not render correctly.
This function was introduced in Esri::ArcGISRuntime 100.2.
See also markerStyle.
void SimpleLineSymbol::setStyle (Esri::ArcGISRuntime::SimpleLineSymbolStyle style)
Sets the style of the line.
See also style().
Esri::ArcGISRuntime::SimpleLineSymbolStyle SimpleLineSymbol::style() const
Returns the style of the line.
See also setStyle().
[since Esri::ArcGISRuntime 100.5]
Esri::ArcGISRuntime::MultilayerPolylineSymbol *SimpleLineSymbol::toMultilayerSymbol (QObject *parent = nullptr) const
Returns Multilayer polyline symbol generated from simple line symbol.
- parent - The optional parent QObject.
This method allows you to create complex and custom symbols with multiple layers of different types of symbology. Simple line symbol provides a factory of predefined line styles such as dash and dash_dot_dot. This method generates a MultilayerPolylineSymbol with a SolidStrokeSymbolLayer and a predefined collection of DashGeometricEffect.
Note: if no parent is specified, this SimpleLineSymbol will be the parent of the MultilayerPolylineSymbol.
This function was introduced in Esri::ArcGISRuntime 100.5.
[since Esri::ArcGISRuntime 200.2]
bool SimpleLineSymbol::operator!=(const Esri::ArcGISRuntime::SimpleLineSymbol &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 SimpleLineSymbol::operator==.
[since Esri::ArcGISRuntime 200.1]
bool SimpleLineSymbol::operator==(const Esri::ArcGISRuntime::SimpleLineSymbol &other) const
Equivalency operator.
Returns true
if this object and other are equivalent.
This function was introduced in Esri::ArcGISRuntime 200.1.