R/addBaseMap.R

Defines functions addBaseMap

Documented in addBaseMap

addBaseMap <- function(name, title, url, options) {
  # get existing base maps
  baseMaps <-  getOption("leafletBaseMaps")
  
  # create base map
  if(missing(title)) title <- name
  newBaseMap <- list(title=title, url=url)
  if(missing(options)) options <- NULL
  newBaseMap$options <- options
  
  # add base map
  baseMaps[[name]] <- newBaseMap
  options(leafletBaseMaps=baseMaps)
}

Try the leafletR package in your browser

Any scripts or data that you put into this service are public.

leafletR documentation built on May 30, 2017, 1:52 a.m.