I'm trying to add Corine land cover data to a shiny
leaflet
map. However, I'm struggling to decipher the WMS XML data so that I can include the appropriate server URL and layer. The WMS information can be found here and here.
I've included and MRE below of what I thought the correct details should be to display Corine 2018 landcover data but I just get a grey leaflet
map.
If unable to provide a straight up solution to this question, can someone help me to interpret the XML data so that I can do this in future for other WMS providers?
library(shiny)
library(leaflet)
ui <- fluidPage(
# Application title
titlePanel("Map"),
sidebarLayout(
sidebarPanel(),
mainPanel(
leafletOutput("map")
)
)
)
server <- function(input, output) {
output$map<-renderLeaflet({
leaflet() %>%
addWMSTiles( "https://image.discomap.eea.europa.eu/arcgis/services/Corine/CLC2018_WM/MapServer/WmsServer", layers = "1",
options = WMSTileOptions(format = "image/png", transparent = T)) %>%
setView(lng = -1.8, lat = 52.0, zoom = 5)
})
}
# Run the application
shinyApp(ui = ui, server = server)