Class SymbolLayer
- java.lang.Object
-
- com.esri.arcgisruntime.symbology.SymbolLayer
-
- Direct Known Subclasses:
FillSymbolLayer
,MarkerSymbolLayer
,StrokeSymbolLayer
public class SymbolLayer extends Object
Represents a SymbolLayer within aMultilayerPointSymbol
,MultilayerPolygonSymbol
, orMultilayerPolylineSymbol
. The available symbol layer types correspond to the primitive geometry they are designed to render: marker layers for point, stroke layers for line, and fill layers for area. Layer types, however, are not applied exclusively to the corresponding geometry type. A marker symbol layer, for example, could be applied to a polyline feature to render its vertices. A symbol can contain one or several symbol layers of the same or different type.A symbol used to render polygons, for example, might contain a fill symbol layer to render the polygon interior, a stroke symbol layer for rendering the polygon outline, and a marker symbol layer to render polygon vertices. A symbol to render a polyline might contain several stroke layers of varying widths.
If a symbol contains a layer that cannot render the type of geometry to which it is applied, that symbol layer is ignored when rendering.
The following table lists symbol types and symbol layers:
Symbol Types and Symbol Layers Symbol type Typical symbol layers Role Point symbol
Marker layers
Draw relative to the point geometry
Polyline symbol
Marker layers
Draw at specified locations relative to the line geometry
Stroke layers
Draw relative to the line geometry
Polygon symbol
Marker layers
Draw relative to the polygon outline or in the interior, depending on placement setting
Stroke layers
Draw relative to the polygon outline
Fill layers
Draw relative to the polygon interior
Most
SymbolLayer
properties are only accessible on the symbol layer. There are some properties, however, that are also exposed for the symbol as a whole. Properties such as color and size, for example, can be modified either for an individual symbol layer, or for the symbol itself. For such properties, the value provided for the symbol may have an effect on the corresponding property for the symbol layers it contains. Similarly, the property value for a multilayer symbol might be determined from the values of the individual symbol layers it contains.There are no notifications from a symbol or symbol layer when a property has been changed. If your app needs to respond to property changes in a symbol (as a result of a propagated change, for example) you will need to reread property values to identify changes.
Unknown symbol layers or properties
The multilayer symbol specification is complex and continues to evolve outside of ArcGIS Runtime. The potential exists that some symbol layers (or properties) will not expose an API or will not be known by ArcGIS Runtime. Depending on the problem encountered, ArcGIS Runtime will handle this situation in one of the following ways:
- If ArcGIS Runtime reads a symbol that it can render, but for which no public API is exposed, the base class for the appropriate symbol layer is returned in the layer collection.
- The multilayer symbology specification for an existing symbol layer type might be updated to include properties that are not recognized by ArcGIS Runtime. When reading such a symbol layer, ArcGIS Runtime attempts to create it with the properties it understands. The symbol layer renders, but properties that cannot be identified are ignored.
- In the event that a new (unrecognized) symbol layer is encountered by ArcGIS Runtime, the symbol is ignored and is not added to the symbol layer collection.
- Since:
- 100.5.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isColorLocked()
Gets whether the SymbolLayer is color-locked.boolean
isEnabled()
Gets whether the SymbolLayer is enabled and will be rendered.void
setColorLocked(boolean colorLocked)
Sets if the SymbolLayer is color-locked.void
setEnabled(boolean enabled)
Sets if this SymbolLayer is enabled, if it's not enabled it will not be rendered.
-
-
-
Method Detail
-
isColorLocked
public boolean isColorLocked()
Gets whether the SymbolLayer is color-locked. If a SymbolLayer is color-locked its color will not be changed if the color is changed on the MultilayerSymbol that contains the SymbolLayer. Changes to the color on the SymbolLayer itself will be respected regardless of if the SymbolLayer is color-locked.- Returns:
- true if the SymbolLayer is color-locked, false otherwise. Default is false.
- Since:
- 100.5.0
-
setColorLocked
public void setColorLocked(boolean colorLocked)
Sets if the SymbolLayer is color-locked. If a SymbolLayer is color-locked its color will not be changed if the color is changed on the MultilayerSymbol that contains the SymbolLayer. Changes to the color on the SymbolLayer itself will be respected regardless of if the SymbolLayer is color-locked.- Parameters:
colorLocked
- true to lock the color, false to unlock- Since:
- 100.5.0
-
isEnabled
public boolean isEnabled()
Gets whether the SymbolLayer is enabled and will be rendered. If the SymbolLayer is not enabled it won't be rendered.- Returns:
- true if the SymbolLayer is enabled, false otherwise. Default is true.
- Since:
- 100.5.0
-
setEnabled
public void setEnabled(boolean enabled)
Sets if this SymbolLayer is enabled, if it's not enabled it will not be rendered.- Parameters:
enabled
- true to enable SymbolLayer, false to disable- Since:
- 100.5.0
-
-