Skip to contents

View mode options. These options are specific to the view mode.

Usage

tm_view(
  use_browser,
  use_WebGL,
  control.position,
  control.bases,
  control.overlays,
  control.collapse,
  set_bounds,
  set_view,
  set_zoom_limits,
  use_circle_markers,
  hover.text.size,
  smooth_factor,
  leaflet.options,
  ...
)

Arguments

use_browser

If TRUE it opens an external browser, and FALSE (default) it opens the internal IDEs (e.g. RStudio) browser.

use_WebGL

use webGL for points, lines, and polygons. For large spatial objects, this is much faster than the standard leaflet layer functions. However, it can not always be used for two reasons. First, the number of map variables are limited; only fill, size, and color (for lines) are supported. Second, projected CRS's are not supported. Furthermore, it has the drawback that polygon borders are not as sharp. By default only TRUE for large spatial objects (1000 or more features) when the mentioned criteria are met. By default TRUE if no other map variables are used.

control.position

The position of the control. A tm_pos object, or a shortcut of two values: horizontal (left, center, right) and vertical (top, center, bottom). See tm_pos for details

control.bases

base layers

control.overlays

overlay layers

control.collapse

Should the box be collapsed or expanded?

set_bounds

logical that determines whether maximum bounds are set, or a bounding box. Not applicable in plot mode. In view mode, this is passed on to setMaxBounds()

set_view

numeric vector that determines the view. Either a vector of three: lng, lat, and zoom, or a single value: zoom. See setView(). Only applicable if bbox is not specified

set_zoom_limits

numeric vector of two that set the minimum and maximum zoom levels (see tileOptions()).

use_circle_markers

If TRUE (default) circle shaped symbols (e.g. tm_dots() and tm_symbols()) will be rendered as addCircleMarkers() instead of addMarkers(). The former is faster, the latter can support any symbol since it is based on icons

hover.text.size

font size of the hover labels (the texts that are shown when hovering over a feature, see the argument hover of the layer functions), in pixels, e.g. 16. Also a CSS font size can be specified, e.g. "1.2em". By default (NA), the size of leaflet is used.

smooth_factor

how much polygons and lines are simplified at each zoom level (see addPolygons()). More means better performance and smoother look, and less means more accurate representation. By default 1. Use a lower value, e.g. 0.1, when large polygons look broken when zoomed in.

leaflet.options

options passed on to leafletOptions()

...

to catch deprecated arguments