Thin wrapper around serve_html() that renders x with mapview::mapview() first, so mapview arguments such as zcol or map.types can be passed straight through.

serve_map(x, ..., host = NULL, name = NULL, quiet = FALSE)

Arguments

x

An sf object, or anything else mapview::mapview() accepts. A mapview object is served as is.

...

Further arguments passed to mapview::mapview(), such as zcol or map.types.

host

Hostname to advertise in the URL. If NULL, resolved the same way as in serve_plots().

name

Optional label used in the file name, to tell several served pages apart. Non-alphanumeric characters are replaced with -.

quiet

If TRUE, do not message the URL.

Value

The page URL, invisibly, as a character scalar.

Examples

# \donttest{
if (interactive()) {
  pts <- sf::st_sf(
    id = 1:2,
    geometry = sf::st_sfc(
      sf::st_point(c(-49.25, -16.68)),
      sf::st_point(c(-49.30, -16.70)),
      crs = 4326
    )
  )
  serve_map(pts, zcol = "id")
}
# }