fig_map: Map

Description Usage Arguments Examples

View source: R/map.R

Description

Add a map layer.

Usage

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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"))

## End(Not run)

JohnCoene/g2r documentation built on March 6, 2021, 8:11 p.m.