Learn R Programming

simplevis (version 5.0.0)

leaflet_sf: Simple feature leaflet map.

Description

Map of simple features in leaflet that is not coloured.

Usage

leaflet_sf(
  data,
  popup_vars_vctr = NULL,
  pal = NULL,
  size_point = 2,
  size_line = 2,
  alpha = NULL,
  basemap = "light",
  map_id = "map"
)

Arguments

data

An sf object of geometry type point/multipoint, linestring/multilinestring or polygon/multipolygon geometry type. Required input.

popup_vars_vctr

Vector of quoted variable names to include in the popup. If NULL, defaults to making a leafpop::popupTable of all columns.

pal

Character vector of hex codes.

size_point

Size of points (i.e. radius). Defaults to 2.

size_line

Size of lines around features (i.e. weight). Defaults to 2.

alpha

The opacity of features. Defaults to 1 for points/lines, or 0.75 for polygons.

basemap

The underlying basemap. Either "light", "dark", "satellite", "street", or "ocean". Defaults to "light". Only applicable where shiny equals FALSE.

map_id

The shiny map id for a leaflet map within a shiny app. For standard single-map apps, id "map" should be used. For dual-map apps, "map1" and "map2" should be used. Defaults to "map".

Value

A leaflet object.

Examples

Run this code
# NOT RUN {
leaflet_sf(example_sf_point)

leaflet_sf(example_sf_polygon)

# }

Run the code above in your browser using DataLab