Learn R Programming

leafletR (version 0.4-0)

addBaseMap: 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.

See Also

leaflet

Examples

Run this code
## 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='© <a href="http://openstreetmap.org/copyright", target=
#       "_blank">OpenStreetMap contributors</a>'
#   )
# )
# 
# map <- leaflet(base.map="myosm", dest=tempdir())
# ## End(Not run)

Run the code above in your browser using DataLab