View source: R/addpoly_legend.R
addpoly_standard | R Documentation |
Add Polygons A function to add a filled-in polygon layer coloring the polygon by the provided variable
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 )
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 |
A polygon layer in a leaflet map
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.