WMS layer¶
Example¶
#include "xleaflet/xmap.hpp"
#include "xleaflet/xwms_layer.hpp"
auto wms = xlf::wms_layer::initialize()
.url("https://demo.boundlessgeo.com/geoserver/ows?")
.layers("nasa:bluemarble")
.finalize();
auto map = xlf::map::initialize()
.layers({wms})
.center({42.5531, -48.6914})
.zoom(3)
.finalize();
map
Attributes¶
Attribute |
Type |
Default Value |
Doc |
---|---|---|---|
url |
|
“https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png” |
|
min_zoom |
|
0 |
|
max_zoom |
|
18 |
|
tile_size |
|
256 |
|
attribution |
|
“Map data (c) <a href='https://openstreetmap.org'>OpenStreetMap</a> contributors” |
|
detect_retina |
|
false |
|
opacity |
|
1.0 |
|
visible |
|
true |
|
service |
|
“WMS” |
|
request |
|
“GetMap” |
|
layers |
|
“” |
Comma-separated list of WMS layers to show |
styles |
|
“” |
Comma-separated list of WMS styles |
format |
|
“image/jpeg” |
WMS image format (use ‘image/png’ for layers with transparency) |
transparent |
|
false |
If true, the WMS service will return images with transparency |
version |
|
“1.1.1” |
Version of the WMS service to use |
crs |
|
“” |