public class

Text

extends Label
java.lang.Object
   ↳ com.carto.vectorelements.VectorElement
     ↳ com.carto.vectorelements.Billboard
       ↳ com.carto.vectorelements.Label
         ↳ com.carto.vectorelements.Text

Class Overview

A text element that can be displayed on the map.

Summary

Public Constructors
Text(Billboard baseBillboard, TextStyle style, String text)
Constructs a Text object with the specified style and attaches it to a billboard element.
Text(Geometry geometry, TextStyle style, String text)
Constructs a Text object from a geometry object and a style.
Text(MapPos pos, TextStyle style, String text)
Constructs a Text object from a map position and a style.
Public Methods
synchronized void delete()
Bitmap drawBitmap(float dpToPX)
Draws a custom bitmap for this label that will be used for drawing the label on the map.
TextStyle getStyle()
Returns the style of this text label.
String getText()
Returns the display text.
void setStyle(TextStyle style)
Sets the style for this text label.
void setText(String text)
Sets the display text.
[Expand]
Inherited Methods
From class com.carto.vectorelements.Label
From class com.carto.vectorelements.Billboard
From class com.carto.vectorelements.VectorElement
From class java.lang.Object

Public Constructors

public Text (Billboard baseBillboard, TextStyle style, String text)

Constructs a Text object with the specified style and attaches it to a billboard element.

Parameters
baseBillboard The billboard this text label will be attached to.
style The style that defines what this text label looks like.
text The text to be displayed.

public Text (Geometry geometry, TextStyle style, String text)

Constructs a Text object from a geometry object and a style.

Parameters
geometry The geometry object that defines the location of this text label.
style The style that defines what this text label looks like.
text The text to be displayed.

public Text (MapPos pos, TextStyle style, String text)

Constructs a Text object from a map position and a style.

Parameters
pos The map position that defines the location of this text label.
style The style that defines what this text label looks like.
text The text to be displayed.

Public Methods

public synchronized void delete ()

public Bitmap drawBitmap (float dpToPX)

Draws a custom bitmap for this label that will be used for drawing the label on the map.
The method is called each time the label gets reloaded internally.

Parameters
dpToPX The value used for converting display independent pixels (dp) to pixels (px).
Returns
  • The custom label bitmap.

public TextStyle getStyle ()

Returns the style of this text label.

Returns
  • The style that defines what this text label looks like.

public String getText ()

Returns the display text.

Returns
  • The display text.

public void setStyle (TextStyle style)

Sets the style for this text label.

Parameters
style The new style that defines what this text label looks like.

public void setText (String text)

Sets the display text.

Parameters
text The text to be displayed.