add_circle_layer {mapboxer} | R Documentation |
Add a circle layer to the map
Description
Add a circle layer to the map
Usage
add_circle_layer(map, source = NULL, filter = NULL,
circle_blur = NULL, circle_color = NULL, circle_opacity = NULL,
circle_pitch_alignment = NULL, circle_pitch_scale = NULL,
circle_radius = NULL, circle_sort_key = NULL,
circle_stroke_color = NULL, circle_stroke_opacity = NULL,
circle_stroke_width = NULL, circle_translate = NULL,
circle_translate_anchor = NULL, visibility = TRUE, popup = NULL,
id = "circle-layer")
Arguments
map |
A mapboxer object. |
source |
A Mapbox source. Uses the source from the mapboxer object if no source is supplied. |
filter |
A filter expression that is applied to the |
circle_blur |
(paint) Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. |
circle_color |
(paint) The fill color of the circle. |
circle_opacity |
(paint) The opacity at which the circle will be drawn. |
circle_pitch_alignment |
(paint) Orientation of circle when map is pitched. One of "map", "viewport". |
circle_pitch_scale |
(paint) Controls the scaling behavior of the circle when the map is pitched. One of "map", "viewport". |
circle_radius |
(paint) The radius of the circle. |
circle_sort_key |
(layout) Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key. |
circle_stroke_color |
(paint) The stroke color of the circle. |
circle_stroke_opacity |
(paint) The opacity of the circle's stroke. |
circle_stroke_width |
(paint) The width of the circle's stroke.
Strokes are placed outside of the |
circle_translate |
(paint) The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. |
circle_translate_anchor |
(paint) Controls the frame of reference for |
visibility |
(layout) Whether the layer should be displayed. |
popup |
A mustache template in which the tags refer to the properties of the layer's data object. |
id |
The unique id of the layer. |
See Also
https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#circle
Examples
map <- as_mapbox_source(motor_vehicle_collisions_nyc) %>%
mapboxer() %>%
set_view_state(-73.9165, 40.7114, 11) %>%
add_circle_layer(
circle_color = "red",
circle_radius = 5,
popup = "{{date}} {{time}}"
)
if (interactive()) map