Add a map layer.

fig_map(g2, ..., map = NULL, axes = FALSE, tooltip = FALSE)

get_map(map = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

...

Additional options passed to fig_polygon.

map

Name of country as defined by ISO Standard 3166-1, if NULL uses world map.

axes, tooltip

Whether to show the tooltip and the axis.

Examples

# NOT RUN {
map <- get_map("fra")

g2(map, asp(longitude, latitude)) %>%
  fig_polygon(axes = FALSE, tooltip = FALSE) %>%
  style(height = cb("window.innerHeight"))

g2() %>%
  fig_map(map = "fra") %>%
  style(height = cb("window.innerHeight"))
# }