| explore_sf | R Documentation |
Explore an sf R object using TGVE npm package.
explore_sf( sf = NULL, background = FALSE, static = FALSE, path = tempInstance() )
sf |
a valid sf object that can be converted to geojson |
background |
Boolean to decide whether plumber |
static |
boolean to decide whether data is written to disk and self contained application is built |
path |
path of a TGVE instance, defaults to one in 'tempdir()' should run in the background |
depending on 'background' either a or not blocking 'plumber::pr' object is started or returned. In the case of a 'backgruond' FALSE value a message is displayed with object details.
{
gj = c(
'[
{"type":"Point","coordinates":[0,0]},
{"type":"LineString","coordinates":[[-1,-1],[1,1]]},
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {"id":1},
"geometry": {"type": "Point", "coordinates": [100.0, 0.0]}
}
]
}
]'
)
sf = geojsonsf::geojson_sf(gj)
ps = tgver::explore_sf(sf, background = TRUE)
ps$kill()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.