Learn R Programming

simplevis (version 3.0.0)

leaflet_sf: Map of simple features in leaflet.

Description

Map of simple features in leaflet that is not coloured.

Usage

leaflet_sf(data, popup_var = NULL, pal = NULL, size_point = 2,
  size_line = 2, alpha = 0.9, basemap = "light", title = "[Title]",
  col_labels_dp = 1, col_labels = "[Feature]", map_id = "map")

Arguments

data

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

popup_var

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

pal

Character vector of hex codes. Defaults to viridis. Use the pals package to find a suitable palette.

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 the fill within features (i.e. fillOpacity). Defaults to 0.9.

basemap

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

title

A title string that will be wrapped into the legend. Defaults to "Title"

col_labels_dp

Select the appropriate number of decimal places for numeric variable auto legend labels. Defaults to 1.

col_labels

A vector of legend label values. Defaults to "[Feature]".

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)
# }

Run the code above in your browser using DataLab