I am attempting to display an interactive map of past rainfall using leaflet in R. The best available data I was pointed to was located here: https://mapservices.weather.noaa.gov/raster/rest/services/obs/rfc_qpe/MapServer

The example layer I am trying to display is rainfall accumulation from the past 24-hours, indicated as layer 28. When trying to display with leaflet, the data does not seem to show, and no errors are given:


url = "https://mapservices.weather.noaa.gov/raster/rest/services/obs/rfc_qpe/MapServer"

leaflet() %>%
  addTiles() %>%
              layerId = '28',
              options = WMSTileOptions(format = "image/png",
                                       transparent = TRUE,
              group = "24-Hr Accumulation") %>%
  addLayersControl(overlayGroups = "24-Hr Accumulation")

Created on 2023-05-17 with reprex v2.0.2

Presumably, my issue is with the layers = "0" and layerId = "28" arguments.

  • 1
    WMS URL is: https://mapservices.weather.noaa.gov/raster/services/obs/rfc_qpe/MapServer/WMSServer?
    – nmtoken
    May 17 at 14:26
  • 1
    There isn't a layer "0"
    – nmtoken
    May 17 at 14:35
  • @nmtoken Okay. Layer 28 is the one I'm looking for, so I'm unsure which argument to give the value of "28". May 17 at 14:41
  • 1
    Layers is a WMS parameter so assume it would be layers="28", layerId is not a WMS parameter, but I don't know R, so not sure if it is translated to a valid WMS parameter when the request is generated. A valid WMS GetMap request for layer 28 would be: mapservices.weather.noaa.gov:443/raster/services/obs/rfc_qpe/…
    – nmtoken
    May 17 at 14:54
  • @nmtoken Oh I see the issue, layer 28 provides some sort of boundary rather than a raster image that I was looking for. I should be using layer 26. Thank you for your help in finding this issue and fixing the URL! May 17 at 15:07

1 Answer 1


This worked for me in R Studio:


url = "https://mapservices.weather.noaa.gov/raster/services/obs/rfc_qpe/MapServer/WMSServer?"
leaflet() %>%
    addTiles() %>%
    layers = "26,28", 
    options =  WMSTileOptions(format = "image/png",
        transparent = TRUE)

Gives: Two layers from WMS using Leaflet package in R

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.