'leaflet' Extensions for 'mapview'

Provides extensions for package 'leaflet', many of which are used by package 'mapview'. Focus is on functionality readily available in Geographic Information Systems such as 'Quantum GIS'. Includes functions to display coordinates of mouse pointer position, query image values via mouse pointer and zoom-to-layer buttons. Additionally, provides a feature type agnostic function to add points, lines, polygons to a map.


CRANstatus Travis buildstatus monthly total CRAN

leafem provides extensions for package leaflet many of which are used by package mapview. The intention of this package is to enhance leaflet functionality to provide a more GIS-like feeling when plotting spatial data interactively.

Installation

You can install the released version of leafem from CRAN with:

install.packages("leafem")

Extensions

addFeatures

library(leaflet)
 
leaflet() %>% addProviderTiles("OpenStreetMap") %>% addFeatures(data = breweries91)

addMouseCoordinates

leaflet() %>%
  addProviderTiles("OpenStreetMap") %>%
  addMouseCoordinates()

garnishMap

library(leaflet)
 
m <- leaflet() %>% addProviderTiles("OpenStreetMap")
garnishMap(m, addMouseCoordinates)

addHomeButton

library(leaflet)
library(raster)
 
m <- leaflet() %>%
  addProviderTiles("OpenStreetMap") %>%
  addCircleMarkers(data = breweries91) %>%
  addHomeButton(extent(breweries91), "breweries91")
m

addImageQuery

library(leaflet)
library(plainview)
 
leaflet() %>%
  addProviderTiles("OpenStreetMap") %>%
  addRasterImage(poppendorf[[1]], project = TRUE, group = "poppendorf",
                 layerId = "poppendorf") %>%
  addImageQuery(poppendorf[[1]], project = TRUE,
                layerId = "poppendorf") %>%
  addLayersControl(overlayGroups = "poppendorf")

addLogo

img <- "https://www.r-project.org/logo/Rlogo.svg"
 
leaflet() %>% addTiles() %>% addLogo(img, url = "https://www.r-project.org/logo/")

Code of Conduct

Please note that the ‘leafem’ project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

News

leafem 0.0.1

initial commit

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("leafem")

0.0.1 by Tim Appelhans, 3 months ago


https://github.com/r-spatial/leafem


Report a bug at https://github.com/r-spatial/leafem/issues


Browse source code at https://github.com/cran/leafem


Authors: Tim Appelhans [cre, aut] , Christoph Reudenbach [ctb] , Kenton Russell [ctb] , Jochen Darley [ctb] , Daniel Montague [ctb] (Leaflet.EasyButton plugin)


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports htmltools, htmlwidgets, leaflet, raster, sf, sp

Suggests gdalUtils, plainview, png


Imported by mapview.


See at CRAN