PictureMarkerSymbol Class

  • PictureMarkerSymbol
  • class Esri::ArcGISRuntime::PictureMarkerSymbol

    Uses an image to symbolize graphics and features that have point or multipoint geometry. More...

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

    Public Functions

    PictureMarkerSymbol(const QImage &image, QObject *parent = nullptr)
    PictureMarkerSymbol(const QUrl &url, QObject *parent = nullptr)
    PictureMarkerSymbol(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, 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)
    Esri::ArcGISRuntime::MultilayerPointSymbol *toMultilayerSymbol() const
    float width() const
    bool operator!=(const Esri::ArcGISRuntime::PictureMarkerSymbol &other) const
    bool operator==(const Esri::ArcGISRuntime::PictureMarkerSymbol &other) 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(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

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

    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");
    auto* pictureMarkerSymbol = new PictureMarkerSymbol(pictureMarkerSymbolUrl, this);

    Relevant samples:

    See also MarkerSymbol and Symbol.

    Member Function Documentation

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

    Creates a picture marker symbol with the given image.

    • image - The image.
    • parent - The optional parent QObject.

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

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

    Creates a picture marker symbol from an image URL.

    • url - URL of the image.
    • parent - The optional parent QObject.

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

    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, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

    Creates a picture marker symbol from an image URL.

    • url - URL of the image.
    • parent - The optional parent QObject.
    • credential - the crediantial for the secured resource if the image needs authentication to gain access to it.

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

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

    [override virtual] PictureMarkerSymbol::~PictureMarkerSymbol()

    Destructor.

    [override virtual] void PictureMarkerSymbol::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    Cancels loading metadata for the object.

    See Loadable.

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

    Reimplements: RemoteResource::credential() const.

    Returns the security credentials to access the remote resource. Only applicable if the resource is secured.

    [signal] void PictureMarkerSymbol::doneLoading(const 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 picture marker symbol in device-independent pixels (DIPs).

    The height of the symbol spanning from the bottom to the top side of the image. The default value is 0.0. You can use this property to override the height of the symbol. Note that if you set the height or width to 0.0, then the picture fill symbol will adopt the height and width of the loaded 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().

    Loads the metadata for the object asynchronously.

    See Loadable.

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

    Reimplements: Loadable::loadError() const.

    Returns the load error.

    See Loadable.

    See also Error.

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

    Reimplements: Loadable::loadStatus() const.

    Returns the load status.

    See Loadable.

    See also LoadStatus.

    [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 for the picture marker symbol.

    The value ranges from 0.0 (fully transparent) to 1.0 (opaque). The default value is 1.0.

    See also setOpacity().

    [override virtual, since Esri::ArcGISRuntime 100.1] 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().

    Loads or retries loading metadata for the object asynchronously.

    Will retry loading the metadata if the object is failed to load. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded. Will always call the done loading if this is called.

    See Loadable.

    void PictureMarkerSymbol::setHeight(float height)

    Sets the height to height.

    See also height.

    void PictureMarkerSymbol::setOpacity(float opacity)

    Sets the opacity to opacity.

    See also opacity.

    [override virtual, since Esri::ArcGISRuntime 100.1] 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 to width.

    See also width.

    [since Esri::ArcGISRuntime 100.13] Esri::ArcGISRuntime::MultilayerPointSymbol *PictureMarkerSymbol::toMultilayerSymbol() const

    Returns a multilayer point symbol, generated from picture marker symbol.

    Given a picture marker symbol, this method will return a MultilayerPointSymbol with a PictureMarkerSymbolLayer.

    This function was introduced in Esri::ArcGISRuntime 100.13.

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

    Reimplements: RemoteResource::url() const.

    Returns the URL of the picture marker symbol.

    The URL is the address location of where the image is being stored. This address can come from an online source or from a locally stored location. In order to use a PictureMarkerSymbol from a URL, the symbol must be loaded asynchronously. Any properties that are changed while this symbol is loading will persist once the image has loaded.

    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 picture marker symbol.

    The width of the symbol spanning from the left to the right side of the image. The default value is 0.0. You can use this property to override the width of the symbol. Note that if you set the height or width to 0.0, then the picture fill symbol will adopt the height and width of the loaded image.

    See also setWidth().

    [since Esri::ArcGISRuntime 200.2] bool PictureMarkerSymbol::operator!=(const Esri::ArcGISRuntime::PictureMarkerSymbol &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 PictureMarkerSymbol::operator==.

    [since Esri::ArcGISRuntime 200.1] bool PictureMarkerSymbol::operator==(const Esri::ArcGISRuntime::PictureMarkerSymbol &other) const

    Returns a boolean that tests if this picture marker symbol is equal to another picture marker symbol.

    • other - The picture marker symbol to be compared.

    This function was introduced in Esri::ArcGISRuntime 200.1.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.