Add custom base maps

Share:

Description

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

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## 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)