Learn R Programming

rleafmap (version 0.2.1)

basemap: Define a Tile Basemap Layer

Description

Define a new basemap layer from a tile server.

Usage

basemap(
  URL,
  name = NULL,
  alpha = 1,
  minZoom = 0,
  maxZoom = 18,
  tileSize = 256,
  tms = FALSE
)

Value

An object of class basemap which can be directly used in writeMap.

Arguments

URL

a character string giving the tile server url or a the name of a pre-configured server.

name

a character string to name the layer.

alpha

a numeric value in \([0, 1]\) setting the layer opacity.

minZoom, maxZoom

numeric values setting the minimum and maximum zoom level.

tileSize

a numeric value setting tile size (width and height in pixels, assuming tiles are square).

tms

logical. If TRUE, inverses Y axis numbering for tiles (for TMS services)

Details

URL should have the form 'http://{s}.somedomain.com/somepath/{z}/{x}/{y}.png' with {s} a facultative subdomain, {z} the zoom level and {x}, {y} the coordinates. rleafmap comes with a list of pre-configured servers. Names of these servers are returned by the function bmSource.

See Also

spLayer to define data layers.

Examples

Run this code
if (FALSE) {
 #A simple map with two nice basemaps.
 bm1 <- basemap("mapquest.map")
 bm2 <- basemap("stamen.watercolor")
 writeMap(bm1, bm2)
}

Run the code above in your browser using DataLab