0

I want to make a leaflet map in R with this wms servic : https://data.geopf.fr/wms-r/wms?VERSION=1.3.0 It works well in QGIS but not with addWMSTiles.

library(leaflet)

layer="ADMINEXPRESS-COG-CARTO.LATEST"
url="https://data.geopf.fr/wms-r/wms?VERSION=1.3.0"

leaflet() %>% 
    setView(lng=3.18766,lat = 50.46302,zoom = 12) %>%
    addWMSTiles(
      baseUrl = url,
      layers = layer,
      group = "Limites administratives",
      options = WMSTileOptions(format = "image/png", transparent = TRUE,opacity=0.9,crs = 4326),
      attribution = "IGN"
    ) 

I try leaflet.extras2 pakcage, i try to put the number of the layer like on this post but it doesnt work at all. I try to change base url... I look trough informations in qgis with no sucess.

1 Answer 1

0

I found the answer. I have to specify the version of the service in WMSTileOptions, which is weird because it's the same version as the older service...

library(leaflet)

layer="ADMINEXPRESS-COG-CARTO.LATEST"
url="https://data.geopf.fr/wms-r/wms?VERSION=1.3.0"

leaflet() %>% 
    setView(lng=3.18766,lat = 50.46302,zoom = 12) %>%
    addWMSTiles(
      baseUrl = url,
      layers = layer,
      group = "Limites administratives",
      options = WMSTileOptions(
          format = "image/png",
          transparent = TRUE,
          opacity=0.9,
          crs = 4326,
          version="1.3.0"
        ),
      attribution = "IGN"
    )
1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Mar 14 at 10:16

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