addcluster_standard: Add standard marker-points

View source: R/addpoly_legend.R

addcluster_standardR Documentation

Add standard marker-points

Description

Standard function for adding marker points layer to leaflet object, colored by a palette function

Usage

addcluster_standard(
  leafletobj,
  var,
  pal_funct,
  grp,
  labvar,
  popuptext,
  clusterpoints = T,
  radius = 0.1,
  weight = 20,
  df = leaflet::getMapData(leafletobj),
  .popup_maxheight = 200,
  .popup_maxwidth = 200,
  .label_padding = "0.2px 0.2px",
  .label_lineheight = 0.8,
  .label_textsize = "10px",
  .label_opacity = 0.8
)

Arguments

leafletobj

Leaflet object

var

Variable layer is being colored by as character string

pal_funct

Palette function to color variable by, created by one of leaflet's color functions

grp

Group layer belongs to

labvar

Label to show when hover over a point; can feed either a data-masked variable name, or a set of labels created by leafletwrappers::label_standard function

popuptext

Labels to show in pop-up over point, created by leafletwrappers::label_output function

clusterpoints

Whether to cluster points; default true

radius

Radius of points; default 0.1. To size by a variable, can feed a formula with the sqrt() of a data-masked variable; e.g., ~ sqrt(unitsize)

weight

Weight of points; default 20

df

Spatial dataframe behind layer; default leaflet::getMapData(leafletobj)

.popup_maxheight

Maximum height of pop-up window; default 200

.popup_maxwidth

Maximum width of pop-up window; default 200

.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


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