Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 2.02 KB

polygon.rst

File metadata and controls

49 lines (38 loc) · 2.02 KB

Polygon

Example

#include "xleaflet/xmap.hpp"
#include "xleaflet/xpolygon.hpp"

auto polygon = xlf::polygon::initialize()
    .locations({{{42, -49}, {43, -49}, {43, -48}}})
    .color("green")
    .fill_color("green")
    .finalize();

auto map = xlf::map::initialize()
    .center({42.5531, -48.6914})
    .zoom(6)
    .finalize();
map.add_layer(polygon);

map

Attributes

Attribute Type Default Value Doc
locations std::vector<std::array<double, 2>> {} List of points of the polygon
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