addWMS {leaflet.extras2} | R Documentation |
Add Queryable WMS Layer
Description
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'
Usage
addWMS(
map,
baseUrl,
layerId = NULL,
group = NULL,
options = WMSTileOptions(),
attribution = NULL,
layers = NULL,
popupOptions = NULL,
checkempty = FALSE,
data = getMapData(map)
)
Arguments
map |
a map widget object created from |
baseUrl |
a base URL of the WMS service |
layerId |
the layer id |
group |
the name of the group the newly created layers should belong to
(for |
options |
a list of extra options for tile layers, popups, paths (circles, rectangles, polygons, ...), or other map elements |
attribution |
the attribution text of the tile layer (HTML) |
layers |
comma-separated list of WMS layers to show |
popupOptions |
List of popup options. See
|
checkempty |
Should the returned HTML-content be checked for emptiness?
If the HTML-body is empty no popup is opened. Default is |
data |
the data object from which the argument values are derived; by
default, it is the |
Value
the new map
object
References
https://github.com/heigeo/leaflet.wms
Examples
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"))