% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/legend.R
\name{mapSymbols}
\alias{mapSymbols}
\alias{makeSymbol}
\alias{makeSvgUri}
\alias{makeSymbolIcons}
\alias{addSymbols}
\alias{addSymbolsSize}
\alias{sizeNumeric}
\alias{sizeBreaks}
\alias{makeSymbolsSize}
\title{Create Map Symbols for 'leaflet' maps}
\usage{
makeSymbol(
  shape,
  width,
  height = width,
  color,
  fillColor = color,
  opacity = 1,
  fillOpacity = opacity,
  label = NULL,
  ...
)

makeSvgUri(svg, width, height, strokeWidth)

makeSymbolIcons(
  shape,
  color,
  fillColor = color,
  opacity,
  fillOpacity = opacity,
  strokeWidth = 1,
  width,
  height = width,
  label = NULL,
  ...
)

addSymbols(
  map,
  lng,
  lat,
  values,
  shape,
  color,
  fillColor = color,
  opacity = 1,
  fillOpacity = opacity,
  strokeWidth = 1,
  width = 20,
  height = width,
  dashArray = NULL,
  label = NULL,
  data = leaflet::getMapData(map),
  ...
)

addSymbolsSize(
  map,
  lng,
  lat,
  values,
  shape,
  color,
  fillColor = color,
  opacity = 1,
  fillOpacity = opacity,
  strokeWidth = 1,
  baseSize = 20,
  minSize = NULL,
  maxSize = NULL,
  data = leaflet::getMapData(map),
  ...
)

sizeNumeric(
  values,
  baseSize,
  minSize = NULL,
  maxSize = NULL,
  centerPoint = mean(values, na.rm = TRUE)
)

sizeBreaks(values, breaks, baseSize, minSize = NULL, maxSize = NULL, ...)

makeSymbolsSize(
  values,
  shape = "rect",
  color,
  fillColor,
  opacity = 1,
  fillOpacity = opacity,
  strokeWidth = 1,
  baseSize,
  minSize = NULL,
  maxSize = NULL,
  ...
)
}
\arguments{
\item{shape}{the desired shape of the symbol, See \link[leaflegend]{availableShapes}}

\item{width}{in pixels}

\item{height}{in pixels}

\item{color}{stroke color}

\item{fillColor}{fill color}

\item{opacity}{stroke opacity}

\item{fillOpacity}{fill opacity}

\item{label}{a character vector of labels to display at the center of each symbol}

\item{...}{arguments to pass to \code{pretty}}

\item{svg}{inner svg tags for symbol}

\item{strokeWidth}{stroke width in pixels}

\item{map}{a map widget object created from 'leaflet'}

\item{lng}{a numeric vector of longitudes, or a one-sided formula of the form \code{~x}
where \code{x} is a variable in \code{data}; by default
(if not explicitly provided), it will be automatically inferred from data
by looking for a column named \code{lng}, \code{long}, or \code{longitude}
(case-insensitively)}

\item{lat}{a vector of latitudes or a formula (similar to the \code{lng} argument; the
names \code{lat} and \code{latitude} are used when guessing the latitude
column from \code{data})}

\item{values}{the values used to generate shapes; can be omitted for a single type of
shape}

\item{dashArray}{a string or vector/list of strings that defines the stroke dash pattern}

\item{data}{the data object from which the argument values are derived; by default, it
is the \code{data} object provided to \code{leaflet()} initially, but can be
overridden}

\item{baseSize}{re-scaling size in pixels of the mean of the values, the average value will
be this exact size}

\item{minSize}{minimum size in pixels of a symbol; values that would scale below this are
clamped to \code{minSize}; \code{baseSize} must be greater than \code{minSize}}

\item{maxSize}{maximum size in pixels of a symbol; values that would scale above this are
clamped to \code{maxSize}; \code{baseSize} must be less than \code{maxSize}}

\item{centerPoint}{the value used as the center of the scaling; defaults to the mean of
\code{values}; the symbol for \code{centerPoint} will be exactly
\code{baseSize} pixels}

\item{breaks}{an integer specifying the number of breaks or a numeric vector of the breaks;
if a named vector then the names are used as labels.}
}
\value{
HTML svg element
}
\description{
Create Map Symbols for 'leaflet' maps
}
\examples{
library(leaflet)
data(quakes)

# symbol with a label centered inside
makeSymbol('circle', width = 24, color = 'black', fillColor = 'steelblue',
           fillOpacity = 0.8, label = 'A')

# map markers with per-point labels
quakes$label <- as.character(seq_len(nrow(quakes)))
leaflet(quakes[1:20, ]) \%>\%
  addTiles() \%>\%
  addSymbols(lat = ~lat, lng = ~long, color = 'black',
             fillColor = 'steelblue', fillOpacity = 0.8,
             label = ~label)

}
