Skip to contents

Labels

Usage

bt_label(
  bertin,
  data,
  values,
  fill = "#474342",
  fontSize = 10,
  fontFamily = "Roboto",
  textDecoration = "none",
  fontWeight = "normal",
  fontStyle = "normal",
  opacity = 1,
  halo = FALSE,
  halo_style = c("white", 4, 0.5),
  display = TRUE
)

Arguments

bertin

map object

data

sf object EPSG:4326

values

a string corresponding to the targeted variable in the properties

fill

fill color

fontSize

text size

fontFamily

font family

textDecoration

text decoration.

fontWeight

font weight. "normal", "bold", "bolder", "lighter"

fontStyle

font style

opacity

opacity of the object

halo

boolean to display a halo below the text

halo_style

an array defining the halo style. [color, thickness, opacity]

display

Boolean to allow to show or hide the layer. This parameter has no effect on the calculation of the extent

Value

map object

Examples

library(sf)
world <- st_read(system.file("gpkg/world.gpkg", package = "bertin"),
                 layer = "world", quiet = TRUE)
bt_param(projection = "Mercator", clip = TRUE) |>
  bt_layer(data = world) |>
  bt_label(data = world, values = "name") |>
  bt_draw()