Class SymbolAnchor


  • public final class SymbolAnchor
    extends Object
    Represents the anchor point of a symbol layer, including placement mode and anchor position values. Instances of this class are immutable. To change the symbol anchor values on a MarkerSymbolLayer, create a new SymbolAnchor and set it on the symbol layer with MarkerSymbolLayer.setAnchor(SymbolAnchor).
    Since:
    100.5.0
    • Constructor Detail

      • SymbolAnchor

        public SymbolAnchor​(double x,
                            double y,
                            SymbolAnchor.PlacementMode placementMode)
        Creates a symbol anchor with the given anchor values and placement mode.
        Parameters:
        x - the X anchor value
        y - the Y anchor value
        placementMode - the placement mode
        Throws:
        IllegalArgumentException - if placementMode is null
        Since:
        100.5.0
    • Method Detail

      • getX

        public double getX()
        Gets the x-component of the symbol anchor. The x-component can be any real number. The units of the value depend on the SymbolAnchor.PlacementMode. The default value is 0, regardless of placement mode.
        Returns:
        the x-component
        Since:
        100.5.0
      • getY

        public double getY()
        Gets the y-component of the symbol anchor. The y-component can be any real number. The units of the value depend on the SymbolAnchor.PlacementMode. The default value is 0, regardless of placement mode.
        Returns:
        the y-component
        Since:
        100.5.0