addBaseMap | R Documentation |
Add a custom base map to the list of maps available in the function leaflet
.
addBaseMap(name, title, url, options)
name |
Name of the base map. |
title |
Title of the base map, used in the layer control of the resulting map. Optional – if missing, |
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. |
François Guillem
leaflet
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.