Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

addFeatures

Type agnositc version of leaflet::add* functions.


Description

Add simple features geometries from sf

Usage

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

library(leaflet)

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

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

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

leafem

'leaflet' Extensions for 'mapview'

v0.1.3
MIT + file LICENSE
Authors
Tim Appelhans [cre, aut], Christoph Reudenbach [ctb], Kenton Russell [ctb], Jochen Darley [ctb], Daniel Montague [ctb] (Leaflet.EasyButton plugin), Lorenzo Busetto [ctb], Luigi Ranghetti [ctb], Miles McBain [ctb], Sebastian Gatscha [ctb], Björn Harrtell [ctb] (FlatGeobuf plugin), Daniel Dufour [ctb] (georaster-layer-for-leaflet)
Initial release
2020-07-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.