inst/examples/use_custom_js_style_function.R

library(openlayers)

quason <- geojsonio::geojson_json(quakes[1:6, ])

# read custom Javascript style function
style_func <- system.file("javascript/another_style_function.js", package = "openlayers") %>%
  read_js_function()

message(style_func)

# zoom in and out to show and hide text content
ol() %>% add_stamen_tiles() %>% add_geojson(quason, style = style_func)
crazycapivara/openlayersr documentation built on June 4, 2019, 8:08 p.m.