addpoly_legend: Add standard polygon/legend

View source: R/addpoly_legend.R

addpoly_legendR Documentation

Add standard polygon/legend

Description

A function to add a standardized legend/polygon to a leaflet map

Usage

addpoly_legend(
  basemap_select,
  df_select,
  pal_funct_select,
  variable_select,
  group_select,
  title_select,
  labels_select,
  .legopacity = 0.7,
  .polopacity = 1,
  .polfillopacity = 0.4,
  .polweight = 1,
  .pollinecolor = "transparent",
  .data = leaflet::getMapData(basemap_select),
  ...
)

Arguments

basemap_select

A leaflet basemap

df_select

A spatial dataframe with the geography stripped

pal_funct_select

A color function; e.g. leafletwrappers::color_numeric will often be approriate for numeric functions

variable_select

A variable to color in the polygon from the spatial dataframe, supplied as a string

group_select

A group for the legend/polygon

title_select

The title of the legend/polygon

labels_select

A list of labels corresponding to the length of the dataframe to appear as pop-ups

.legopacity

The opacity of the polygon legend. Default value of 0.7

.polopacity

The opacity of the polygon lines. Default value of 1

.polfillopacity

The opacity of the colors inside the polygons. Default value of 0.4

.polweight

The weight of the polygon lines. Default value of 1

.pollinecolor

The color of the polygon lines. Default value of transparent

.data

A spatial dataframe. Defaults to the basemap dataframe; if the data being visualized is different from the dataframe used in the basemap, supply the other dataframe here

...

Extra label arguments to supply to addpoly_standard


dpowerstp/leafletwrappers documentation built on Sept. 4, 2022, 10:19 a.m.