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

std::string

https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png”

min_zoom

int

0

max_zoom

int

18

tile_size

int

256

attribution

std::string

“Map data (c) <a href='https://openstreetmap.org'>OpenStreetMap</a> contributors”

detect_retina

bool

false

opacity

float

1.0

visible

bool

true

service

std::string

“WMS”

request

std::string

“GetMap”

layers

std::string

“”

Comma-separated list of WMS layers to show

styles

std::string

“”

Comma-separated list of WMS styles

format

std::string

“image/jpeg”

WMS image format (use ‘image/png’ for layers with transparency)

transparent

bool

false

If true, the WMS service will return images with transparency

version

std::string

“1.1.1”

Version of the WMS service to use

crs

std::string

“”