emap_roam: Add Zoom and roam controller

Description Usage Arguments See Also Examples

View source: R/options.R

Description

Add zoom and roam controller to map.

Usage

1
2
3
4
5
emap_roam(p, show = TRUE, zlevel = 0, z = 4, x = "left", y = "top",
  width = 80, height = 120, backgroundColor = "rgba(0,0,0,0)",
  borderColor = "#ccc", borderWidth = 0, padding = 5,
  fillerColor = "#fff", handleColor = "#6495ed", step = 15,
  mapTypeControl = NULL, ...)

Arguments

p

an echart object.

show

set to TRUE to show the controller

z, zlevel

first and second grade cascading control, the higher z the closer to the top.

x

x position; left or right.

y

y posotion; top or bottom.

width, height

dimensions of controller.

backgroundColor

background color.

borderColor

border color.

borderWidth

width of border.

padding

padding.

fillerColor

filler color.

handleColor

color of handle.

step

moving step of the 4 direction roam in px.

mapTypeControl

ou can specify every single mapType when multiple map in a chart at the same time, such as: list({ china = FALSE, world = TRUE}).

...

any other option to pass to controller.

See Also

official roam controller docs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
coords <- data.frame(city = c("London", "New York", "Beijing", "Sydney"),
  lon = c(-0.1167218, -73.98002, 116.3883, 151.18518),
  lat = c(51.49999, 40.74998, 39.92889, -33.92001),
  values = runif(4, 10, 20))

coords %>%
  echart(city) %>%
  emap() %>%
  emap_coords(lon, lat) %>%
  emap_points(values) %>%
  emap_roam(mapTypeControl = list(world = TRUE))

JohnCoene/echarts documentation built on May 22, 2021, 6:18 p.m.