Skip to contents

Writes a <maplayer> and its layer-tree entry for one or more remote services - xyz tile basemaps, WMS, ArcGIS FeatureServer - from the shipped registry (inst/lookups/rfp_qgs_services.csv). The counterpart of rfp_qgs_raster_add() and rfp_qgs_vector_add() for layers that have no local file at all.

Usage

rfp_qgs_service_add(
  qgs,
  services,
  group = NULL,
  position = c("bottom", "top"),
  above = NULL
)

Arguments

qgs

Character. Path to the project .qgs.

services

Character vector of layer_keys from the registry.

group

Character. Layer-tree group. NULL (default) uses each service's own group from the registry - the six do not share one. The two data services sit in Web Mapping Services, which is what gq's roster calls them; the four xyz basemaps sit in Base - misc.

position

"bottom" (default) or "top" within the group. A basemap belongs beneath the data it provides context for.

above

Character. Insert directly above this layer id in the ordering lists - see rfp_qgs_raster_add().

Value

Invisibly, a character vector of layer ids written (NA for a service already present).

Details

Six services were previously baked into the shipped templates with no way to add a seventh, remove one, or change where it sits without QGIS Desktop.

See rfp_qgs_services() for what is available.

Examples

if (FALSE) { # \dontrun{
rfp_qgs_service_add("project.qgs", "esri_world_topo")
} # }