addStaticLabels {mapview} | R Documentation |
leaflet
or mapview
objectsBeing a wrapper around addLabelOnlyMarkers
, this
function provides a smart-and-easy solution to add custom text labels to an
existing leaflet
or mapview
map object.
addStaticLabels(map, data, label, group = NULL, layerId = NULL, ...)
map |
A |
data |
A |
label |
The labels to be placed at the positions indicated by 'data' as
|
group |
the group of the static labels layer. |
layerId |
the layerId of the static labels layer. |
... |
Additional arguments passed to
|
This function is deprecated.
Please use leafem::addStaticLabels
instead.
A labelled mapview object.
Florian Detsch
addStaticLabels
, addLabelOnlyMarkers
.
## Not run: ## leaflet label display options library(leaflet) lopt = labelOptions(noHide = TRUE, direction = 'top', textOnly = TRUE) ## point labels m1 = mapview(breweries) l1 = addStaticLabels(m1, label = breweries$number.of.types, labelOptions = lopt) l1 ## polygon centroid labels m2 = mapview(franconia) l2 = addStaticLabels(m2, label = franconia$NAME_ASCI, labelOptions = lopt) l2 ## custom labels m3 = m2 + m1 l3 = addStaticLabels(m3, data = franconia, label = franconia$NAME_ASCI, labelOptions = lopt) l3 ## End(Not run)