addBaseMap: Add custom base maps

View source: R/addBaseMap.R

addBaseMapR Documentation

Add custom base maps

Description

Add a custom base map to the list of maps available in the function leaflet.

Usage

addBaseMap(name, title, url, options)

Arguments

name

Name of the base map.

title

Title of the base map, used in the layer control of the resulting map. Optional – if missing, name is used.

url

URL for the base map. See http://leafletjs.com/reference.html#tilelayer for more information.

options

Optional list of additional options. See http://leafletjs.com/reference.html#tilelayer for for a list of valid options.

Author(s)

François Guillem

See Also

leaflet

Examples

## Not run: 
# duplicates osm base map
addBaseMap(
  name="myosm", 
  title="Duplicated OpenStreetMap", 
  url="http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
  options=list(
    attribution='&copy; <a href="http://openstreetmap.org/copyright", target=
      "_blank">OpenStreetMap contributors</a>'
  )
)

map <- leaflet(base.map="myosm", dest=tempdir())

## End(Not run)

chgrl/leafletR documentation built on March 24, 2022, 7:53 a.m.