garnishMap: Garnish/decorate leaflet or mapview maps.

Description Usage Arguments Examples

View source: R/garnishMap.R

Description

This function provides a versatile interface to add components to a leaflet or mapview map. It takes functions such as "addMouseCoordinates" or addLayersControl and their respective arguments and adds them to the map. Arguments must be named. Functions can be plain or character strings.

Usage

1

Arguments

map

a mapview or leaflet object.

...

functions and their arguments to add things to a map.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
m <- leaflet() %>% addTiles()
garnishMap(m, addMouseCoordinates)

## add more than one with named argument
library(raster)
m1 <- garnishMap(m, addMouseCoordinates, addHomeButton,
                 ext = extent(breweries91))
m1

## even more flexible
m2 <- garnishMap(m1, addPolygons, data = franconia, popup = popupTable(franconia),
                 fillOpacity = 0.8, color = "black", fillColor = "#BEBEBE")
garnishMap(m2, addCircleMarkers, data = breweries)


## End(Not run)

mapview documentation built on Nov. 17, 2017, 6:38 a.m.