Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 2.11 KB

rectangle.rst

File metadata and controls

52 lines (39 loc) · 2.11 KB

Rectangle

Example

#include "xleaflet/xmap.hpp"
#include "xleaflet/xbasemaps.hpp"
#include "xleaflet/xrectangle.hpp"

auto terrain = xlf::basemap({"Stamen", "Watercolor"});

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

auto rectangle = xlf::rectangle::initialize()
    .bounds({{{52, 354}, {53, 360}}})
    .finalize();

map.add_layer(rectangle);

map

Attributes

Attribute Type Default Value Doc
bounds std::array<std::array<double, 2>, 2> {} SW and NE corners of the rectangle
stroke bool true Set it to false to disable borders
color std::string "#0033FF" Color of the stroke
opacity float 1.0 Opacity of the stroke
weight int 5 Width of the stroke in pixels

fill fill_color fill_opacity dash_array line_cap line_join

bool std::string float std::string std::string std::string

true "#0033FF" 0.2

"round" "round"

Whether to fill the polygon or not