leaflet v1.1.0

0

Monthly downloads

0th

Percentile

by Joe Cheng

Create Interactive Web Maps with the JavaScript 'Leaflet' Library

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 apps and R Markdown documents.

Readme

An R Interface to Leaflet Maps

Build Status

Leaflet is an open-source JavaScript library for interactive maps. This R package makes it easy to create Leaflet maps from R.

library(leaflet)
m = leaflet() %>% addTiles()
m  # a map with the default OSM tile layer

m = m %>% setView(-93.65, 42.0285, zoom = 17)
m

m %>% addPopups(-93.65, 42.0285, 'Here is the <b>Department of Statistics</b>, ISU')

Installation

You can install this package from CRAN, or the development version from Github:

# CRAN version
install.packages('leaflet')

# Or Github version
if (!require('devtools')) install.packages('devtools')
devtools::install_github('rstudio/leaflet')

Documentation

In addition to the usual R package documentation, we also have extensive docs and examples at: http://rstudio.github.io/leaflet You may use Github issues to file bug reports or feature requests, and ask questions on StackOverflow or in the Shiny mailing list.

Development

To make additions or modifications to the JavaScript htmlwidgets binding layer, you must use Grunt to build and test. Please make sure Node.js is installed on your system, then run:

npm install -g grunt-cli
npm install

Now you can build/minify/lint/test using grunt build, or run in "watch" mode by just running grunt. JS sources go into javascript/src and tests go into javascript/tests.

License

This package is licensed to you under the terms of the GNU General Public License version 3 or later.

Copyright 2013-2015 RStudio, Inc.

Functions in leaflet

Name Description
addMeasure Add a measure control to the map.
addMiniMap Add a minimap to the Map
addLegend Add a color legend to a map
addLayersControl Add UI controls to switch layers on and off
addGraticule Add a Graticule on the map
addAwesomeMarkers Add Awesome Markers
addProviderTiles Add a tile layer from a known map provider
addScaleBar Add or remove a scale bar
addRasterImage Add a raster image as a layer
addSimpleGraticule Add a simple Graticule on the map
dispatch Extension points for plugins
awesomeIconList Make awesome-icon set
breweries91 Selected breweries in Franconia
colorNumeric Color mapping
derivePolygons Given a data object and lng/lat arguments (which may be NULL [meaning infer
createLeafletMap Legacy functions
derivePoints Given a data object and lng/lat arguments (which may be NULL [meaning infer
addTerminator Add a daylight layer on top of the map
atlStorms2005 Atlantic Ocean storms 2005
awesomeIcons Create a list of awesome icon data see
evalFormula Evaluate list members that are formulae, using the map data as the environment
expandLimits Notifies the map of new latitude/longitude of items of interest on the map
icons Create a list of icon data
getMapData returns the map's data
leaflet-imports Objects imported from other packages
iconList Make icon set
filterNULL remove NULL elements from a list
expandLimitsBbox Same as expandLimits, but takes a polygon (that presumably has a bbox attr)
easyButtonState Create an easyButton statestate
gadmCHE Administrative borders of Switzerland (level 1)
makeIcon Define icon sets
leafletProxy Send commands to a Leaflet instance in a Shiny app
leafletDependencies Various leaflet dependency functions for use in downstream packages
leaflet Create a Leaflet map widget
mapOptions Set options on a leaflet map object
makeAwesomeIcon Make Awesome Icon
leafletOutput Wrapper functions for using
addControl Graphics elements and layers
tileOptions Extra options for map elements and layers
setView Methods to manipulate the map widget
providers.details Providers Details
providers Providers
showGroup Show or hide layer groups
validateCoords Utility function to check if a coordinates is valid
previewColors Color previewing utility
safeLabel Sanitize textual labels
removeControl Remove elements from a map
No Results!

Last month downloads

Details

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/leaflet)](http://www.rdocumentation.org/packages/leaflet)