basemap: Define a Tile Basemap Layer

Description Usage Arguments Details Value See Also Examples

View source: R/basemap.R

Description

Define a new basemap layer from a tile server.

Usage

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

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.

Value

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

See Also

spLayer to define data layers.

Examples

1
2
3
4
5
6
7
## Not run: 
 #A simple map with two nice basemaps.
 bm1 <- basemap("mapquest.map")
 bm2 <- basemap("stamen.watercolor")
 writeMap(bm1, bm2)

## End(Not run)

fkeck/rleafmap documentation built on May 14, 2017, 1:23 a.m.