Skip to contents

Mercator Tiles

Usage

bt_tiles(
  bertin,
  style = "opentopomap",
  zoomDelta = 0,
  tileSize = 512,
  opacity = 1,
  clip,
  source = c(100, 200),
  increasetilesize = 1,
  display = 1
)

Arguments

bertin

map object

style

tile style'openstreetmap', 'opentopomap', 'worldterrain', 'worldimagery', 'worldStreet', 'worldphysical', 'shadedrelief', 'oceanbasemap'

zoomDelta

zoom offset

tileSize

tile size

opacity

opacity of the object

clip

a boolean to avoid artifacts of discontinuous projection

source

position of the text. It can be an array with x,y coordinates. For example [100,200]. It can be also a string defining the position.'topleft', 'top', 'topright', 'left', 'middle', 'right', 'bottomleft', 'bottom', 'bottomright'

increasetilesize

a value to slightly increase the size of the tiles solve the problem of gap between the tiles with chromium

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)
italy <- world[world$name == "Italy",]
bt_param(projection = "Mercator", clip = TRUE, extent = italy) |>
  bt_tiles(style = "worldphysical") |>
  bt_draw()