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

View source: R/features.R

addFeaturesR Documentation

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)


r-spatial/leafem documentation built on Nov. 1, 2024, 2:48 p.m.