Skip To Content ArcGIS for Developers Sign In Dashboard

PictureMarkerSymbol Class

class Esri::ArcGISRuntime::PictureMarkerSymbol

Uses an image to symbolize GeoElements that have Point or Multipoint. More...

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

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

PictureMarkerSymbol(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
PictureMarkerSymbol(const QUrl &url, QObject *parent = nullptr)
PictureMarkerSymbol(const QImage &image, QObject *parent = nullptr)
virtual ~PictureMarkerSymbol() override
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() override
virtual Esri::ArcGISRuntime::Credential *credential() const override
virtual void load() override
virtual Esri::ArcGISRuntime::Error loadError() const override
virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
virtual void retryLoad() override
virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
virtual QUrl url() const override

Signals

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

Detailed Description

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. Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

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 QUrl &url, Esri::ArcGISRuntime::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(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"). Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

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

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

Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

[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.

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

Signal emitted when the load status changes for this object.

See also Loadable.

[override virtual] PictureMarkerSymbol::~PictureMarkerSymbol()

Destructor.

[override virtual] void PictureMarkerSymbol::cancelLoad()

Reimplements: Loadable::cancelLoad().

See Loadable.

[override virtual] Esri::ArcGISRuntime::Credential *PictureMarkerSymbol::credential() const

Reimplements: RemoteResource::credential() const.

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

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.

[override virtual] void PictureMarkerSymbol::load()

Reimplements: Loadable::load().

See Loadable.

[override virtual] Esri::ArcGISRuntime::Error PictureMarkerSymbol::loadError() const

Reimplements: Loadable::loadError() const.

See Loadable.

[override virtual] Esri::ArcGISRuntime::LoadStatus PictureMarkerSymbol::loadStatus() const

Reimplements: Loadable::loadStatus() const.

See 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().

[override virtual] Esri::ArcGISRuntime::RequestConfiguration PictureMarkerSymbol::requestConfiguration() const

Reimplements: RemoteResource::requestConfiguration() const.

Returns the RequestConfiguration in use by this symbol.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setRequestConfiguration().

[override virtual] void PictureMarkerSymbol::retryLoad()

Reimplements: 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().

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

Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

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().

[override virtual] QUrl PictureMarkerSymbol::url() const

Reimplements: RemoteResource::url() const.

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?