public class

LabelStyleBuilder

extends BillboardStyleBuilder
java.lang.Object
   ↳ com.carto.styles.StyleBuilder
     ↳ com.carto.styles.BillboardStyleBuilder
       ↳ com.carto.styles.LabelStyleBuilder
Known Direct Subclasses

Class Overview

A builder class for LabelStyle.

Summary

Public Constructors
LabelStyleBuilder()
Constructs a LabelStyleBuilder object with all parameters set to defaults.
Public Methods
LabelStyle buildStyle()
Builds a new instance of the LabelStyle object using previously set parameters.
synchronized void delete()
float getAnchorPointX()
Returns the horizontal anchor point of the label.
float getAnchorPointY()
Returns the vertical anchor point of the label.
BillboardOrientation getOrientationMode()
Returns the orientation mode of the label.
float getRenderScale()
Returns the relative rendering scale for the label.
BillboardScaling getScalingMode()
Returns the scaling mode of the label.
boolean isFlippable()
Returns the state of the flippable flag.
void setAnchorPoint(float anchorPointX, float anchorPointY)
Sets the anchor point for the label.
void setAnchorPointX(float anchorPointX)
Sets the horizontal anchor point of the label.
void setAnchorPointY(float anchorPointY)
Sets the vertical anchor point of the label.
void setFlippable(boolean flippable)
Sets the state of the flippable flag.
void setOrientationMode(BillboardOrientation orientationMode)
Sets the orientation mode for the label.
void setRenderScale(float renderScale)
Sets the relative rendering scale for the label.
void setScalingMode(BillboardScaling scalingMode)
Sets the scaling mode for the label.
[Expand]
Inherited Methods
From class com.carto.styles.BillboardStyleBuilder
From class com.carto.styles.StyleBuilder
From class java.lang.Object

Public Constructors

public LabelStyleBuilder ()

Constructs a LabelStyleBuilder object with all parameters set to defaults.

Public Methods

public LabelStyle buildStyle ()

Builds a new instance of the LabelStyle object using previously set parameters.

Returns
  • A new LabelStyle object.

public synchronized void delete ()

public float getAnchorPointX ()

Returns the horizontal anchor point of the label.

Returns
  • The horizontal anchor point of the label.

public float getAnchorPointY ()

Returns the vertical anchor point of the label.

Returns
  • The vertical anchor point of the label.

public BillboardOrientation getOrientationMode ()

Returns the orientation mode of the label.

Returns
  • The orientation mode of the label.

public float getRenderScale ()

Returns the relative rendering scale for the label.

Returns
  • The relative rendering scale for the label.

public BillboardScaling getScalingMode ()

Returns the scaling mode of the label.

Returns
  • The scaling mode of the label.

public boolean isFlippable ()

Returns the state of the flippable flag.

Returns
  • True if the label is flippable.

public void setAnchorPoint (float anchorPointX, float anchorPointY)

Sets the anchor point for the label. Values will be clamped to [-1, 1] range.

Parameters
anchorPointX The new horizontal anchor point for the label. -1 means the left side,
0 the center and 1 the right side of the label. The default is 0.
anchorPointY The vertical anchor point for the label. -1 means the bottom,
0 the center and 1 the top of the label. The default is -1.

public void setAnchorPointX (float anchorPointX)

Sets the horizontal anchor point of the label.

Parameters
anchorPointX The new horizontal anchor point for the label. -1 means the left side,
0 the center and 1 the right side of the label. The default is 0.

public void setAnchorPointY (float anchorPointY)

Sets the vertical anchor point of the label.

Parameters
anchorPointY The vertical anchor point for the label. -1 means the bottom,
0 the center and 1 the top of the label. The default is -1.

public void setFlippable (boolean flippable)

Sets the state of the flippable flag. If set to true and the orientation mode is set to
GROUND the label is allowed to flip 180 degrees to try and face the camera better. This is
useful for street names and some other texts. The default is true.

Parameters
flippable The new state of the flippable flag.

public void setOrientationMode (BillboardOrientation orientationMode)

Sets the orientation mode for the label. The default is BillboardOrientation::FACE_CAMERA_BILLBOARD.

Parameters
orientationMode The new orientation mode for the label.

public void setRenderScale (float renderScale)

Sets the relative rendering scale for the label. The default is 1.0. For sharper labels, this should be larger.

Parameters
renderScale The new rendering scale value.

public void setScalingMode (BillboardScaling scalingMode)

Sets the scaling mode for the label. The default is BillboardScaling::CONST_SCREEN_SIZE.

Parameters
scalingMode The new scaling mode for the label.