1#pragma once
2
3#include <mbgl/util/geometry.hpp>
4#include <mbgl/util/variant.hpp>
5#include <mbgl/util/color.hpp>
6#include <mbgl/style/property_value.hpp>
7#include <mbgl/style/data_driven_property_value.hpp>
8
9#include <cstdint>
10#include <vector>
11#include <string>
12
13namespace mbgl {
14
15using AnnotationID = uint32_t;
16using AnnotationIDs = std::vector<AnnotationID>;
17
18class SymbolAnnotation {
19public:
20 SymbolAnnotation(Point<double> geometry_, std::string icon_ = {})
21 : geometry(std::move(geometry_)),
22 icon(std::move(icon_)) {}
23
24 Point<double> geometry;
25 std::string icon;
26};
27
28using ShapeAnnotationGeometry = variant<
29 LineString<double>,
30 Polygon<double>,
31 MultiLineString<double>,
32 MultiPolygon<double>>;
33
34class LineAnnotation {
35public:
36 LineAnnotation(ShapeAnnotationGeometry geometry_,
37 style::DataDrivenPropertyValue<float> opacity_ = 1.0f,
38 style::DataDrivenPropertyValue<float> width_ = 1.0f,
39 style::DataDrivenPropertyValue<Color> color_ = Color::black())
40 : geometry(std::move(geometry_)),
41 opacity(std::move(opacity_)),
42 width(std::move(width_)),
43 color(std::move(color_)) {}
44
45 ShapeAnnotationGeometry geometry;
46 style::DataDrivenPropertyValue<float> opacity;
47 style::DataDrivenPropertyValue<float> width;
48 style::DataDrivenPropertyValue<Color> color;
49};
50
51class FillAnnotation {
52public:
53 FillAnnotation(ShapeAnnotationGeometry geometry_,
54 style::DataDrivenPropertyValue<float> opacity_ = 1.0f,
55 style::DataDrivenPropertyValue<Color> color_ = Color::black(),
56 style::DataDrivenPropertyValue<Color> outlineColor_ = {})
57 : geometry(std::move(geometry_)),
58 opacity(std::move(opacity_)),
59 color(std::move(color_)),
60 outlineColor(std::move(outlineColor_)) {}
61
62 ShapeAnnotationGeometry geometry;
63 style::DataDrivenPropertyValue<float> opacity;
64 style::DataDrivenPropertyValue<Color> color;
65 style::DataDrivenPropertyValue<Color> outlineColor;
66};
67
68using Annotation = variant<
69 SymbolAnnotation,
70 LineAnnotation,
71 FillAnnotation>;
72
73} // namespace mbgl
74

source code of qtlocation/src/3rdparty/mapbox-gl-native/include/mbgl/annotation/annotation.hpp