text

fun text(field: String, block: MvtTextBuilder.() -> Unit = {})

Declare a text label for matching features. field names the feature property to read for the label string (typically "name"). Configure color / size / halo / placement via the MvtTextBuilder receiver. Default placement is POINT (matches POINT features); set placement = MvtStyleRule.LabelPlacement.LINE to label LINESTRING features at their midpoint along the local tangent.

paint {
text("name") {
placement = MvtStyleRule.LabelPlacement.LINE
color(Color(1f, 1f, 1f))
size = MvtZoomInterp.floats(13 to 12f, 16 to 16f)
halo(Color(0f, 0f, 0f), 2f)
}
}