Class MultilayerPointSymbol

All Implemented Interfaces:
JsonSerializable

public final class MultilayerPointSymbol extends MultilayerSymbol
A point symbol built with multiple layers of symbols to display graphics and features that have point or multipoint geometry.

A MultilayerPointSymbol can contain multiple symbol layers that are combined to create different appearances, for example, concentric circles or a pushpin with a star drawn in a different color. You can access and modify the symbology of layers using MultilayerSymbol.getSymbolLayers(). You can also change properties such as the size, angle, and angle alignment. For more information about multilayer symbols, refer to Symbol layers.

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

    • MultilayerPointSymbol

      public MultilayerPointSymbol(Iterable<SymbolLayer> symbolLayers)
      Creates a multilayer point 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), the size and angle are inferred from the given layers, and angle alignment is MarkerSymbol.AngleAlignment.SCREEN.
      Parameters:
      symbolLayers - symbol layers for the symbol, cannot be null
      Throws:
      IllegalArgumentException - if symbolLayers is null
      Since:
      100.5.0
    • MultilayerPointSymbol

      public MultilayerPointSymbol(Iterable<SymbolLayer> symbolLayers, SymbolReferenceProperties referenceProperties)
      Creates a multilayer point 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

    • getSize

      public float getSize()
      Gets the size of the symbol in density-independent pixels (dp).

      When getting the size from a multilayer point symbol, the value reported is the largest size of all the symbol layers it contains. The symbol size is updated when its symbol layer sizes change (if there is a new largest layer size). When setting a new size at the point symbol level, the size 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 size without affecting the other layers.

      Returns:
      the size, in density-independent pixels (dp)
      Since:
      100.2.0
      See Also:
    • setSize

      public void setSize(float size)
      Sets the size of the symbol in density-independent pixels (dp).

      When getting the size from a multilayer point symbol, the value reported is the largest size of all the symbol layers it contains. The symbol size is update when its symbol layer sizes change (if there is a new largest layer size). When setting a new size at the point symbol level, the size 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 size without affecting the other layers.

      Parameters:
      size - the size, in density-independent pixels (dp)
      Throws:
      IllegalArgumentException - if size is less than 0
      Since:
      100.2.0
    • getAngle

      public float getAngle()
      Gets the angle of the symbol in degrees. The symbol will rotate about its center, according to the current getAngleAlignment().

      The angle for multilayer point symbols is measured in degrees counterclockwise from the east, from 0 to 360. The angle for a multilayer point symbol defaults to 0. Marker symbol layers can have a separate heading value defined (which is also 0 by default). Setting a heading for a marker symbol layer does not affect the angle of the point symbol. When an angle value is set for the point symbol, however, that value is applied cumulatively to all the marker symbol layers it contains. The heading for individual symbol layers must be re-fetched in order to see the updated value.

      Returns:
      the angle in degrees
      Since:
      100.2.0
      See Also:
    • setAngle

      public void setAngle(float angle)
      Sets the angle of the symbol in degrees. The symbol will rotate about its center, according to the current getAngleAlignment().

      The angle for multilayer point symbols is measured in degrees counterclockwise from the east, from 0 to 360. The angle for a multilayer point symbol defaults to 0. Marker symbol layers can have a separate heading value defined (which is also 0 by default). Setting a heading for a marker symbol layer does not affect the angle of the point symbol. When an angle value is set for the point symbol, however, that value is applied cumulatively to all the marker symbol layers it contains. The heading for individual symbol layers must be re-fetched in order to see the updated value.

      Parameters:
      angle - the angle in degrees
      Since:
      100.2.0
      See Also:
    • getAngleAlignment

      public MarkerSymbol.AngleAlignment getAngleAlignment()
      Gets whether the multilayer point symbol is rotated relative to the screen or map.

      If the value is MarkerSymbol.AngleAlignment.MAP, the multilayer point symbol is rotated relative to the map and will be affected by the map's rotation. If the value is MarkerSymbol.AngleAlignment.SCREEN, the multilayer point symbol is rotated relative to the user's screen and is unaffected by the map's rotation. This is only applicable for 2D maps and is not supported in 3D scenes.

      The default value is AngleAlignment.SCREEN.

      Returns:
      the angle alignment of the symbol
      Since:
      100.2.0
    • setAngleAlignment

      public void setAngleAlignment(MarkerSymbol.AngleAlignment angleAlignment)
      Sets whether the multilayer point symbol is rotated relative to the screen or map.

      If the value is MarkerSymbol.AngleAlignment.MAP, the multilayer point symbol is rotated relative to the map and will be affected by the map's rotation. If the value is MarkerSymbol.AngleAlignment.SCREEN, the multilayer point symbol is rotated relative to the user's screen and is unaffected by the map's rotation. This is only applicable for 2D maps and is not supported in 3D scenes.

      Parameters:
      angleAlignment - the angle alignment
      Throws:
      IllegalArgumentException - if angleAlignment is null
      Since:
      100.2.0