Leaflet: Create Interactive Web Maps with the JavaScript 'Leaflet' Library

Package `leaflet'

March 24, 2022

Type Package Title Create Interactive Web Maps with the JavaScript 'Leaflet'

Library Version 2.1.1 Description Create and customize interactive maps using the 'Leaflet'

JavaScript library and the 'htmlwidgets' package. These maps can be used directly from the R console, from 'RStudio', in Shiny applications and R Markdown documents. License GPL-3

URL

BugReports Depends R (>= 3.1.0) Imports base64enc, crosstalk, htmlwidgets (>= 1.5.4), htmltools,

magrittr, markdown, methods, png, RColorBrewer, raster, scales (>= 1.0.0), sp, stats, viridis (>= 0.5.1), leaflet.providers (>= 1.8.0) Suggests knitr, maps, sf (>= 0.9-6), shiny, rgdal, rgeos, R6, RJSONIO, purrr, testthat (>= 3.0.0), s2 RoxygenNote 7.1.2 Encoding UTF-8 LazyData true NeedsCompilation no Author Joe Cheng [aut, cre], Bhaskar Karambelkar [aut], Yihui Xie [aut], Hadley Wickham [ctb], Kenton Russell [ctb], Kent Johnson [ctb], Barret Schloerke [ctb], jQuery Foundation and contributors [ctb, cph] (jQuery library), Vladimir Agafonkin [ctb, cph] (Leaflet library),

1

2

R topics documented:

CloudMade [cph] (Leaflet library), Leaflet contributors [ctb] (Leaflet library), Brandon Copeland [ctb, cph] (leaflet-measure plugin), Joerg Dietrich [ctb, cph] (Leaflet.Terminator plugin), Benjamin Becquet [ctb, cph] (Leaflet.MagnifyingGlass plugin), Norkart AS [ctb, cph] (Leaflet.MiniMap plugin), L. Voogdt [ctb, cph] (Leaflet.awesome-markers plugin), Daniel Montague [ctb, cph] (Leaflet.EasyButton plugin), Kartena AB [ctb, cph] (Proj4Leaflet plugin), Robert Kajic [ctb, cph] (leaflet-locationfilter plugin), Mapbox [ctb, cph] (leaflet-omnivore plugin), Michael Bostock [ctb, cph] (topojson), RStudio [cph]

Maintainer Joe Cheng

Repository CRAN

Date/Publication 2022-03-23 23:40:02 UTC

R topics documented:

addAwesomeMarkers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 addControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 addGraticule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 addLayersControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 addLegend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 addMapPane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 addMeasure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 addMiniMap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 addProviderTiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 addRasterImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 addScaleBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 addSimpleGraticule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 addTerminator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 atlStorms2005 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 awesomeIconList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 awesomeIcons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 breweries91 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 colorNumeric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 createLeafletMap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 derivePoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 derivePolygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 easyButtonState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 evalFormula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 expandLimits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 expandLimitsBbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 filterNULL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 gadmCHE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

addAwesomeMarkers

3

getMapData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 groupOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 iconList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 leaflet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 leaflet-imports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 leafletDependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 leafletOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 leafletProxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 leafletSizingPolicy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 makeAwesomeIcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 makeIcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 mapOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 previewColors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 removeControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 setView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 showGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 tileOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 validateCoords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

Index

65

addAwesomeMarkers

Add Awesome Markers

Description

Add Awesome Markers

Usage

addAwesomeMarkers( map, lng = NULL, lat = NULL, layerId = NULL, group = NULL, icon = NULL, popup = NULL, popupOptions = NULL, label = NULL, labelOptions = NULL, options = markerOptions(), clusterOptions = NULL, clusterId = NULL, data = getMapData(map)

)

4

addControl

Arguments

map

the map to add awesome Markers to.

lng

a numeric vector of longitudes, or a one-sided formula of the form ~x where x is

a variable in data; by default (if not explicitly provided), it will be automatically

inferred from data by looking for a column named lng, long, or longitude

(case-insensitively)

lat

a vector of latitudes or a formula (similar to the lng argument; the names lat

and latitude are used when guessing the latitude column from data)

layerId

the layer id

group

the name of the group the newly created layers should belong to (for clearGroup and addLayersControl purposes). Human-friendly group names are permitted? they need not be short, identifier-style names. Any number of layers and even different types of layers (e.g. markers and polygons) can share the same group name.

icon

the icon(s) for markers;

popup

a character vector of the HTML content for the popups (you are recommended to escape the text using htmlEscape() for security reasons)

popupOptions A Vector of popupOptions to provide popups

label

a character vector of the HTML content for the labels

labelOptions A Vector of labelOptions to provide label options for each label. Default NULL

options

a list of extra options for tile layers, popups, paths (circles, rectangles, polygons, ...), or other map elements

clusterOptions if not NULL, markers will be clustered using Leaflet.markercluster; you can use markerClusterOptions() to specify marker cluster options

clusterId

the id for the marker cluster layer

data

the data object from which the argument values are derived; by default, it is the data object provided to leaflet() initially, but can be overridden

addControl

Graphics elements and layers

Description

Add graphics elements and layers to the map widget.

Usage

addControl( map, html, position = c("topleft", "topright", "bottomleft", "bottomright"), layerId = NULL,

addControl

5

className = "info legend", data = getMapData(map) )

addTiles( map, urlTemplate = "https://{s}.tile.{z}/{x}/{y}.png", attribution = NULL, layerId = NULL, group = NULL, options = tileOptions(), data = getMapData(map)

)

addWMSTiles( map, baseUrl, layerId = NULL, group = NULL, options = WMSTileOptions(), attribution = NULL, layers = "", data = getMapData(map)

)

addPopups( map, lng = NULL, lat = NULL, popup, layerId = NULL, group = NULL, options = popupOptions(), data = getMapData(map)

)

addMarkers( map, lng = NULL, lat = NULL, layerId = NULL, group = NULL, icon = NULL, popup = NULL, popupOptions = NULL, label = NULL, labelOptions = NULL, options = markerOptions(),

6

clusterOptions = NULL, clusterId = NULL, data = getMapData(map) )

addLabelOnlyMarkers( map, lng = NULL, lat = NULL, layerId = NULL, group = NULL, icon = NULL, label = NULL, labelOptions = NULL, options = markerOptions(), clusterOptions = NULL, clusterId = NULL, data = getMapData(map)

)

addCircleMarkers( map, lng = NULL, lat = NULL, radius = 10, layerId = NULL, group = NULL, stroke = TRUE, color = "#03F", weight = 5, opacity = 0.5, fill = TRUE, fillColor = color, fillOpacity = 0.2, dashArray = NULL, popup = NULL, popupOptions = NULL, label = NULL, labelOptions = NULL, options = pathOptions(), clusterOptions = NULL, clusterId = NULL, data = getMapData(map)

)

highlightOptions( stroke = NULL, color = NULL,

addControl

addControl

7

weight = NULL, opacity = NULL, fill = NULL, fillColor = NULL, fillOpacity = NULL, dashArray = NULL, bringToFront = NULL, sendToBack = NULL )

addCircles( map, lng = NULL, lat = NULL, radius = 10, layerId = NULL, group = NULL, stroke = TRUE, color = "#03F", weight = 5, opacity = 0.5, fill = TRUE, fillColor = color, fillOpacity = 0.2, dashArray = NULL, popup = NULL, popupOptions = NULL, label = NULL, labelOptions = NULL, options = pathOptions(), highlightOptions = NULL, data = getMapData(map)

)

addPolylines( map, lng = NULL, lat = NULL, layerId = NULL, group = NULL, stroke = TRUE, color = "#03F", weight = 5, opacity = 0.5, fill = FALSE, fillColor = color, fillOpacity = 0.2, dashArray = NULL,

8

smoothFactor = 1, noClip = FALSE, popup = NULL, popupOptions = NULL, label = NULL, labelOptions = NULL, options = pathOptions(), highlightOptions = NULL, data = getMapData(map) )

addRectangles( map, lng1, lat1, lng2, lat2, layerId = NULL, group = NULL, stroke = TRUE, color = "#03F", weight = 5, opacity = 0.5, fill = TRUE, fillColor = color, fillOpacity = 0.2, dashArray = NULL, smoothFactor = 1, noClip = FALSE, popup = NULL, popupOptions = NULL, label = NULL, labelOptions = NULL, options = pathOptions(), highlightOptions = NULL, data = getMapData(map)

)

addPolygons( map, lng = NULL, lat = NULL, layerId = NULL, group = NULL, stroke = TRUE, color = "#03F", weight = 5, opacity = 0.5,

addControl

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download