Add circles to a google map
add_circles(map, data = get_map_data(map), id = NULL, lat = NULL,
lon = NULL, radius = NULL, draggable = NULL, stroke_colour = NULL,
stroke_opacity = NULL, stroke_weight = NULL, fill_colour = NULL,
fill_opacity = NULL, mouse_over = NULL, mouse_over_group = NULL,
info_window = NULL, layer_id = NULL, z_index = NULL)
a googleway map object created from google_map()
data frame containing at least two columns, one specifying the
latitude coordinates, and the other specifying the longitude. If Null, the
data passed into google_map()
will be used.
string specifying the column containing an identifier for a circle
string specifying the column of data
containing the 'latitude'
coordinates. If left NULL, a best-guess will be made
string specifying the column of data
containing the 'longitude'
coordinates. If left NULL, a best-guess will be made
either a string specifying the column of data
containing the
radius of each circle, OR a numeric value specifying the radius of all the circles
(radius is expressed in metres)
string specifying the column of data
defining if the circle
is 'draggable' (either TRUE or FALSE)
either a string specifying the column of data
containing
the stroke colour of each circle, or a valid hexadecimal numeric HTML style to
be applied to all the circles
either a string specifying the column of data
containing
the stroke opacity of each circle, or a value between 0 and 1 that will be
applied to all the circles
either a string specifying the column of data
containing
the stroke weight of each circle, or a number indicating the width of pixels
in the line to be applied to all the circles
either a string specifying the column of data
containing
the fill colour of each circle, or a valid hexadecimal numeric HTML style to
be applied to all the cirlces
either a string specifying the column of data
containing
the fill opacity of each circle, or a value between 0 and 1 that will be applied to all the circles
string specifying the column of data to display when the mouse rolls over the circle
string specifying the column of data specifying which groups of circles to highlight on mouseover
string specifying the column of data to display in an info window when a circle is clicked
single value specifying an id for the layer. layer.
single value specifying where the circles appear in the layering
of the map objects. Layers with a higher z_index
appear on top of those with
a lower z_index
. See details.
z_index
values define the order in which objects appear on the map.
Those with a higher value appear on top of those with a lower value. The default
order of objects is (1 being underneath all other objects)
1. Polygon
2. Rectangle
3. Polyline
4. Circle
Markers are always the top layer
# NOT RUN {
google_map(key = map_key, data = tram_stops) %>%
add_circles(lat = "stop_lat", lon = "stop_lon")
# }
Run the code above in your browser using DataLab