Class MultilayerSymbol

java.lang.Object
com.esri.arcgisruntime.symbology.Symbol
com.esri.arcgisruntime.symbology.MultilayerSymbol
All Implemented Interfaces:
JsonSerializable
Direct Known Subclasses:
MultilayerPointSymbol, MultilayerPolygonSymbol, MultilayerPolylineSymbol

public class MultilayerSymbol extends Symbol
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.

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. They can also be created from JSON by calling Symbol.fromJson(String). 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 getSymbolLayers() 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.

For more information about multilayer symbols, refer to Symbols in the ArcGIS Pro help.

Since:
100.2.0
  • Property Details

    • color

      public ObjectProperty<Color> colorProperty
      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.

      The color of specific symbol layers within a multilayer symbol can be locked; the new color value will be applied to any symbol layers that are not locked. Color locking can be enabled or disabled through SymbolLayer.setColorLocked(boolean).

      Attempting to set the color to null will throw a NullPointerException exception.

      Since:
      200.0.0
      See Also:
  • Method Details

    • colorProperty

      public ObjectProperty<Color> colorProperty()
      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.

      The color of specific symbol layers within a multilayer symbol can be locked; the new color value will be applied to any symbol layers that are not locked. Color locking can be enabled or disabled through SymbolLayer.setColorLocked(boolean).

      Attempting to set the color to null will throw a NullPointerException exception.

      Returns:
      the color property
      Since:
      200.0.0
      See Also:
    • getColor

      public Color getColor()
      Gets the value of the color property.
      Property description:
      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.

      The color of specific symbol layers within a multilayer symbol can be locked; the new color value will be applied to any symbol layers that are not locked. Color locking can be enabled or disabled through SymbolLayer.setColorLocked(boolean).

      Attempting to set the color to null will throw a NullPointerException exception.

      Returns:
      the value of the color property
      Since:
      200.0.0
      See Also:
    • setColor

      public void setColor(Color color)
      Sets the value of the color property.
      Property description:
      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.

      The color of specific symbol layers within a multilayer symbol can be locked; the new color value will be applied to any symbol layers that are not locked. Color locking can be enabled or disabled through SymbolLayer.setColorLocked(boolean).

      Attempting to set the color to null will throw a NullPointerException exception.

      Parameters:
      color - the value for the color property
      Since:
      200.0.0
      See Also:
    • setColor

      @Deprecated(since="200.0.0", forRemoval=true) public void setColor(int color)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 200.0.0, replaced by setColor(Color)
      Sets the consensus color of all layers in the symbol (excluding those that are color-locked) using an ARGB(alpha, red, green, blue) value.

      Because MultilayerSymbol may have multiple 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.

      The color of specific symbol layers within a multilayer symbol can be locked; the new color value will be applied to any symbol layers that are not locked. Color locking can be enabled or disabled through SymbolLayer.setColorLocked(boolean).

      Parameters:
      color - the color to set, in the form 0xAARRGGBB
      Since:
      100.2.0
    • getSymbolLayers

      public List<SymbolLayer> getSymbolLayers()
      Gets a list containing the symbol layers within this multilayer symbol. The list is modifiable and symbol layers can be added or removed. The symbol layers are in reverse order of how they appear in the JSON representation from the server.
      Returns:
      the list of symbol layers
      Since:
      100.5.0
    • getReferenceProperties

      public SymbolReferenceProperties getReferenceProperties()
      Gets the SymbolReferenceProperties for this symbol. The properties change how the multilayer symbol behaves when attached to a renderer.
      Returns:
      the SymbolReferenceProperties for this symbol, or null if none
      Since:
      100.13.0
    • setReferenceProperties

      public void setReferenceProperties(SymbolReferenceProperties referenceProperties)
      Sets the SymbolReferenceProperties for this symbol. The properties change how the multilayer symbol behaves when attached to a renderer.
      Parameters:
      referenceProperties - the SymbolReferenceProperties for this symbol
      Since:
      100.13.0