addFeatures: Type agnositc version of 'leaflet::add*' functions.

Description Usage Arguments Value Examples

View source: R/extensions.R

Description

Add simple features geometries from sf

Usage

1
addFeatures(map, data, pane = "overlayPane", ...)

Arguments

map

A leaflet or mapview map.

data

A sf object to be added to the map.

pane

The name of the map pane for the features to be rendered in.

...

Further arguments passed to the respective leaflet::add* functions. See addCircleMarkers, addPolylines and addPolygons.

Value

A leaflet map object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(leaflet)

leaflet() %>% addProviderTiles("OpenStreetMap") %>% addCircleMarkers(data = breweries)
leaflet() %>% addProviderTiles("OpenStreetMap") %>% addFeatures(data = breweries)

leaflet() %>% addProviderTiles("OpenStreetMap") %>% addPolylines(data = atlStorms2005)
leaflet() %>% addProviderTiles("OpenStreetMap") %>% addFeatures(atlStorms2005)

leaflet() %>% addProviderTiles("OpenStreetMap") %>% addPolygons(data = franconia)
leaflet() %>% addProviderTiles("OpenStreetMap") %>% addFeatures(franconia)

r-spatial/mapview documentation built on Nov. 11, 2018, 12:27 p.m.