An R package to create interactive web-maps based on the Leaflet JavaScript library

Build Status downloads

Display your spatial data on interactive web-maps using the open-source JavaScript library The package provides basic web-mapping functionality to combine vector data files and online map tiles from different sources.

Official release on CRAN:

Install from GitHub


Make a map


# load example data (Fiji Earthquakes)

# store data in GeoJSON file (just a subset here)
q.dat <- toGeoJSON(data=quakes[1:99,], dest=tempdir(), name="quakes")

# make style based on quake magnitude <- styleGrad(prop="mag", breaks=seq(4, 6.5, by=0.5), 
  style.val=rev(heat.colors(5)), leg="Richter Magnitude", 
  fill.alpha=0.7, rad=8)

# create map <- leaflet(data=q.dat, dest=tempdir(), title="Fiji Earthquakes","osm",, popup="mag")

# view map in browser

chgrl/leafletR documentation built on May 13, 2019, 4:03 p.m.