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"
15class BindMapMarker : public BindView
16{
17public:
19 float lat = 0.0f;
20 float lon = 0.0f;
21 float rotation = 0.0f;
22 uint8_t scale = 100;
23 uint8_t iconId = MARKER_PIN_RED;
24 uint8_t cmdId = 0;
25
35 uint16_t getBytes(uint8_t *out) override
36 {
37 offset = 0;
38 copyAndOffset(out, &offset, &objID, sizeof(objID));
39 copyAndOffset(out, &offset, &tag, sizeof(tag));
40 copyAndOffset(out, &offset, &lat, sizeof(lat));
41 copyAndOffset(out, &offset, &lon, sizeof(lon));
42 copyAndOffset(out, &offset, &rotation, sizeof(rotation));
43 copyAndOffset(out, &offset, &iconId, sizeof(iconId));
44 copyAndOffset(out, &offset, &scale, sizeof(scale));
45 copyAndOffset(out, &offset, &cmdId, sizeof(cmdId));
46 return offset;
47 }
48
49private:
50 uint8_t objID = BIND_ID_MAP_MARKER;
51 uint16_t offset = 0;
52 static int16_t tagIndex;
53};
54
55#endif /* __BINDMAPMARKER_HPP */
Represents a marker to be used in BindMap (street map) within BindCanvas.
Definition BindMapMarker.hpp:16
float rotation
Rotation angle of the marker (in degrees).
Definition BindMapMarker.hpp:21
uint16_t getBytes(uint8_t *out) override
Serializes the marker data into a byte array.
Definition BindMapMarker.hpp:35
uint8_t scale
Scale factor for the marker's size.
Definition BindMapMarker.hpp:22
float lon
Longitude coordinate of the marker's position.
Definition BindMapMarker.hpp:20
uint8_t iconId
Identifier for the marker's icon. Visit Markers enum in BindView.h.
Definition BindMapMarker.hpp:23
uint8_t cmdId
Command identifier.
Definition BindMapMarker.hpp:24
float lat
Latitude coordinate of the marker's position.
Definition BindMapMarker.hpp:19
Definition BindView.hpp:22