Label styling through Display Rules
On this page you will gain knowledge of how to style marker labels using Display Rules. NB: the stylings show on this page are only available when using MapsIndoors together with the Mapbox Maps SDK.
Basic styling
MapsIndoors.getMainDisplayRule()?.let { dr ->
// The color of the label as a hex string
val labelTextColor: String? = dr.labelStyleTextColor
// The size of the label in pixels
val labelTextSize: Int? = dr.labelStyleTextSize
// The opacity of the label as a value between 0 and 1
val labelTextOpacity: Float? = dr.labelStyleTextOpacity
// The color of the label's halo
val labelHaloColor: String? = dr.labelStyleHaloColor
// The width of the halo in pixels, this value should not be more than 1/4 of the LabelSize
val labelHaloWidth: Int? = dr.labelStyleHaloWidth
// The distance at which the halo begins to blur, this should not be larger than HaloWidth
val labelHaloBlur: Int? = dr.labelStyleHaloBlur
}Styling the label text

Styling the label halo

Styling text and halo

Changing Label Position
Flat labels



Graphic Labels

Parts of a Graphic Label
Label
Background Image
Content Area
StretchX/StretchY
Showing Graphic Labels
Inserting Custom Graphics
Example






Last updated
Was this helpful?