Leaflet is developed by Numa Gremling, Paul Crickard III, Paul Crickard, and Mark Lewin. The leaflet package from Github is: https://github.com/rstudio/leaflet/tree/main
The website I created for this package is:
My customization of the website:
-
change the page theme to minty
-
change the code theme to arrow-dark
-
change the base font into Roboto, the heading font into Roboto Slab, code font into JetBrains Mono
-
change navbar background into dark
-
change the navbar layout into left: [intro, reference, articles, news]; right: [search, github]
Ziying Yang, first year ScM Biostatistics student at Johns Hopkins University, mainly responsible for the main page development and example analysis.
Leaflet is one of the most popular open-source JavaScript libraries for interactive maps. It's used by GIS specialists like OpenStreetMap, Mapbox, and CartoDB. This R package makes it easy to integrate and control Leaflet maps in R.
To install this package from CRAN:
install.packages('leaflet')
We can also install the development version from GitHub:
if (!require('devtools')) install.packages('devtools')
devtools::install_github('rstudio/leaflet')
To begin using leaflet
, we should first import the package using the library
command:
library(leaflet)
m <- leaflet() %>%
addTiles() %>%
addMarkers(lng=-76.6122, lat=39.2904, popup="The Interactive Map of Baltimore")
m
We can also add pop-ups
m %>% addPopups(lng=-76.5902, lat=39.2983, "Here is the Bloomberg school of public health</b>, JHU")
rand_lng <- function(n = 10) rnorm(n, -76.5902, .01)
rand_lat <- function(n = 10) rnorm(n, 39.2983, .01)
addAwesomeMarkers() addGraticule() addLayersControl() layersControlOptions() removeLayersControl() addLegend() labelFormat() addMapPane() addMeasure() addMiniMap() addProviderTiles() providerTileOptions() addRasterImage() projectRasterForLeaflet() Add a raster image as a layer addRasterLegend() addScaleBar() scaleBarOptions() removeScaleBar() addSimpleGraticule() addTerminator() atlStorms2005 awesomeIconList() awesomeIcons() breweries91 colorNumeric() colorBin() colorQuantile() colorFactor() createLeafletMap() leafletMap() Legacy functions derivePoints() derivePolygons() dispatch() invokeMethod() easyButtonState() easyButton() addEasyButton() addEasyButtonBar() evalFormula() expandLimits() expandLimitsBbox() filterNULL() gadmCHE getMapData() groupOptions() iconList() icons() JS %>% leaflet() leafletOptions() leafletCRS() leafletDependencies leafletProxy() leafletSizingPolicy() makeAwesomeIcon() makeIcon() addControl() addTiles() addWMSTiles() addPopups() addMarkers() addLabelOnlyMarkers() addCircleMarkers() highlightOptions() addCircles() addPolylines() addRectangles() addPolygons() addGeoJSON() addTopoJSON() setView() flyTo() fitBounds() flyToBounds() setMaxBounds() clearBounds() tileOptions() WMSTileOptions() popupOptions() labelOptions() markerOptions() markerClusterOptions() pathOptions() leafletOutput() renderLeaflet() mapOptions() previewColors() removeControl() clearControls() clearGroup() removeImage() clearImages() removeTiles() clearTiles() removePopup() clearPopups() removeMarker() clearMarkers() removeMarkerCluster() clearMarkerClusters() removeMarkerFromCluster() removeShape() clearShapes() removeGeoJSON() clearGeoJSON() removeMeasure() removeTopoJSON() clearTopoJSON() showGroup() hideGroup() validateCoords()