Class MultilayerPointSymbol

  • All Implemented Interfaces:
    JsonSerializable

    public final class MultilayerPointSymbol
    extends MultilayerSymbol
    Used to render point or multipoint geometries, these symbols are built from multiple layers of symbols. They may be returned from point or multipoint feature layers based on web maps, feature services, or mobile map packages, and can also be created from JSON by calling Symbol.fromJson(String).

    MultilayerPointSymbols can contain multiple point symbol layers that are combined to create different appearances, for example concentric circles or a pushpin with a star drawn in a different color. The layers that comprise the symbol can be accessed programmatically through MultilayerSymbol.getSymbolLayers(). Some properties can also be changed programmatically - the color, size, angle, and angle alignment. For more information about multilayer symbols, refer to Symbols in the ArcGIS Pro help.

    Since:
    100.2.0
    • Constructor Detail

      • 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
    • Method Detail

      • getSize

        public float getSize()
        Gets the size of the symbol.
        Returns:
        the size, in density-independent pixels (dp)
        Since:
        100.2.0
        See Also:
        setSize(float)
      • setSize

        public void setSize​(float size)
        Sets the size of the symbol.

        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.

        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. A positive value indicates the symbol is rotated clockwise, a negative value indicates the symbol is rotated anti-clockwise.
        Returns:
        the angle in degrees
        Since:
        100.2.0
        See Also:
        setAngle(float)
      • setAngle

        public void setAngle​(float angle)
        Sets the angle of the symbol. A positive value rotates the symbol clockwise, a negative value rotates the symbol anti-clockwise. The symbol will rotate about it's center, according to the current getAngleAlignment().

        Angle for multilayer point symbols and marker symbol layers 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 their own angle value defined (which is also 0 by default). Setting an angle 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.

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

        public MarkerSymbol.AngleAlignment getAngleAlignment()
        Gets the symbol AngleAlignment of the multilayer point symbol, indicating how the symbol will be rotated to the current getAngle(), either relative to the user's screen or relative to the map.

        If this has not been set, the default value is SCREEN.

        Note: This property is only applicable for 2D and is not supported in 3D.

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

        public void setAngleAlignment​(MarkerSymbol.AngleAlignment angleAlignment)
        Sets the symbol AngleAlignment of the multilayer point symbol, rotating the symbol to the current getAngle(), either relative to the user's screen or relative to the map.

        Note: This property is only applicable for 2D and is not supported in 3D.

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