Learn R Programming

g2r (version 0.1.0)

fig_map: Map

Description

Add a map layer.

Usage

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

Run this code
# 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"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab