Skip to content
Nutiteq edited this page Jul 23, 2013 · 5 revisions

Customize DefaultLabel

DefaultLabel takes LabelStyle object as third parameter. Here is customized description of the label:

        label = new DefaultLabel("Title","This is\nmulti-line\ndescription",
                LabelStyle.builder()
                    .setDescriptionAlign(Align.LEFT)
                    .setDescriptionFont(Typeface.create("Arial", Typeface.NORMAL), 32)
                    .build());

See also Different device resolutions how to reconfigure Labels and other display parameters based on device DPI.

Create own custom label

You can also create completely new Label: extend abstract class Label, write own code to drawMarkerLabel() method, and use this.

See source of the basic default label with 1 or 2 lines DefaultLabel.java to have idea about API of Label and how this can be implemented. Like in sample, it is probably easiest to use Bitmap canvas where texts (and possibly graphics) is painted.

Clone this wiki locally