Class MultilayerPolylineSymbol
- java.lang.Object
-
- com.esri.arcgisruntime.symbology.Symbol
-
- com.esri.arcgisruntime.symbology.MultilayerSymbol
-
- com.esri.arcgisruntime.symbology.MultilayerPolylineSymbol
-
- All Implemented Interfaces:
JsonSerializable
public final class MultilayerPolylineSymbol extends MultilayerSymbol
Used to render polyline geometries, these symbols are built from multiple layers of symbols. They may be returned from polyline feature layers based on web maps, feature services, or mobile map packages, and can also be created from JSON by callingSymbol.fromJson(String)
.The symbol layers that comprise a MultilayerPolylineSymbol can be of different symbol types. For example, a MultilayerPolylineSymbol may contain a line (stroke) symbol layer to draw a solid road, a second line symbol layer with a dashed stroke to draw the road centerline, and a point (marker) symbol layer that is drawn at specified locations along the polyline. The layers that comprise the symbol can be accessed through
MultilayerSymbol.getSymbolLayers()
. Some properties can also be changed programmatically - the color and line width. For more information about multilayer symbols, refer to Symbols in the ArcGIS Pro help.- Since:
- 100.2.0
-
-
Constructor Summary
Constructors Constructor Description MultilayerPolylineSymbol(java.lang.Iterable<SymbolLayer> symbolLayers)
Creates a multilayer polyline symbol from the given symbol layers.MultilayerPolylineSymbol(java.lang.Iterable<SymbolLayer> symbolLayers, SymbolReferenceProperties referenceProperties)
Creates a multilayer polyline symbol object with symbol layers andSymbolReferenceProperties
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getWidth()
Gets the width of the symbol in density-independent pixels (dp)void
setWidth(float width)
Sets the width of the symbol in density-indepdent pixels (dp).-
Methods inherited from class com.esri.arcgisruntime.symbology.MultilayerSymbol
getColor, getReferenceProperties, getSymbolLayers, setColor, setReferenceProperties
-
Methods inherited from class com.esri.arcgisruntime.symbology.Symbol
createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, fromJson, getUnknownJson, getUnsupportedJson, toJson
-
-
-
-
Constructor Detail
-
MultilayerPolylineSymbol
public MultilayerPolylineSymbol(java.lang.Iterable<SymbolLayer> symbolLayers)
Creates a multilayer polyline symbol from the given symbol layers. Any modification of the given collection of symbol layers will be ignored, useMultilayerSymbol.getSymbolLayers()
to add or remove symbol layers. By default the color is 0x00000000 (no color) and the width is inferred from the given layers.- Parameters:
symbolLayers
- symbol layers for the symbol, cannot be null- Throws:
java.lang.IllegalArgumentException
- if symbolLayers is null- Since:
- 100.5.0
-
MultilayerPolylineSymbol
public MultilayerPolylineSymbol(java.lang.Iterable<SymbolLayer> symbolLayers, SymbolReferenceProperties referenceProperties)
Creates a multilayer polyline symbol object with symbol layers andSymbolReferenceProperties
.- Parameters:
symbolLayers
- a collection of symbol layers that make up the symbolreferenceProperties
- the symbol reference properties for the symbol, may be null- Throws:
java.lang.IllegalArgumentException
- if symbolLayers is null- Since:
- 100.13.0
-
-
Method Detail
-
setWidth
public void setWidth(float width)
Sets the width of the symbol in density-indepdent pixels (dp).When getting the width from a multilayer polyline symbol, the value reported is the largest width of all the symbol layers it contains. The symbol width is updated when its symbol layer widths change (if there is a new largest layer width). When setting a new width at the polyline symbol level, the width of the largest symbol layer is given the provided value, and all the smaller layers are sized proportionately. An individual symbol layer can be given a specific width without affecting the other layers.
- Parameters:
width
- the width, in density-independent pixels (dp)- Throws:
java.lang.IllegalArgumentException
- if width is less than zero- Since:
- 100.2.0
-
getWidth
public float getWidth()
Gets the width of the symbol in density-independent pixels (dp)When getting the width from a multilayer polyline symbol, the value reported is the largest width of all the symbol layers it contains. The symbol width is updated when its symbol layer widths change (if there is a new largest layer width). When setting a new width at the polyline symbol level, the width of the largest symbol layer is given the provided value, and all the smaller layers are sized proportionately. An individual symbol layer can be given a specific width without affecting the other layers.
- Returns:
- the width, in density-independent pixels (dp)
- Since:
- 100.2.0
- See Also:
setWidth(float)
-
-