View source: R/utils-feature-server.R
get_layer | R Documentation |
These helpers provide easy access to the layers contained in a
FeatureServer
or MapServer
.
get_layer(x, id = NULL, name = NULL, token = arc_token())
get_all_layers(x, token = arc_token())
get_layers(x, id = NULL, name = NULL, token = arc_token())
x |
an object of class |
id |
default |
name |
default |
token |
your authorization token. |
The id
and name
arguments must match the field values of the respective names as seen in the output of list_items()
get_layer()
returns a single FeatureLayer
or Table
based on its ID
get_layers()
returns a list of the items specified by the id
or name
argument
get_all_layers()
returns a named list
with an element layers
and tables
.
Each a list containing FeatureLayer
and Table
s respectively.
## Not run:
# FeatureServer
furl <- paste0(
"https://services3.arcgis.com/ZvidGQkLaDJxRSJ2/arcgis/rest/services/",
"PLACES_LocalData_for_BetterHealth/FeatureServer"
)
fserv <- arc_open(furl)
fserv
get_layer(fserv, 0)
get_layers(fserv, name = c("Tracts", "ZCTAs"))
get_all_layers(fserv)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.