style_methods: Create styles

Description Usage Arguments Value Note Examples

Description

Style methods to create style objects corresponding to openlayers style classes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
stroke_style(color = "green", width = 2)

fill_style(color = "rgba(0, 0, 255, 0.5)")

circle_style(stroke = stroke_style(), fill = fill_style(), radius = 10)

icon_style(src = NULL, anchor = c(0.5, 0.8), icon_color = NULL)

marker_style(src = NULL, anchor = c(0.5, 0.8), icon_color = NULL)

text_style(text = NULL, property = NULL, scale = 1.5, color = "black",
  stroke = NULL, offset_xy = c(0, 0))

Arguments

color

stroke or fill color

width

stroke width in pixels

stroke

stroke style or NULL (do not stroke)

fill

fill style or NULL (do not fill)

radius

radius in pixels

src

url of the icon, base64 encoded icon (see make_icon) or NULL (use default icon)

anchor

center of the icon relative to its top left corner

icon_color

color to tint the icon or NULL (keep original)

text

text content, ignored in case property parameter is set

property

feature property used as text content

scale

text scale

offset_xy

horizontal and vertical text offset in pixel, positive offsets will shift the text right and down

Value

style object

Note

color, icon_color, radius and text can be single values applied to all features or vectors of length equal to the number of features

Examples

1
2
3
  style <- stroke_style() + fill_style()

  point_style <- circle_style(stroke_style(color = "blue"), fill = NULL)

crazycapivara/openlayers documentation built on June 4, 2019, 8:08 p.m.