widget_line: Widget Line

View source: R/spatial_widget.R

widget_lineR Documentation

Widget Line

Description

Converts an 'sf' object with LINESTRING geometriers into JSON for plotting in an htmlwidget

Usage

widget_line(
  data,
  stroke_colour = NULL,
  stroke_opacity = NULL,
  stroke_width = NULL,
  legend = TRUE,
  json_legend = TRUE,
  digits = 6
)

Arguments

data

sf object

stroke_colour

string specifying column of sf to use for the stroke colour, or a single value to apply to all rows of data

stroke_opacity

string specifying column of sf to use for the stroke opacity, or a single value to apply to all rows of data

stroke_width

string specifying column of sf to use for the stroke width, or a single value to apply to all rows of data

legend

logical indicating if legend data will be returned

json_legend

logical indicating if the legend will be returned as json

digits

number of decimal places for rounding lon o& lat coordinates. Default 6

Examples


## use default stroke options
l <- widget_line( widget_roads, legend = TRUE )


spatialwidget documentation built on May 29, 2024, 6:41 a.m.