Add Circle sectors to a Leaflet map from a dataframe using bearing and spread
addCircleSectorMid.Rd
This methor wraps the setSector
method of
Leaflet.Circle-sector,
a Leaflet plugin extending L.Circle.
Usage
addCircleSectorMid(
map,
data,
lat = "lat",
lon = "lon",
bearing = "bearing",
angle = "angle",
radius = "radius",
weight = "weight",
colour = "colour",
label = "label",
popup = "popup"
)
Arguments
- map
A leaflet map
- data
A data frame where each row represents on circle sector and columns for lat, lon, min, mid, max.
- lat
The column name as string holding the Latitude of the circle mid point on the map in WGS 84 decimal degrees. Default: "lat".
- lon
The column name as string holding the Longitude of the circle mid point on the map in WGS 84 decimal degrees. Default: "lon".
- bearing
The column name as string holding the main bearing of the sector in decimal degrees, counted clockwise from North. Default: "bearing".
- angle
max The column name as string holding the angle of the sector in decimal degrees, which will be centered on the main direction
mid
. Default: "angle".- radius
The column name as string holding the radius of the circle in metres. Default: "radius".
- weight
The column name as string holding the weight of the circle. Default: "weight.
- colour
The column name as string holding the colour of the circle. Default: "colour". Example values: "blue", "red", "#3388ff".
- label
The column name as string holding the label content of the circle. Default: "label".
- popup
The column name as string holding the popup content of the circle. Default: "popup".
See also
Other plugin:
addCircleSectorMinMax()
,
circlePlugin()
,
leaflet_basemap()
,
registerPlugin()
Examples
if (FALSE) {
data("fans_mean")
leaflet_basemap(l_height = 500, l_width = 700) %>%
leaflet::clearBounds() %>%
addCircleSectorMid(data = fans_mean)
}