Skip to contents

The viz_tile function adds raster zoomable tiles to a map It requires a Mercator projection.

Usage

viz_tile(
  map,
  id = NULL,
  tileSize = 512,
  zoomDelta = 1,
  opacity = 1,
  url = "openstreetmap",
  clipPath = NULL
)

Arguments

map

A geovizr map object created using viz_create().

id

character. Optional. Unique layer id.

tileSize

numeric. Optional. Tile size (default 512).

zoomDelta

numeric. Optional. Zoom offset (default 1).

opacity

numeric. Optional. Tile opacity (default 1).

url

function or character. Optional. Tile source URL or preset ("openstreetmap", "opentopomap", "worldterrain", "worldimagery", "worldStreet", "worldphysical", "shadedrelief", "stamenterrain", "cartodbvoyager", "stamentoner", "stamentonerbackground", "stamentonerlite", "stamenwatercolor", "hillshade", "worldocean", "natgeo").

clipPath

character. Optional. SVG clip-path definition (e.g. "url(#myclipid)").

Value

A modified `geoviz` map object with a new layer added. Rendering is performed using viz_render().

Examples

viz_create(projection = "mercator") |>
  viz_tile(url = "worldphysical") |>
  viz_render()