Read Felt map elements, create a Felt map from a URL, or delete a Felt map
Source:R/felt_map.R
read_felt_map.Rd
Read elements, create, or delete a Felt map from a URL or map ID.
get_felt_map()
returns a list of map details and optionally (if read = TRUE
) adds the map elements and layer list as elements in the list.
Usage
read_felt_map(map_id, ..., crs = NULL, token = NULL)
get_felt_map(
map_id,
...,
read = FALSE,
simplifyVector = TRUE,
token = NULL,
call = caller_env()
)
create_felt_map(
title = NULL,
description = NULL,
location = NULL,
zoom = NULL,
layer_urls = NULL,
basemap = c("default", "satellite"),
token = NULL
)
delete_felt_map(map_id, safely = TRUE, token = NULL)
Arguments
- map_id
A Felt map URL, map ID string, or a named list with a id and type element. If map_id is a list, it must be equivalent to the output from
get_felt_map()
where the list includes a "id" string and a "type" string with the value "map".- ...
Additional parameters passed to
sf::read_sf()
.- crs
Coordinate reference system. Passed to
sf::st_transform()
if supplied.- token
Felt personal access token
- read
If
TRUE
, add a sf object with the map data as an element and a list of Felt layers to the returned list of map attributes. Defaults toFALSE
.- simplifyVector
Should JSON arrays containing only primitives (i.e. booleans, numbers, and strings) be caused to atomic vectors?
- call
The execution environment of a currently running function, e.g.
caller_env()
. The function will be mentioned in error messages as the source of the error. See thecall
argument ofabort()
for more information.- title
Map title
- description
Map description
- location
Location to center map, either a sf, sfc, or bbox object or a length 2 numeric vector in the form of
c("lon", "lat")
. To pass coordinates in lat/lon order, set thefeltr.latlon
option toTRUE
(option defaults toFALSE
). If location isNULL
(default), map is centered on Oakland, California.- zoom
Zoom level number
- layer_urls
A character vector or list of raster layer URLs.
- basemap
Basemap, string ("default" or "satellite"), a valid layer URL, a color name, or a color hex code.
- safely
If
TRUE
(default), check for user confirmation before deleting a Felt map. IfFALSE
, delete map without checking.
Value
read_felt_map()
returns a sf object, create_felt_map()
invisibly
returns a list of attributes for the created map, and delete_felt_map()
does not return anything.
Examples
if (FALSE) {
if (interactive()) {
map_data <- create_felt_map(title = "Example map")
url <- map_data$attributes$url
get_felt_map(url = url)
delete_felt_map(url = url)
read_felt_map("https://felt.com/map/Site-Plan-Example-PGTipS2mT8CYBIVlyAm9BkD")
}
}