Package com.massifmaps.vectorelements
Class Text
java.lang.Object
com.massifmaps.vectorelements.VectorElement
com.massifmaps.vectorelements.Billboard
com.massifmaps.vectorelements.Label
com.massifmaps.vectorelements.Text
A text element that can be displayed on the map.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a Text object from a map position and a style.Constructs a Text object from a geometry object and a style.Constructs a Text object with the specified style and attaches it to a billboard element. -
Method Summary
Modifier and TypeMethodDescriptiondrawBitmap(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.getStyle()Returns the style of this text label.getText()Returns the display text.voidSets the style for this text label.voidSets the display text.Methods inherited from class com.massifmaps.vectorelements.Billboard
getBaseBillboard, getBounds, getGeometry, getRootGeometry, getRotation, setBaseBillboard, setGeometry, setPos, setRotationMethods inherited from class com.massifmaps.vectorelements.VectorElement
containsMetaDataKey, equals, getId, getMetaData, getMetaDataElement, hashCode, isVisible, notifyElementChanged, setId, setMetaData, setMetaDataElement, setVisible
-
Constructor Details
-
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.
-
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.
-
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.
-
-
Method Details
-
drawBitmap
Description copied from class:LabelDraws 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.- Overrides:
drawBitmapin classLabel- Parameters:
dpToPX- The value used for converting display independent pixels (dp) to pixels (px).- Returns:
- The custom label bitmap.
-
getText
Returns the display text.- Returns:
- The display text.
-
setText
Sets the display text.- Parameters:
text- The text to be displayed.
-
getStyle
Returns the style of this text label. -
setStyle
Sets the style for this text label.- Parameters:
style- The new style that defines what this text label looks like.
-