路径层接收坐标点列表,并将其呈现为带有斜切的拉伸线。
mapdeck(
style = mapdeck_style("dark")
, location = c(145, -37.8)
, zoom = 10) %>%
add_path(
data = roads # 自带sf对象路线路径
# , stroke_colour = "RIGHT_LOC" # 填色经常报错
, layer_id = "path_layer"
, tooltip = "ROAD_NAME" # 悬停提示
, auto_highlight = TRUE
, legend = T
)
以空格分隔的表格:
a mapdeck map object 一个mapdeck地图对象
data to be used in the layer. All coordinates are expected to be EPSG:4326 (WGS 84) coordinate system 图层中要使用的数据。所有坐标均应为EPSG:4326(WGS 84)坐标系
optional column of data containing the polylines, if using encoded polylines 如果使用编码折线,则包含折线的数据的可选列
variable of data or hex colour for the stroke. If used, elevation is ignored. If using a hex colour, use either a single value, or a column of hex colours on data 笔画的数据变量或十六进制颜色。如果使用,则忽略高程。如果使用十六进制颜色,请在数据上使用单个值或一列十六进制颜色
width of the stroke in meters. Default 1. 笔画的宽度(以米为单位)。默认值1。
Either a string specifying the column of data containing 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
size of each dash, relative to the width of the stroke 每个划线的大小,相对于笔划的宽度
size of the gap between dashes, relative to the width of the stroke 虚线之间的间距的大小,相对于笔划的宽度
The offset to draw each path with, relative to the width of the path. Negative offset is to the left hand side, and positive offset is to the right hand side. 0 extrudes the path so that it is centered at the specified coordinates. 相对于路径宽度绘制每个路径的偏移量。负偏移量在左侧,正偏移量在右侧。 0拉伸路径,使其位于指定坐标的中心。
The units of the line width, one of 'meters', 'pixels'. When zooming in and out, meter sizes scale with the base map, and pixel sizes remain the same on screen. 线宽的单位,“米”,“像素”之一。放大和缩小时,仪表尺寸会随基本地图缩放,并且像素尺寸在屏幕上保持不变。
The minimum path width in pixels. This can be used to prevent the path from getting too thin when zoomed out. 最小路径宽度(以像素为单位)。这可以用来防止缩小时路径变得太细。
The maximum path width in pixels. his prop can be used to prevent the path from getting too thick when zoomed in. 最大路径宽度(以像素为单位)。他的道具可以用来防止放大时路径变得太粗。
The path width multiplier that multiplied to all paths. 与所有路径相乘的路径宽度乘数。
variable of data containing text or HTML to render as a tooltip 包含文本或HTML的数据变量以呈现为工具提示
logical indicating if the path always faces the camera (TRUE) or if it always faces up (FALSE) 逻辑指示路径是始终面向摄像机(TRUE)还是始终面向摄像机(FALSE)
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的图层可能会发生冲突并且无法正确绘制
an id value in data to identify layers when interacting in Shiny apps. 数据中的ID值,以在“闪亮”应用程序中进行交互时识别图层。
logical indicating if the shape under the mouse should auto-highlight 逻辑指示鼠标下方的形状是否应自动突出显示
hex string colour to use for highlighting. Must contain the alpha component. 用于突出显示的十六进制字符串颜色。必须包含alpha分量。
"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”)“
hex string colour to use for NA values 用于NA值的十六进制字符串颜色
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. 逻辑指示是否应显示图例,或者是一个命名列表,该列表指示应在图例中包括哪些颜色属性。
A list of options for controlling the legend. 用于控制图例的选项列表。
A list containing functions to apply to legend values. See section legend 包含要应用于图例值的函数的列表。参见图例
logical indicating if the map should update the bounds to include this layer 逻辑指示地图是否应更新边界以包括此图层
logical indicating if the map should update the bounds to only include this layer 逻辑指示地图是否应将边界更新为仅包括此图层
number of digits for rounding coordinates 舍入坐标的位数
list specifying the duration of transitions. 指定过渡持续时间的列表。
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,则显示所有弧