Skip To Content ArcGIS for Developers Sign In Dashboard

Symbol Class

(Esri::ArcGISRuntime::Symbol)

Base type for symbols used to display a graphic or a feature. More...

Public Functions

~Symbol()
TaskWatcher createSwatch(const Geometry &geometry, float width, float height, const QColor &backgroundColor = QColor())
TaskWatcher createSwatch(const Geometry &geometry, float width, float height, float screenScale, const QColor &backgroundColor = QColor())
TaskWatcher createSwatch(float width, float height, float screenScale, const QColor &backgroundColor = QColor())
TaskWatcher createSwatch(const QColor &backgroundColor = QColor())
TaskWatcher createSwatch(float screenScale, const QColor &backgroundColor = QColor())
SymbolType symbolType() const
bool operator==(const Symbol *other) const

Reimplemented Public Functions

virtual QString toJson() const
virtual QJsonObject unknownJson() const
virtual QJsonObject unsupportedJson() const

Signals

void createSwatchCompleted(QUuid taskId, QImage image)

Static Public Members

Symbol *fromJson(const QString &json, QObject *parent = nullptr)
  • 10 static public members inherited from QObject

Protected Functions

Symbol(QObject *parent = nullptr)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

Base type for symbols used to display a graphic or a feature.

Symbols describe how graphics and features look on the map. Different symbols are used with different geometry types: marker symbols for point and multipoint geometries, fill symbols for polygon geometries, and line symbols for polyline geometries. Other types of 2D and 3D symbols inherit from Symbol and its subtypes to implement capabilities such as composite and dynamic symbols.

Member Function Documentation

[protected] Symbol::Symbol(QObject *parent = nullptr)

Default constructor with an optional parent.

Symbol::~Symbol()

Destructor.

TaskWatcher Symbol::createSwatch(const Geometry &geometry, float width, float height, const QColor &backgroundColor = QColor())

Creates a swatch image using the provided geometry, width, height, and optional backgroundColor.

The background color defaults to transparent when the backgroundColor is not provided. The width, height, and geometry coordinate values are measured in device independent pixels (DIPs). This operation will determine the primary screen scale factor for scaling the image size.

Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.

Note: The specified geometry is in DIPs, with the point {0,0} located at the centerpoint of the swatch image. The x-axis increases towards the right-hand side of the swatch image. The y-axis increases towards the top of the swatch image. For example, when creating a swatch for a MarkerSymbol, specifying a geometry of {10,10} will draw the marker 10 DIPs up and to the right of the center of the swatch. The geometry type should correspond to the symbol type. The geometry's spatial reference is ignored.

TaskWatcher Symbol::createSwatch(const Geometry &geometry, float width, float height, float screenScale, const QColor &backgroundColor = QColor())

Creates a swatch image using the provided geometry, width, height, screenScale, and optional backgroundColor.

The background color defaults to transparent when the backgroundColor is not provided. The width, height, and geometry coordinate values are measured in device independent pixels (DIPs). This operation will use the provided screenScale parameter to scale the image size.

Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.

Note: The specified geometry is in DIPs, with the point {0,0} located at the centerpoint of the swatch image. The x-axis increases towards the right-hand side of the swatch image. The y-axis increases towards the top of the swatch image. for example, when creating a swatch for a MarkerSymbol, specifying a geometry of {10,10} will draw the marker 10 DIPs up and to the right of the center of the swatch. The geometry type should correspond to the symbol type. The geometry's spatial reference is ignored.

TaskWatcher Symbol::createSwatch(float width, float height, float screenScale, const QColor &backgroundColor = QColor())

Creates a swatch image using the provided width, height, screenScale, and optional backgroundColor.

The background color defaults to transparent when the backgroundColor is not provided. The width, and height are measured in device independent pixels (DIPs). This operation will use the provided screenScale parameter to scale the image size.

Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.

This function was introduced in Esri::ArcGISRuntime 100.3.

TaskWatcher Symbol::createSwatch(const QColor &backgroundColor = QColor())

Creates a swatch image using the optional backgroundColor.

The background color defaults to transparent when the backgroundColor is not provided. This operation will determine the primary screen scale factor for scaling the image size.

Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.

TaskWatcher Symbol::createSwatch(float screenScale, const QColor &backgroundColor = QColor())

Creates a swatch image using the provided screenScale, and optional backgroundColor.

The background color defaults to transparent when the backgroundColor is not provided. This operation will use the provided screenScale parameter to scale the image size.

Emits the createSwatchCompleted(QUuid, QImage) signal when the swatch image operation completes.

[signal] void Symbol::createSwatchCompleted(QUuid taskId, QImage image)

Emitted when create swatch image operation completes successfully.

  • taskId - The ID of the create swatch task.
  • image - The swatch image.

[static] Symbol *Symbol::fromJson(const QString &json, QObject *parent = nullptr)

Creates and returns a new Symbol from the provided json, with an optional parent.

Sizes of symbols in JSON are represented in points (not pixels).

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

For Symbols of type MarkerSymbol, an angle set from JSON will be inverted (e.g. an angle of 20 will become -20).

See also JsonSerializable.

SymbolType Symbol::symbolType() const

Returns the symbol type.

[virtual] QString Symbol::toJson() const

Reimplemented from JsonSerializable::toJson().

Returns this Symbol as a JSON representation.

Sizes of symbols in JSON are represented in points (not pixels).

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

See also JsonSerializable.

[virtual] QJsonObject Symbol::unknownJson() const

Reimplemented from JsonSerializable::unknownJson().

Gets the unknown JSON of this object.

See also JsonSerializable.

[virtual] QJsonObject Symbol::unsupportedJson() const

Reimplemented from JsonSerializable::unsupportedJson().

Gets the unsupported JSON of this object.

See also JsonSerializable.

bool Symbol::operator==(const Symbol *other) const

Equivalency operator.

Returns whether this object and other are equal.


Feedback on this topic?