Circle
Example
#include "xleaflet/xmap.hpp"
#include "xleaflet/xbasemaps.hpp"
#include "xleaflet/xcircle.hpp"
auto terrain = xlf::basemap({"Stamen", "Watercolor"});
auto map = xlf::map::initialize();
map.layers = xlf::map::layer_list_type{terrain};
map.center = xlf::map::point_type{53, 354};
map.zoom = 5;
map.finalize();
auto circle = xlf::circle::initialize();
circle.location = xlf::circle::point_type{50, 354};
circle.radius = 50000;
circle.color = "green";
circle.fill_color = "green";
circle.finalize();
map.add_layer(circle);
map
Attributes
Attribute |
Type |
Default Value |
Doc |
|---|---|---|---|
location |
|
{0.0, 0.0} |
Location of the circle |
radius |
|
1000 |
Radius of the circle, in meters |
stroke |
|
true |
Set it to false to disable borders |
color |
|
“#0033FF” |
Color of the stroke |
opacity |
|
1.0 |
Opacity of the stroke |
weight |
|
5 |
Width of the stroke in pixels |
fill |
|
true |
Whether to fill the circle or not |
fill_color |
|
“#0033FF” |
|
fill_opacity |
|
0.2 |
|
dash_array |
|
||
line_cap |
|
“round” |
|
line_join |
|
“round” |