Skip to content
  • MultilayerSymbol
  • class Esri::ArcGISRuntime::MultilayerSymbol

    A base class for multilayer symbols. Multiple layers of symbols combine to make complex multilayer symbols that you can add to a map or scene. More...

    Public Functions

    virtual ~MultilayerSymbol() override
    QColor color() const
    (since Esri::ArcGISRuntime 100.13) Esri::ArcGISRuntime::SymbolReferenceProperties *referenceProperties() const
    (since Esri::ArcGISRuntime 300.0) Esri::ArcGISRuntime::SymbolSizeUnits sceneSizeUnit() const
    void setColor(const QColor &color)
    (since Esri::ArcGISRuntime 100.13) void setReferenceProperties(Esri::ArcGISRuntime::SymbolReferenceProperties *referenceProperties)
    (since Esri::ArcGISRuntime 300.0) void setSceneSizeUnit(Esri::ArcGISRuntime::SymbolSizeUnits sceneSizeUnit)
    (since Esri::ArcGISRuntime 100.5) Esri::ArcGISRuntime::SymbolLayerListModel *symbolLayers() const

    Detailed Description

    Multilayer symbols can be returned from feature layers based on web maps, feature services (with Use Advanced Symbology set to true), or mobile map packages. You can programmatically create and change them using the MultilayerPointSymbol, MultilayerPolylineSymbol, and MultilayerPolygonSymbol subclasses. You can also access the layers that comprise the symbol through symbolLayers and modify their properties, such as the color of a multilayer symbol. Some subclasses also expose additional symbol properties.

    The symbol layers that comprise the symbol can be of different types. For example, a polyline geometry may be drawn with a MultilayerPolylineSymbol that has line (stroke) symbol layers that draw the line geometry, and also point (marker) symbol layers that are drawn at specified point locations relative to the line geometry.

    When you save an ArcGIS Pro map as a web map, any multilayer symbols in the map are converted to simple symbols. In general, point symbols are converted to picture marker symbols optimized for the web, and line and polygon symbols are simplified while representing the original symbol as closely as possible. If you're authoring a feature service from ArcGIS Pro, however, both the original symbols and the simplified symbols are stored. The stored symbols allow clients that support advanced symbols to render the features as originally symbolized, while those that do not support advanced symbols (such as ArcGIS Online Map Viewer) can use the simple symbols for display. Having both sets of symbols allows you to retain the advanced symbology where available and still share the feature service as widely as possible. Symbols used by web scenes are also multilayer but use a different symbol specification than ArcGIS Pro and this API. When you read symbols from a web scene in your app, you get a representation of the multilayer symbol.

    If you create a multilayer symbol from a collection of SymbolLayer objects, the first symbol layer in the collection will be drawn first, with the second symbol layer on top of the first, and so on. Note that symbol layers in a multilayer symbol are in reverse order of how they appear in the JSON representation.

    If a multilayer symbol is created from multiple ModelSymbolLayer types or a mix of ModelSymbolLayer types and other symbol layer types, only the first ModelSymbolLayer is rendered, and all other symbol layers are ignored for rendering.

    // in this multilayer symbol pseudocode json, the 'symbolLayers' ordered list of symbol
    // layers contains a solid stroke symbol layer followed by a solid fill symbol layer.
    { "symbolLayers": [{"type": "CIMSolidStroke", "color": "black"},{"type": "CIMSolidFill", "color": "red"}],"type": "CIMPointSymbol" }
    
    // this is the solid fill symbol layer, the reverse order from the json representation
    auto* symbolLayerIndexZero = multilayerSymbol->symboLayers()->at(0); // red fill in the image below
    
    // this is the solid stroke symbol layer, the reverse order from the json representation
    auto* symbolLayerIndexOne = multilayerSymbol->symboLayers()->at(1); // black outline in the image below

    "MultilayerPoint symbol"

    Multilayer symbol consisting of two layers.

    Relevant samples:

    Member Function Documentation

    [override virtual noexcept] MultilayerSymbol::~MultilayerSymbol()

    Destructor.

    QColor MultilayerSymbol::color() const

    Returns the consensus color of all layers in the symbol (excluding those that are color-locked).

    A MultilayerSymbol may have many symbol layers. This property represents the value of all color and tint color properties of constituent symbol layers, excluding any StrokeSymbolLayer in a MultilayerPolygonSymbol, as those symbol layers are outlines. The property defines the color and tint color of symbols contained in VectorMarkerSymbolElement. Constituent symbol layers whose colorLocked property is true do not change color as a result of this function. To change outline colors, modify the outline symbol layer colors individually.

    If the constituent symbol layers do not share a common color, for example, if one or more color unlocked layers use different colors or tint values, the multilayer symbol's color returns a transparent black (RGBA(0, 0, 0, 0)). Applying transparent black to the symbol does not affect the tint color of its ModelSymbolLayer, PictureFillSymbolLayer, or PictureMarkerSymbolLayer.

    See also setColor().

    [since Esri::ArcGISRuntime 100.13] Esri::ArcGISRuntime::SymbolReferenceProperties *MultilayerSymbol::referenceProperties() const

    Returns the properties change how the multilayer symbol behaves when attached to a renderer.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    See also setReferenceProperties().

    [since Esri::ArcGISRuntime 300.0] Esri::ArcGISRuntime::SymbolSizeUnits MultilayerSymbol::sceneSizeUnit() const

    Returns the size unit of the symbol when rendered in a Scene. This property defines the units used for symbol sizing in a Scene. It influences both the rendering of the symbol and the measurement units for the symbol's size properties and its constituent symbol layers.

    If the value is SymbolSizeUnits::DIPs, the symbol is rendered using device-independent pixels (DIPs), maintaining a consistent size in screen space regardless of the scale or camera's distance. The symbol appears the same size on the screen no matter how far it is from the camera. All size-related properties are interpreted in DIPs.

    If the value is SymbolSizeUnits::Meters, the symbol is rendered using meters, maintaining a consistent size in world space regardless of zoom level. As a result, the symbol appears smaller when viewed from farther away and larger when viewed up close, preserving its real-world dimensions. All size-related properties are interpreted in meters. Note that due to rendering limitations in 3D, only ModelSymbolLayer can be drawn using meters. Other symbol layer types fall back to render using DIPs.

    The default value is SymbolSizeUnits::DIPs, meaning that the symbol is drawn and measured using DIPs. When symbols are read from sources such as web scenes, mobile scene packages, scene services, or scene layer packages that do not define this property, its value is automatically inferred based on the symbol type.

    Note that this property is not supported for symbols in a Map and that changing it in that context has no effect. It is, however, supported for both 2D and 3D symbols in a Scene.

    This function was introduced in Esri::ArcGISRuntime 300.0.

    See also setSceneSizeUnit().

    void MultilayerSymbol::setColor(const QColor &color)

    Sets the color to color.

    See also color.

    [since Esri::ArcGISRuntime 100.13] void MultilayerSymbol::setReferenceProperties(Esri::ArcGISRuntime::SymbolReferenceProperties *referenceProperties)

    Sets the referenceProperties to referenceProperties.

    This function was introduced in Esri::ArcGISRuntime 100.13.

    See also referenceProperties.

    [since Esri::ArcGISRuntime 300.0] void MultilayerSymbol::setSceneSizeUnit(Esri::ArcGISRuntime::SymbolSizeUnits sceneSizeUnit)

    Sets the sceneSizeUnit to sceneSizeUnit.

    This function was introduced in Esri::ArcGISRuntime 300.0.

    See also sceneSizeUnit.

    [since Esri::ArcGISRuntime 100.5] Esri::ArcGISRuntime::SymbolLayerListModel *MultilayerSymbol::symbolLayers() const

    Returns the symbol layers of the multilayer symbol.

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

    This function was introduced in Esri::ArcGISRuntime 100.5.

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