Uses a color and marker shape to symbolize graphics and features that have point or multipoint geometry. More...
Header: | #include <SimpleMarkerSymbol.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::MarkerSymbol |
Public Functions
SimpleMarkerSymbol(QObject *parent = nullptr) | |
SimpleMarkerSymbol(Esri::ArcGISRuntime::SimpleMarkerSymbolStyle style, const QColor &color, float size, QObject *parent = nullptr) | |
virtual | ~SimpleMarkerSymbol() override |
QColor | color() const |
Esri::ArcGISRuntime::SimpleLineSymbol * | outline() const |
void | setColor(const QColor &color) |
void | setOutline(Esri::ArcGISRuntime::SimpleLineSymbol *outline) |
void | setSize(float size) |
void | setStyle(Esri::ArcGISRuntime::SimpleMarkerSymbolStyle style) |
float | size() const |
Esri::ArcGISRuntime::SimpleMarkerSymbolStyle | style() const |
Esri::ArcGISRuntime::MultilayerPointSymbol * | toMultilayerSymbol(QObject *parent = nullptr) const |
bool | operator!=(const Esri::ArcGISRuntime::SimpleMarkerSymbol &other) const |
bool | operator==(const Esri::ArcGISRuntime::SimpleMarkerSymbol &other) const |
Detailed Description
Simple marker symbols display graphics and features (collectively referred to as geoelements) using predefined markers such as circle and cross. These symbols can have an optional outline, which is defined as a SimpleLineSymbol.
Symbols describe how graphics and features look on a map. Different symbols are used with different geometry types. Instances of this class represent simple marker symbols. Marker symbols are used to display those graphics and features which are based on point or multipoint geometry. Simple marker symbols display simple, predefined markers such as circle, cross, and so on. In addition, the markers can have an optional outline, which is defined by a line symbol.
Example:
Create a SimpleMarkerSymbol and set its style, color, and size:
auto* simpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor(Qt::gray), 34.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.
- Apply unique values with alternate symbols: Apply a unique value with alternate symbols at different scales.
- Configure clusters: Add client side feature reduction on a point feature layer that is not pre-configured with clustering.
- Simple marker symbol: Show a simple marker symbol on a map.
- Simple renderer: Display common symbols for all graphics in a graphics overlay with a renderer.
See also Symbol.
Member Function Documentation
[explicit]
SimpleMarkerSymbol::SimpleMarkerSymbol (QObject *parent = nullptr)
Creates a simple marker symbol object.
- parent - The optional parent QObject.
The default values are:
- style - SimpleMarkerSymbolStyle::Circle
- size - 8.0
- color - gray
This is useful if the properties of the symbol are only known after the application is running.
SimpleMarkerSymbol::SimpleMarkerSymbol (Esri::ArcGISRuntime::SimpleMarkerSymbolStyle style, const QColor &color, float size, QObject *parent = nullptr)
Creates a simple marker symbol object with some initial values.
- style - Indicates the type of simple marker symbol to create.
- color - The color of the simple marker symbol.
- size - The size of the simple marker symbol.
- parent - The optional parent QObject.
[override virtual]
SimpleMarkerSymbol::~SimpleMarkerSymbol ()
Destructor.
QColor SimpleMarkerSymbol::color() const
Returns the color of the symbol.
See also setColor().
Esri::ArcGISRuntime::SimpleLineSymbol *SimpleMarkerSymbol::outline() const
Returns the outline of the symbol.
See also setOutline().
void SimpleMarkerSymbol::setColor (const QColor &color)
Sets the color of the symbol.
See also color().
void SimpleMarkerSymbol::setOutline (Esri::ArcGISRuntime::SimpleLineSymbol *outline)
Sets the outline of the symbol.
See also outline().
void SimpleMarkerSymbol::setSize (float size)
Sets the size of the symbol in device independent pixels (DIPs).
See also size().
void SimpleMarkerSymbol::setStyle (Esri::ArcGISRuntime::SimpleMarkerSymbolStyle style)
Sets the marker symbol's style.
See also style().
float SimpleMarkerSymbol::size() const
Returns the size of the symbol in device independent pixels (DIPs).
See also setSize().
Esri::ArcGISRuntime::SimpleMarkerSymbolStyle SimpleMarkerSymbol::style() const
Returns the style of the simple marker symbol, such as circle, cross, or diamond.
See also setStyle().
[since Esri::ArcGISRuntime 100.5]
Esri::ArcGISRuntime::MultilayerPointSymbol *SimpleMarkerSymbol::toMultilayerSymbol (QObject *parent = nullptr) const
Returns Multilayer point symbol generated from simple marker symbol with optional parent.
This method allows you to create complex and custom symbols with multiple layers of different type of symbology. Simple marker symbol provides a factory of shapes such as square, diamond, and cross. This method generates a MultilayerPointSymbol that contains a VectorMarkerSymbolLayer that has a VectorMarkerSymbolElement with a polygon representation of the simple marker symbol geometry.
Note: if no parent is specified, this SimpleMarkerSymbol will be the parent of the MultilayerPointSymbol.
This function was introduced in Esri::ArcGISRuntime 100.5.
[since Esri::ArcGISRuntime 200.2]
bool SimpleMarkerSymbol::operator!=(const Esri::ArcGISRuntime::SimpleMarkerSymbol &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 SimpleMarkerSymbol::operator==.
[since Esri::ArcGISRuntime 200.1]
bool SimpleMarkerSymbol::operator==(const Esri::ArcGISRuntime::SimpleMarkerSymbol &other) const
Returns tests if this simple marker symbol is equal to another simple marker symbol.
- other - The simple marker symbol to be compared.
This function was introduced in Esri::ArcGISRuntime 200.1.