user_arcgis_basemap: User ArcGIS Basemap Layer

View source: R/basemaps.R

user_arcgis_basemapR Documentation

User ArcGIS Basemap Layer

Description

Create a basemap layer linking to an User-supplied ArcGIS mapserver.

Usage

user_arcgis_basemap(url, name = "", attributions = "",
  toggle.control = FALSE)

Arguments

url

character url string where the map server is located. Typically these urls end with "/MapServer".

name

character layer name.

attributions

character HTML. This HTML will render as attributional text at the bottom-right corner of the map. At a minimum, this text should include the copyright text provided on the map server.

toggle.control

logical. If TRUE, a checkbox will appear on the map allowing the viewer to toggle its visibility in the browser.

Details

Creates and returns an OpenLayers ArcGIS Tile layer that sources a map server at a user-supplied URL.

Value

A Layer.ArcGIS S3 object.

See Also

ol_map, +.Ol.Map, nga_basemap, public_OSM_basemap, public_arcgis_basemap

Examples

server.url <- "http://server.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer"
mymap <- ol_map()
attrib <- paste(
    "Content may not reflect National Geographic's current map policy.",
    "Sources: National Geographic, Esri, Garmin, HERE,",
    "UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp",
    sep=" " # long attribution!
)
base.layer <- user_arcgis_basemap(
    server.url,
    attributions = attrib,
    toggle.control=TRUE
)
mymap <- mymap + base.layer
## Not run: 
ol_map2HTML(
  mymap,
  "SanDiego_NatGeo.html",
  map.note = sprintf(
    "I found this at <a href='%s'>arcgisonline.com</a>",
    server.url
  )
)
browseURL("SanDiego_NatGeo.html")

## End(Not run)

cemarks/ROpenLayers documentation built on March 31, 2022, 12:05 p.m.