Interactive UN Maps in Quarto

Author

Lennart Klein

Published

August 6, 2025

To include an interactive map in a Quarto document, you can use the {leaflet} package.

Basic Leaflet

library(leaflet)

leaflet() |>
  addTiles() |> # Add default OpenStreetMap map tiles
  addMarkers(lng = 174.768, lat = -36.852, popup = "The birthplace of R")

Note: to make the map span fullscreen, I have used Quarto’s chunk options:

#| column: screen
#| out-width: 100%

UN Maps Leaflet

Now to add an official UN maps as a base, you can just update the tile to one of the Clear Maps provided by United Nations Geospatial.

library(leaflet)

leaflet(width = "100%", height = "800px") |> # change height here
  addTiles(
    urlTemplate = "https://geoservices.un.org/arcgis/rest/services/ClearMap_WebPlain/MapServer/tile/{z}/{y}/{x}",
    attribution = "United Nations Geospatial"
  ) |>
  setView(lng = 10, lat = 0, zoom = 3)

Interactive map with UN Clear Map tiles1.

Other UN Map Options

  • ClearMap_Dark
  • ClearMap_Gray
  • ClearMap_Imagery
  • ClearMap_Plain
  • ClearMap_Topo

  • ClearMap_WebDark
  • ClearMap_WebGray
  • ClearMap_WebPlain
  • ClearMap_WebTopo

Next to the UN Maps, there also many other leaflet providers.

Footnotes

  1. The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries.↩︎