powered by
Converts an `sf` object with POLYGON geometriers into JSON for plotting in an htmlwidget
widget_polygon( data, stroke_colour = NULL, stroke_opacity = NULL, stroke_width = NULL, fill_colour = NULL, fill_opacity = NULL, legend = TRUE, json_legend = TRUE, digits = 6 )
sf object
sf
string specifying column of sf to use for the stroke colour, or a single value to apply to all rows of data
string specifying column of sf to use for the stroke opacity, or a single value to apply to all rows of data
string specifying column of sf to use for the stroke width, or a single value to apply to all rows of data
string specifying column of sf to use for the fill colour, or a single value to apply to all rows of data
string specifying column of sf to use for the fill opacity, or a single value to apply to all rows of data
logical indicating if legend data will be returned
logical indicating if the legend will be returned as json
number of decimal places for rounding lon o& lat coordinates. Default 6
l <- widget_polygon( widget_melbourne, legend = FALSE ) l <- widget_polygon( widget_melbourne, fill_colour = "AREASQKM16", legend = TRUE )
Run the code above in your browser using DataLab