| tm_popup | R Documentation |
tm_popup() specifies the popups that are shown in interactive ("view")
mode when a feature is clicked. It is passed to the popup argument of the
layer functions (tm_polygons(), tm_symbols(), tm_lines(), etc.). It
replaces the (now deprecated) layer arguments popup.vars and popup.format.
tm_popup(
vars = NA,
title = NA,
format = tm_label_format(),
width = "auto",
max.height = "25em",
title.align = "left",
title.color = NULL,
label.align = "left",
label.color = "#888888",
value.align = "right",
value.color = NULL,
css = NULL
)
vars |
Names of the data variables that are shown in the popup table.
A (possibly named) character vector; when named, the names are used as
labels in the popup table. Besides a character vector, the following
special values are supported (identical to the former
|
title |
Name of the data variable used as the popup title (the bold
header shown above the popup table). This overrules the layer argument
|
format |
A list of formatting options for the popup values, the output
of |
width |
Width of the popup content (view mode). A bare number is
interpreted as pixels (e.g. |
max.height |
Maximum height of the popup table before it becomes
vertically scrollable (view mode). A bare number is interpreted as |
title.align, label.align, value.align |
Horizontal alignment of the
popup title (bold header), the variable-name (label) column, and the value
column respectively. Each one of |
title.color, label.color, value.color |
Text color of the popup title,
the label column, and the value column respectively. |
css |
Optional free-form CSS, injected verbatim as a |
A tm_popup object.
tm_polygons(), tm_symbols(), tm_lines()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.