Skip To Content ArcGIS for Developers Sign In Dashboard

PictureMarkerSymbol Class

(Esri::ArcGISRuntime::PictureMarkerSymbol)

A marker symbol based on an image. More...

Header: #include <PictureMarkerSymbol>
Since: Esri::ArcGISRuntime 100.0
Inherits: MarkerSymbol, Loadable, and RemoteResource

Public Functions

PictureMarkerSymbol(const QImage &image, QObject *parent = nullptr)
PictureMarkerSymbol(const QUrl &url, QObject *parent = nullptr)
PictureMarkerSymbol(const QUrl &url, Credential *credential, QObject *parent = nullptr)
~PictureMarkerSymbol()
float height() const
QImage image() const
float opacity() const
void setHeight(float height)
void setOpacity(float opacity)
void setWidth(float width)
float width() const

Reimplemented Public Functions

virtual void cancelLoad()
virtual Credential *credential() const
virtual void load()
virtual Error loadError() const
virtual LoadStatus loadStatus() const
virtual RequestConfiguration requestConfiguration() const
virtual void retryLoad()
virtual void setRequestConfiguration(const RequestConfiguration &requestConfiguration)
virtual QUrl url() const

Signals

void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Additional Inherited Members

Detailed Description

A marker symbol based on an image.

Symbols describe how graphics and features look on a map. Different symbols are used with different geometry types. Instances of this class represent picture marker symbols. Marker symbols are used to display those graphics and features that are based on point or multipoint geometries. Picture marker symbols display graphics using a picture image.

Example:

Create a PictureMarkerSymbol and set its URL to an online PNG:

const QUrl pictureMarkerSymbolUrl("http://static.arcgis.com/images/Symbols/Basic/YellowStickpin.png");
PictureMarkerSymbol* pictureMarkerSymbol = new PictureMarkerSymbol(pictureMarkerSymbolUrl, this);

Member Function Documentation

PictureMarkerSymbol::PictureMarkerSymbol(const QImage &image, QObject *parent = nullptr)

Constructor to initialize a picture marker symbol with the provided image and optional parent.

PictureMarkerSymbol::PictureMarkerSymbol(const QUrl &url, QObject *parent = nullptr)

Constructor to initialize a picture marker symbol with the provided url to an image and optional parent.

The URL can be provided as a path to a local file ( "file:/<path to file>"), path to a resource image ("qrc:/<path to resource image>"), or a path to an HTTP URL image ("http://path to image").

PictureMarkerSymbol::PictureMarkerSymbol(const QUrl &url, Credential *credential, QObject *parent = nullptr)

Constructor to initialize a picture marker symbol with the provided url to an image, a credential for the secured resource, and optional parent.

The URL can be provided as a path to a local file (file:/<path to file>), path to a resource image (qrc:/<path to resource image>), or a path to an HTTP URL image (http://path to image).

A credential is specified if the image needs authentication to gain access to it.

PictureMarkerSymbol::~PictureMarkerSymbol()

Destructor.

[virtual] void PictureMarkerSymbol::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

[virtual] Credential *PictureMarkerSymbol::credential() const

Reimplemented from RemoteResource::credential().

Returns the credential to be used to access a secured image URL if provided.

[signal] void PictureMarkerSymbol::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

  • loadError - Details about any error that may have occurred.

Note: If there is a load error it will also be emitted on the errorOccurred signal.

See also Loadable and Object.

float PictureMarkerSymbol::height() const

Returns the height of the symbol in device independent pixels (DIPs).

Defaults to size of the image.

See also setHeight().

QImage PictureMarkerSymbol::image() const

Returns the picture marker symbol image once loaded.

If a URL was provided for the picture marker symbol, an attempt to load the symbol must occur and succeed, and then the image can be returned from this function. Prior to loading in this case, this will return a null QImage.

Returned images are in the QImage::Format_ARGB32_Premultiplied format.

[virtual] void PictureMarkerSymbol::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error PictureMarkerSymbol::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus PictureMarkerSymbol::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

[signal] void PictureMarkerSymbol::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Signal emitted when the load status changes for this object.

See also Loadable.

float PictureMarkerSymbol::opacity() const

Returns the opacity of the symbol.

Defaults to 1.0 (fully opaque). Permitted values range between 0-1.

See also setOpacity().

[virtual] RequestConfiguration PictureMarkerSymbol::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this symbol.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setRequestConfiguration().

[virtual] void PictureMarkerSymbol::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

void PictureMarkerSymbol::setHeight(float height)

Sets the height of the symbol in device independent pixels (DIPs).

Defaults to size of the image.

See also height().

void PictureMarkerSymbol::setOpacity(float opacity)

Sets the opacity of the symbol.

Defaults to 1.0 (fully opaque).

See also opacity().

[virtual] void PictureMarkerSymbol::setRequestConfiguration(const RequestConfiguration &requestConfiguration)

Reimplemented from RemoteResource::setRequestConfiguration().

Sets configuration parameters used for network requests sent by this symbol to requestConfiguration.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also requestConfiguration().

void PictureMarkerSymbol::setWidth(float width)

Sets the width of the symbol in device independent pixels (DIPs).

Defaults to size of the image.

See also width().

[virtual] QUrl PictureMarkerSymbol::url() const

Reimplemented from RemoteResource::url().

Returns the URL path to the picture marker symbol image.

This could be a local file path, Qt resource path, or HTTP path to the image.

float PictureMarkerSymbol::width() const

Returns the width of the symbol in device independent pixels (DIPs).

Defaults to size of the image.

See also setWidth().


Feedback on this topic?