In [ ]:
#include "xleaflet/xmap.hpp"
#include "xleaflet/xbasemaps.hpp"
#include "xleaflet/xlayer_group.hpp"
#include "xleaflet/xcircle.hpp"
#include "xleaflet/xmarker.hpp"
#include "xleaflet/xrectangle.hpp"
In [ ]:
auto toner = xlf::basemap({"Stamen", "Toner"});
auto map = xlf::map_generator()
.layers({toner})
.center({50, 354})
.zoom(5)
.finalize();
map
In [ ]:
auto marker = xlf::marker_generator()
.location({50, 354})
.finalize();
auto circle = xlf::circle_generator()
.location({50, 370})
.radius(50000)
.color("yellow")
.fill_color("yellow")
.finalize();
auto rectangle = xlf::rectangle_generator()
.bounds({{{54, 354}, {55, 360}}})
.color("orange")
.fill_color("orange")
.finalize();
In [ ]:
auto layer_group = xlf::layer_group_generator()
.layers({marker, circle})
.finalize();
map.add_layer(layer_group);
In [ ]:
layer_group.add_layer(rectangle);
In [ ]:
layer_group.remove_layer(circle)
In [ ]:
layer_group.clear_layers();