Enum Class SymbolMBLayer.TextAnchor

All Implemented Interfaces:
Serializable, Comparable<SymbolMBLayer.TextAnchor>, Constable
Enclosing class:
SymbolMBLayer

public static enum SymbolMBLayer.TextAnchor extends Enum<SymbolMBLayer.TextAnchor>
Text justification options.
  • Enum Constant Details

    • CENTER

      public static final SymbolMBLayer.TextAnchor CENTER
      The center of the text is placed closest to the anchor.
    • LEFT

      public static final SymbolMBLayer.TextAnchor LEFT
      The left side of the text is placed closest to the anchor.
    • TOP

      public static final SymbolMBLayer.TextAnchor TOP
      The top of the text is placed closest to the anchor.
    • BOTTOM

      public static final SymbolMBLayer.TextAnchor BOTTOM
      The bottom of the text is placed closest to the anchor.
    • TOP_LEFT

      public static final SymbolMBLayer.TextAnchor TOP_LEFT
      The top left corner of the text is placed closest to the anchor.
    • TOP_RIGHT

      public static final SymbolMBLayer.TextAnchor TOP_RIGHT
      The top right corner of the text is placed closest to the anchor.
    • BOTTOM_LEFT

      public static final SymbolMBLayer.TextAnchor BOTTOM_LEFT
      The bottom left corner of the text is placed closest to the anchor.
    • BOTTOM_RIGHT

      public static final SymbolMBLayer.TextAnchor BOTTOM_RIGHT
      The bottom right corner of the text is placed closest to the anchor.
  • Method Details

    • values

      public static SymbolMBLayer.TextAnchor[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SymbolMBLayer.TextAnchor valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getX

      public double getX()
      Horizontal justification.
      Returns:
      horizontal alignment between 0.0 and 1.0.
    • getY

      public double getY()
      Vertical justification.
      Returns:
      vertical alignment between 0.0 and 1.0.
    • parse

      public static SymbolMBLayer.TextAnchor parse(String jsonString)
      Parse provided jsonString as a TextAnchor.

      One of center, left, right, top, bottom, top-left, top-right, bottom-left, bottom-right. Defaults to center.

      Parameters:
      jsonString - text anchor definition
      Returns:
      TextAnchor, defaults TextAnchor#CENTER if undefined
    • json

      public String json()
      The json representation of this TextAnchor.
      Returns:
      json representation
    • getAnchorY

      public static double getAnchorY(String jsonString)
      Quickly grab y justification for jsonString.
      Parameters:
      jsonString - text anchor definition
      Returns:
      vertical anchor, defaults to 0.5
    • getAnchorX

      public static double getAnchorX(String jsonString)
      Quickly grab x justification for jsonString.
      Parameters:
      jsonString - text anchor definition
      Returns:
      horizontal anchor, defaults to 0.5