1 #pragma once
2 
3 #include <mbgl/annotation/annotation.hpp>
4 #include <mbgl/tile/geometry_tile.hpp>
5 #include <mbgl/tile/geometry_tile_data.hpp>
6 
7 namespace mbgl {
8 
9 class AnnotationManager;
10 class TileParameters;
11 
12 class AnnotationTile : public GeometryTile {
13 public:
14     AnnotationTile(const OverscaledTileID&, const TileParameters&);
15     ~AnnotationTile() override;
16 
17 private:
18     AnnotationManager& annotationManager;
19 };
20 
21 class AnnotationTileFeatureData;
22 
23 class AnnotationTileFeature : public GeometryTileFeature {
24 public:
25     AnnotationTileFeature(std::shared_ptr<const AnnotationTileFeatureData>);
26     ~AnnotationTileFeature() override;
27 
28     FeatureType getType() const override;
29     optional<Value> getValue(const std::string&) const override;
30     optional<FeatureIdentifier> getID() const override;
31     GeometryCollection getGeometries() const override;
32 
33 private:
34     std::shared_ptr<const AnnotationTileFeatureData> data;
35 };
36 
37 class AnnotationTileLayerData;
38 
39 class AnnotationTileLayer : public GeometryTileLayer {
40 public:
41     AnnotationTileLayer(std::shared_ptr<AnnotationTileLayerData>);
42 
43     std::size_t featureCount() const override;
44     std::unique_ptr<GeometryTileFeature> getFeature(std::size_t i) const override;
45     std::string getName() const override;
46 
47     void addFeature(const AnnotationID,
48                     FeatureType,
49                     GeometryCollection,
50                     std::unordered_map<std::string, std::string> properties = { {} });
51 
52 private:
53     std::shared_ptr<AnnotationTileLayerData> layer;
54 };
55 
56 class AnnotationTileData : public GeometryTileData {
57 public:
58     std::unique_ptr<GeometryTileData> clone() const override;
59     std::unique_ptr<GeometryTileLayer> getLayer(const std::string&) const override;
60 
61     std::unique_ptr<AnnotationTileLayer> addLayer(const std::string&);
62 
63 private:
64     std::unordered_map<std::string, std::shared_ptr<AnnotationTileLayerData>> layers;
65 };
66 
67 } // namespace mbgl
68