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"
    )
Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.