Marker¶
Example¶
#include "xleaflet/xmap.hpp"
#include "xleaflet/xmarker.hpp"
std::array<double, 2> center = {52.204793, 360.121558};
auto map = xlf::map::initialize()
.center(center)
.zoom(15)
.finalize();
auto marker = xlf::marker::initialize()
.location(center)
.draggable(false)
.finalize();
map.add_layer(marker);
map
Attributes¶
Attribute |
Type |
Default Value |
Doc |
---|---|---|---|
location |
|
{0.0, 0.0} |
|
z_index_offset |
|
0 |
|
draggable |
|
true |
Whether the marker is draggable with mouse/touch or not |
keyboard |
|
true |
Whether the marker can be tabbed to with a keyboard and clicked by pressing enter |
title |
|
“” |
Text for the browser tooltip that appear on marker hover (no tooltip by default) |
alt |
|
“” |
Text for the alt attribute of the icon image (useful for accessibility) |
rise_on_hover |
|
false |
The z-index offset used for the rise_on_hover feature |
opacity |
|
1.0 |
|
visible |
|
true |
|
icon |
|
The icon for the marker |
|
rotation_angle |
|
0 |
The rotation angle of the marker in degrees |
rotation_origin |
|
“” |
The rotation origin of the marker |
rise_offset |
|
250 |
The z-index offset used for the rise_on_hover feature |
Methods¶
Method |
Return type |
Arguments |
Doc |
---|---|---|---|
on_move |
|
|
Adds a callback on move event |