Create Map Symbols for 'leaflet' maps
Usage
makeSymbol(
shape,
width,
height = width,
color,
fillColor = color,
opacity = 1,
fillOpacity = opacity,
...
)
makeSymbolIcons(
shape = c("rect", "circle", "triangle", "plus", "cross", "diamond", "star",
"stadium", "line", "polygon"),
color,
fillColor = color,
opacity,
fillOpacity = opacity,
strokeWidth = 1,
width,
height = width,
...
)
addSymbols(
map,
lng,
lat,
values,
shape = c("rect", "circle", "triangle", "plus", "cross", "diamond", "star"),
color,
fillColor = color,
opacity = 1,
fillOpacity = opacity,
strokeWidth = 1,
width = 20,
height = width,
data = leaflet::getMapData(map),
...
)
addSymbolsSize(
map,
lng,
lat,
values,
shape = c("rect", "circle", "triangle", "plus", "cross", "diamond", "star"),
color,
fillColor = color,
opacity = 1,
fillOpacity = opacity,
strokeWidth = 1,
baseSize = 20,
data = leaflet::getMapData(map),
...
)
sizeNumeric(values, baseSize)
sizeBreaks(values, breaks, baseSize, ...)
makeSymbolsSize(
values,
shape = c("rect", "circle", "triangle", "plus", "cross", "diamond", "star",
"stadium", "polygon"),
color,
fillColor,
opacity = 1,
fillOpacity = opacity,
strokeWidth = 1,
baseSize,
...
)
Arguments
- shape
the desired shape of the symbol
- width
in pixels
- height
in pixels
- color
stroke color
- fillColor
fill color
- opacity
stroke opacity
- fillOpacity
fill opacity
- ...
arguments to pass to
pretty
- strokeWidth
stroke width in pixels
- map
a map widget object created from 'leaflet'
- lng
a numeric vector of longitudes, or a one-sided formula of the form
~x
wherex
is a variable indata
; by default (if not explicitly provided), it will be automatically inferred from data by looking for a column namedlng
,long
, orlongitude
(case-insensitively)- lat
a vector of latitudes or a formula (similar to the
lng
argument; the nameslat
andlatitude
are used when guessing the latitude column fromdata
)- values
the values used to generate shapes; can be omitted for a single type of shape
- data
the data object from which the argument values are derived; by default, it is the
data
object provided toleaflet()
initially, but can be overridden- baseSize
re-scaling size in pixels of the mean of the values, the average value will be this exact size
- breaks
an integer specifying the number of breaks or a numeric vector of the breaks