# Thu Sep 03 00:21:57 2020 -
# 字符编码:UTF-8
# R 版本:R x64 4.0.2 for window 10
# cgh163email@163.com
# 个人笔记不负责任
# —— 拎了个梨🍐
rm(list=ls());gc()
.rs.restartR()
require(mapdeck)
# key <- 'abc'
set_token( key )
capitals %>% head()
# country capital lat lon
# 1 Afghanistan Kabul 34.28 69.11
# 2 Albania Tirane 41.18 19.49
# 3 Algeria Algiers 36.42 3.08
# 4 American Samoa Pago Pago -14.16 -170.43
# 5 Andorra Andorra la Vella 42.31 1.32
# 6 Angola Luanda -8.50 13.15
mapdeck(
style = mapdeck_style('dark')
) %>%
add_text(
data = capitals
, lon = 'lon'
, lat = 'lat'
# , fill_colour = 'country'
, text = 'capital'
, layer_id = 'text'
)
空格分隔的表格:
| 1 | map | a mapdeck map object | 一个mapdeck地图对象 |
| 2 | data | data to be used in the layer. All coordinates are expected to be EPSG:4326 (WGS 84) coordinate system | 图层中要使用的数据。所有坐标均应为EPSG:4326(WGS 84)坐标系 |
| 3 | text | column of data containing the text. The data must be a character. | 包含文本的数据列。数据必须是字符。 |
| 4 | lon | column containing longitude values | 包含经度值的列 |
| 5 | lat | column containing latitude values | 包含纬度值的列 |
| 6 | polyline | optional column of data containing the polylines, if using encoded polylines | 如果使用编码折线,则包含折线的数据的可选列 |
| 7 | fill_colour | column of data or hex colour for the fill colour. If using a hex colour, use either a single value, or a column of hex colours on data | 数据列或十六进制颜色作为填充色。如果使用十六进制颜色,请在数据上使用单个值或一列十六进制颜色 |
| 8 | fill_opacity | Either a string specifying the column of datacontaining the opacity of each shape, or a single value in [0,255], or [0, 1), to be applied to all the shapes. Default 255. If a hex-string is used as the colour, this argument is ignored and you should include the alpha on the hex string | 指定包含每个形状的不透明度的数据列的字符串,或者是[0,255]或[0,1)中的单个值,将应用于所有形状。默认值255。如果将十六进制字符串用作颜色,则将忽略此参数,并且应在十六进制字符串中包含alpha |
| 9 | size | column of data containing the size of the text. Default 32 | 包含文本大小的数据列。默认值32 |
| 10 | angle | column of data containging the angle of the text. Default 0 | 包含文本角度的数据列。默认值0 |
| 11 | anchor | column of data containing the anchor of the text. One of 'start', 'middle' or 'end' | 包含文本锚点的数据列。 “开始”,“中间”或“结束”之一 |
| 12 | alignment_baseline | column of data containing the alignment. One of 'top', 'center' or 'bottom' | 包含对齐方式的数据列。 “顶部”,“中心”或“底部”之一 |
| 13 | billboard | logical indicating if the text always faces the camera (TRUE) or if it always faces up (FALSE) | 逻辑指示文本是始终面向相机(TRUE)还是始终面向上方(FALSE) |
| 14 | font_family | [specifies a prioritised list of one or more font family names and/or generic family names. Follow the specifics for CSS font-familyhttps://developer.mozilla.org/en-US/docs/Web/CSS/font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) | 指定一个或多个字体系列名称和/或通用系列名称的优先列表。遵循CSS字体家族的详细说明https://developer.mozilla.org/en-US/docs/Web/CSS/font-family |
| 15 | font_weight | [specifies the font weight. Follow the specifics for CSS font-weighthttps://htmldog.com/references/css/properties/font-weight/](https://htmldog.com/references/css/properties/font-weight/) | 指定字体粗细。遵循CSS字体权重的规定https://htmldog.com/references/css/properties/font-weight/ |
| 16 | tooltip | variable of data containing text or HTML to render as a tooltip | 包含文本或HTML的数据变量以呈现为工具提示 |
| 17 | layer_id | single value specifying an id for the layer. Use this value to distinguish between shape layers of the same type. Layers with the same id are likely to conflict and not plot correctly | 指定图层ID的单个值。使用此值可以区分相同类型的形状图层。具有相同ID的图层可能会发生冲突并且无法正确绘制 |
| 18 | id | an id value in data to identify layers when interacting in Shiny apps. | 数据中的ID值,以在“闪亮”应用程序中进行交互时识别图层。 |
| 19 | auto_highlight | logical indicating if the shape under the mouse should auto-highlight | 逻辑指示鼠标下方的形状是否应自动突出显示 |
| 20 | highlight_colour | hex string colour to use for highlighting. Must contain the alpha component. | 用于突出显示的十六进制字符串颜色。必须包含alpha分量。 |
| 21 | palette | string or matrix. String will be one of colourvalues::colour_palettes(). A matrix must have at least 5 rows, and 3 or 4 columns of values between [0, 255], where the 4th column represents the alpha. You can use a named list to specify a different palette for different colour options (where available), e.g. list(fill_colour = "viridis", stroke_colour = "inferno") | “字符串或矩阵。字符串将是colourvalues :: colour_palettes()之一。矩阵必须至少包含5行,且[0,255]之间的值包含3或4列,其中第4列表示Alpha。您可以使用命名列表为不同的颜色选项(如果有)指定不同的调色板,例如list(fill_colour =“ viridis”,stroke_colour =“ inferno”)“ |
| 22 | na_colour | hex string colour to use for NA values | 用于NA值的十六进制字符串颜色 |
| 23 | legend | either a logical indiciating if the legend(s) should be displayed, or a named list indicating which colour attributes should be included in the legend. | 逻辑指示是否应显示图例,或者是一个命名列表,该列表指示应在图例中包括哪些颜色属性。 |
| 24 | legend_options | A list of options for controlling the legend. | 用于控制图例的选项列表。 |
| 25 | legend_format | A list containing functions to apply to legend values. See section legend | 包含要应用于图例值的函数的列表。参见图例 |
| 26 | update_view | logical indicating if the map should update the bounds to include this layer | 逻辑指示地图是否应更新边界以包括此图层 |
| 27 | focus_layer | logical indicating if the map should update the bounds to only include this layer | 逻辑指示地图是否应将边界更新为仅包括此图层 |
| 28 | digits | number of digits for rounding coordinates | 舍入坐标的位数 |
| 29 | transitions | list specifying the duration of transitions. | 指定过渡持续时间的列表。 |
| 30 | brush_radius | radius of the brush in metres. Default NULL. If supplied, the arcs will only show if the origin or destination are within the radius of the mouse. If NULL, all arcs are displayed | 画笔的半径(以米为单位)。默认为NULL。如果提供了弧,则仅当起点或终点在鼠标的半径内时才会显示弧。如果为NULL,则显示所有弧 |