The plugin allows to avoid cluttering in marker labels and gives priority to labels of your choice (with higher weight).
addLabelgun(map, group = NULL, weight = NULL, entries = NULL)
A map widget object created from leaflet
The group name of the layer/s for which label collisions are
to be avoided.
To see the effects of this plugin the labelOptions
of the markers must be
configured with either permanent = TRUE
or noHide = TRUE
.
An optional weight for markers. If a vector is given, the length should match the number of all markers in the corresponding groups. If a numeric value is specified, it is used for each marker and thus no prioritization of the labels takes place. In all other cases a random integer is calculated.
A numeric value, a higher value relates to faster insertion and slower search, and vice versa. The default is 10
A leaflet map object
It is important to invoke the function after the markers have been added to the map. Otherwise nothing will happen.