C++ backend for the jupyter-leaflet map visualization library

Layers control


In [ ]:
#include "xleaflet/xmap.hpp"
#include "xleaflet/xbasemaps.hpp"
#include "xleaflet/xtile_layer.hpp"
#include "xleaflet/xwms_layer.hpp"
#include "xleaflet/xlayers_control.hpp"

In [ ]:
auto map = xlf::map_generator()
    .center({50, 354})
    .zoom(4)
    .finalize();

map

In [ ]:
auto nasa_layer = xlf::basemap({"NASAGIBS", "ModisTerraTrueColorCR"}, "2018-03-30");
map.add_layer(nasa_layer);

auto wms = xlf::wms_layer_generator()
    .url("https://demo.boundlessgeo.com/geoserver/ows?")
    .layers("nasa:bluemarble")
    .name("nasa:bluemarble")
    .finalize();
map.add_layer(wms);

 Add a layers_control to the map


In [ ]:
map.add_control(xlf::layers_control());

 And remove it


In [ ]:
map.clear_controls();