Class MultilayerPolylineSymbol

All Implemented Interfaces:
JsonSerializable

public final class MultilayerPolylineSymbol extends MultilayerSymbol
A polyline symbol built with multiple layers of symbols to display graphics and features that have polyline geometry.

A MultilayerPolylineSymbol can contain multiple layers that are combined to create different appearances, for example, a solid road with dashed pattern on top to show the center line. The individual layers have their own properties such as width and dash patterns, and can be accessed programmatically through MultilayerSymbol.getSymbolLayers(). For more information about multilayer symbols, refer to Symbol layers.

If you create a MultilayerPolylineSymbol 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.

Since:
100.2.0
  • Constructor Details

    • MultilayerPolylineSymbol

      public MultilayerPolylineSymbol(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, use MultilayerSymbol.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:
      IllegalArgumentException - if symbolLayers is null
      Since:
      100.5.0
    • MultilayerPolylineSymbol

      public MultilayerPolylineSymbol(Iterable<SymbolLayer> symbolLayers, SymbolReferenceProperties referenceProperties)
      Creates a multilayer polyline symbol object with symbol layers and SymbolReferenceProperties.
      Parameters:
      symbolLayers - a collection of symbol layers that make up the symbol
      referenceProperties - the symbol reference properties for the symbol, may be null
      Throws:
      IllegalArgumentException - if symbolLayers is null
      Since:
      100.13.0
  • Method Details

    • 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:
      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: