properties: Add properties to a GeoJSON object

Description Usage Arguments Examples

View source: R/properties.R

Description

Add properties to a GeoJSON object

Usage

1
properties(x, style = NULL, popup = NULL)

Arguments

x

(list) GeoJSON as a list

style

(list) named list of color, fillColor, etc. attributes. Default: NULL

popup

(list) named list of popup values. Default: NULL

Examples

1
2
3
str <- "POINT (-116.4000000000000057 45.2000000000000028)"
x <- wkt2geojson(str)
properties(x, style = list(color = "red"))

Example output

Attaching package: 'wellknown'

The following object is masked from 'package:graphics':

    polygon

$type
[1] "Feature"

$geometry
$geometry$type
[1] "Point"

$geometry$coordinates
[1] "-116.4000000000000057" "45.2000000000000028"  


$properties
$properties$style
$properties$style$color
[1] "red"


$properties$popup
NULL


attr(,"class")
[1] "geojson"

wellknown documentation built on May 26, 2021, 1:06 a.m.