Closed fgoerlich closed 1 year ago
I am not sure that mapview alllows to add providers other than the already included in https://leaflet-extras.github.io/leaflet-providers/preview/.
However, you can try this hack as provided in https://mhweber.github.io/2018/11/09/adding-wms-basemap-in-r-with-mapview/:
library(mapSpain)
Tenerife.leaf <-
esp_get_nuts(
region = "Tenerife",
epsg = 4326,
moveCAN = FALSE
)
library(mapview)
library(leaflet)
m <- mapview(Tenerife.leaf)
# Hack: https://mhweber.github.io/2018/11/09/adding-wms-basemap-in-r-with-mapview/
m@map <- m@map %>%
addProviderEspTiles("Geofisica.Terremotos365dias",
group = "Earthquakes"
)
m
See also https://github.com/r-spatial/mapview/issues/347 where the same hack is presented
I find that Leaflet-providersESP does not work with
mapview
and themap.types
option. Is that correct?If I run the Earthquakes in Tenerife example I get the expected result, which are shown on the web.
But using
mapview
does not work. Even if is does work with standard Leaflet-providersCreated on 2022-11-10 with reprex v2.0.2