Can be used almost exactly like addPolylines but instead of
pathOptions you can use arrowheadOptions. See
leaflet-arrowheads
for further details.
Usage
addArrowhead(
map,
lng = NULL,
lat = NULL,
layerId = NULL,
group = NULL,
stroke = TRUE,
color = "#03F",
weight = 5,
opacity = 0.5,
fill = FALSE,
fillColor = color,
fillOpacity = 0.2,
dashArray = NULL,
smoothFactor = 1,
noClip = FALSE,
popup = NULL,
popupOptions = NULL,
label = NULL,
labelOptions = NULL,
options = arrowheadOptions(),
highlightOptions = NULL,
data = getMapData(map)
)Arguments
- map
a map widget object created from
leaflet()- lng
a numeric vector of longitudes, or a one-sided formula of the form
~xwherexis a variable indata; by default (if not explicitly provided), it will be automatically inferred fromdataby looking for a column namedlng,long, orlongitude(case-insensitively)- lat
a vector of latitudes or a formula (similar to the
lngargument; the nameslatandlatitudeare used when guessing the latitude column fromdata)- layerId
the layer id
- group
the name of the group the newly created layers should belong to (for
clearGroupandaddLayersControlpurposes). Human-friendly group names are permitted–they need not be short, identifier-style names. Any number of layers and even different types of layers (e.g. markers and polygons) can share the same group name.- stroke
whether to draw stroke along the path (e.g. the borders of polygons or circles)
- color
stroke color
- weight
stroke width in pixels
- opacity
stroke opacity (or layer opacity for tile layers)
- fill
whether to fill the path with color (e.g. filling on polygons or circles)
- fillColor
fill color
- fillOpacity
fill opacity
- dashArray
a string that defines the stroke dash pattern
- smoothFactor
how much to simplify the polyline on each zoom level (more means better performance and less accurate representation)
- noClip
whether to disable polyline clipping
- popup
a character vector of the HTML content for the popups (you are recommended to escape the text using
htmlEscape()for security reasons)- popupOptions
A Vector of
popupOptionsto provide popups- label
a character vector of the HTML content for the labels
- labelOptions
A Vector of
labelOptionsto provide label options for each label. DefaultNULL- options
A named list of options. See
arrowheadOptions- highlightOptions
Options for highlighting the shape on mouse over.
- data
the data object from which the argument values are derived; by default, it is the
dataobject provided toleaflet()initially, but can be overridden
See also
Other Arrowhead Functions:
arrowheadOptions(),
clearArrowhead(),
removeArrowhead()