add_tiles {rbokeh}R Documentation

Add map tiles to a Bokeh figure.

Description

Add map tiles to a Bokeh figure.

Usage

add_tiles(fig, tile_spec, hi_res = TRUE, y_origin_offset = NULL,
  x_origin_offset = NULL, min_zoom = NULL, max_zoom = NULL,
  extra_url_vars = NULL, initial_resolution = NULL, tile_size = NULL,
  alpha = NULL, render_parents = NULL, visible = NULL, level = NULL)

Arguments

fig

figure to modify

tile_spec

A character string indicating to use one of the pre-defined tile specifications (see details) or a custom tile specification from calling tile_spec.

hi_res

When using a pre-defined tile specification, should a high-resolution (if available) version of the tiles be served? Boolean.

y_origin_offset

A y-offset in plot coordinates

x_origin_offset

An x-offset in plot coordinates

min_zoom

A minimum zoom level for the tile layer. This is the most zoomed-out level.

max_zoom

A maximum zoom level for the tile layer. This is the most zoomed-in level.

extra_url_vars

A dictionary that maps url variable template keys to values. These variables are useful for parts of tile urls which do not change from tile to tile (e.g. server host name, or layer name).

initial_resolution

Resolution (plot_units / pixels) of minimum zoom level of tileset projection. NULL to auto-compute.

tile_size

Tile size in pixels (e.g. 256)

alpha

Tile opacity 0.0 - 1.0.

render_parents

Flag enable/disable drawing of parent tiles while waiting for new tiles to arrive. Default value is TRUE.

visible

Is the renderer visible?

level

Specifies the level in which to paint this renderer. One of 'image', 'underlay', 'glyph', 'annotation', 'overlay'.

Details

Here is a list of pre-defined tile specifications from different sources:

Stamen (http://maps.stamen.com/)

Carto (https://carto.com/location-data-services/basemaps/)

Wikipedia

Examples

figure(width = 800) %>%
  add_tiles("stamen_toner")

figure(width = 800) %>%
  add_tiles("carto_light_all")

figure(width = 800) %>%
  add_tiles("wikipedia")

[Package rbokeh version 0.6.3 Index]