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

Geometry


In [ ]:
#include "xleaflet/xmap.hpp"
#include "xleaflet/xbasemaps.hpp"
#include "xleaflet/xcircle.hpp"
#include "xleaflet/xcircle_marker.hpp"
#include "xleaflet/xrectangle.hpp"

In [ ]:
auto terrain = xlf::basemap({"Stamen", "Terrain"});

auto map = xlf::map_generator()
    .layers({terrain})
    .center({53, 354})
    .zoom(5)
    .finalize();

map

 Create a circle with a radius in meters


In [ ]:
auto circle = xlf::circle_generator()
    .location({50, 354})
    .radius(50000)
    .color("green")
    .fill_color("green")
    .finalize();

map.add_layer(circle);

Create a circle_marker with a radius in pixels


In [ ]:
auto circle_marker = xlf::circle_marker_generator()
    .location({55, 360})
    .radius(50)
    .color("red")
    .fill_color("red")
    .finalize();

map.add_layer(circle_marker);

In [ ]:
circle_marker.radius = 100;

Create a rectangle


In [ ]:
auto rectangle = xlf::rectangle_generator()
    .bounds({{{52, 354}, {53, 360}}})
    .finalize();

map.add_layer(rectangle);