Can be used almost exactly like addPolylines
but instead of
pathOptions
you can use antpathOptions
to adapt the
Antpath behaviour. See
leaflet-ant-path
for further details.
addAntpath(
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 = antpathOptions(),
highlightOptions = NULL,
data = getMapData(map)
)
a map widget object created from leaflet()
a numeric vector of longitudes, or a one-sided formula of the form
~x
where x
is a variable in data
; by default (if not
explicitly provided), it will be automatically inferred from data
by
looking for a column named lng
, long
, or longitude
(case-insensitively)
a vector of latitudes or a formula (similar to the lng
argument; the names lat
and latitude
are used when guessing
the latitude column from data
)
the layer id
the name of the group the newly created layers should belong to
(for clearGroup
and addLayersControl
purposes).
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.
whether to draw stroke along the path (e.g. the borders of polygons or circles)
stroke color
stroke width in pixels
stroke opacity (or layer opacity for tile layers)
whether to fill the path with color (e.g. filling on polygons or circles)
fill color
fill opacity
a string that defines the stroke dash pattern
how much to simplify the polyline on each zoom level (more means better performance and less accurate representation)
whether to disable polyline clipping
a character vector of the HTML content for the popups (you are
recommended to escape the text using htmlEscape()
for security reasons)
A Vector of popupOptions
to provide popups
a character vector of the HTML content for the labels
A Vector of labelOptions
to provide label
options for each label. Default NULL
A named list of options. See antpathOptions
Options for highlighting the shape on mouse over.
the data object from which the argument values are derived; by
default, it is the data
object provided to leaflet()
initially, but can be overridden
A modified leaflet map, with an 'ant-path' animated polyline
Other Antpath Functions:
antpathOptions()
,
clearAntpath()
,
removeAntpath()
# NOT RUN {
library(leaflet)
leaflet() %>%
addAntpath(data = atlStorms2005)
# }
Run the code above in your browser using DataLab