addpoly_standard: Add Polygons A function to add a filled-in polygon layer...

View source: R/addpoly_legend.R

addpoly_standardR Documentation

Add Polygons A function to add a filled-in polygon layer coloring the polygon by the provided variable

Description

Add Polygons A function to add a filled-in polygon layer coloring the polygon by the provided variable

Usage

addpoly_standard(
  basemap,
  df,
  pal_funct,
  variable,
  group,
  labels,
  .weight = 1,
  .color = "transparent",
  .opacity = 1,
  .fillopacity = 0.4,
  .data = leaflet::getMapData(basemap),
  .label_padding = "0.2px 0.2px",
  .label_lineheight = 0.8,
  .label_textsize = "10px",
  .label_opacity = 0.8
)

Arguments

basemap

A leaflet basemap

df

A spatial dataframe with the geography stripped that provides data visualized in the polygon

pal_funct

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

variable

The variable to visualize in the polygon from the provided dataframe

group

The group-name of the polygon; a string

labels

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

.weight

The weight of the polygon lines. Default value of 1

.color

The opacity of the polygon lines. Default value of 1

.opacity

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

.fillopacity

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

.label_padding

Label padding of label; default

.label_lineheight

Label line-height; default 0.8

.label_textsize

Label textsize; default "10px"

.label_opacity

Label opacity; default 0.8

Value

A polygon layer in a leaflet map


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