A Leaflet plugin for working with Web Map services, providing: single-tile/untiled/nontiled layers, shared WMS sources, and GetFeatureInfo-powered identify.
You can also use CQL-Filters by appending a string to the 'baseUrl'
.
Something like 'http://server/wms?cql_filter=attribute=value'
addWMS(
map,
baseUrl,
layerId = NULL,
group = NULL,
options = WMSTileOptions(),
attribution = NULL,
layers = NULL,
popupOptions = NULL,
checkempty = FALSE,
data = getMapData(map)
)
a map widget object created from leaflet()
a base URL of the WMS service
the layer id
the name of the group the newly created layers should belong to
(for clearGroup
and addLayersControl
purposes).
Human-friendly group names are permitted--they need not be short,
identifier-style names. Any number of layers and even different types of
layers (e.g. markers and polygons) can share the same group name.
a list of extra options for tile layers, popups, paths (circles, rectangles, polygons, ...), or other map elements
the attribution text of the tile layer (HTML)
comma-separated list of WMS layers to show
List of popup options. See
popupOptions
. Default is NULL.
Should the returned HTML-content be checked for emptiness?
If the HTML-body is empty no popup is opened. Default is FALSE
the data object from which the argument values are derived; by
default, it is the data
object provided to leaflet()
initially, but can be overridden
the new map
object
library(leaflet)
library(leaflet.extras2)
leaflet() %>%
addTiles(group = "base") %>%
setView(9, 50, 5) %>%
addWMS(baseUrl = "https://maps.dwd.de/geoserver/dwd/wms",
layers = "dwd:BRD_1km_winddaten_10m",
popupOptions = popupOptions(maxWidth = 600),
checkempty = TRUE,
options = WMSTileOptions(
transparent = TRUE,
format = "image/png",
info_format = "text/html"))