Bind
C++ UI toolkit for Arduino
 
Loading...
Searching...
No Matches
BindMapMarker.hpp
1#ifndef __BINDMAPMARKER_HPP
2#define __BINDMAPMARKER_HPP
3#include "BindView.hpp"
4#include "BindUtils.hpp"
14class BindMapMarker : public BindView
15{
16public:
18 float lat = 0.0f;
19 float lon = 0.0f;
20 float rotation = 0.0f;
21 uint8_t scale = 100;
22 uint8_t iconId = MARKER_PIN_RED;
23 uint8_t cmdId = 0;
24
34 uint16_t getBytes(uint8_t *out) override
35 {
36 offset = 0;
37 copyAndOffset(out, &offset, &objID, sizeof(objID));
38 copyAndOffset(out, &offset, &tag, sizeof(tag));
39 copyAndOffset(out, &offset, &lat, sizeof(lat));
40 copyAndOffset(out, &offset, &lon, sizeof(lon));
41 copyAndOffset(out, &offset, &rotation, sizeof(rotation));
42 copyAndOffset(out, &offset, &iconId, sizeof(iconId));
43 copyAndOffset(out, &offset, &scale, sizeof(scale));
44 copyAndOffset(out, &offset, &cmdId, sizeof(cmdId));
45 return offset;
46 }
47
48private:
49 uint8_t objID = BIND_ID_MAP_MARKER;
50 uint16_t offset = 0;
51 static int16_t tagIndex;
52};
53
54#endif /* __BINDMAPMARKER_HPP */
Represents a marker to be used in BindMap (street map) within BindCanvas.
Definition BindMapMarker.hpp:15
float rotation
Rotation angle of the marker (in degrees).
Definition BindMapMarker.hpp:20
uint16_t getBytes(uint8_t *out) override
Serializes the marker data into a byte array.
Definition BindMapMarker.hpp:34
uint8_t scale
Scale factor for the marker's size.
Definition BindMapMarker.hpp:21
float lon
Longitude coordinate of the marker's position.
Definition BindMapMarker.hpp:19
uint8_t iconId
Identifier for the marker's icon. Visit Markers enum in BindView.h.
Definition BindMapMarker.hpp:22
uint8_t cmdId
Command identifier.
Definition BindMapMarker.hpp:23
float lat
Latitude coordinate of the marker's position.
Definition BindMapMarker.hpp:18
Definition BindView.hpp:22