library(leaflet)

leaf <- leaflet() %>%
  addTiles()


Default Behavior

leaf %>%
  # central park
  fitBounds(-73.9, 40.75, -73.95,40.8) %>%
  addMeasure()


Customization

leaf %>%
  # Berling, Germany with German localization
  fitBounds(13.76134, 52.675499, 13.0884, 52.33812) %>%
  addMeasure(
    position = "bottomleft",
    primaryLengthUnit = "meters",
    primaryAreaUnit = "sqmeters",
    activeColor = "#3D535D",
    completedColor = "#7D4479",
    localization='de'
  )

The "leaflet" R package is copyright © 2014-2016 RStudio, Inc.
The Leaflet JavaScript library is © 2010–2016 Vladimir Agafonkin, 2010–2011 CloudMade.
Maps © OpenStreetMap contributors unless otherwise noted.

Fork me on GitHub