summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation/shape_annotation_impl.hpp
blob: 6134e605c2f07eee6a40de514c3974c2e1a0d63f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef MBGL_SHAPE_ANNOTATION_IMPL
#define MBGL_SHAPE_ANNOTATION_IMPL

#include <mapbox/geojsonvt/geojsonvt.hpp>

#include <mbgl/annotation/annotation.hpp>
#include <mbgl/annotation/shape_annotation.hpp>
#include <mbgl/util/geo.hpp>

#include <memory>
#include <string>
#include <map>

namespace mbgl {

class Style;
class AnnotationTile;

class ShapeAnnotationImpl {
public:
    using Map = std::map<AnnotationID, std::unique_ptr<ShapeAnnotationImpl>>;

    ShapeAnnotationImpl(const AnnotationID, const ShapeAnnotation&, const uint8_t maxZoom);

    LatLngBounds bounds() const;
    void updateStyle(Style&);
    void updateTile(const TileID&, AnnotationTile&);

    const AnnotationID id;
    const std::string layerID;
    const ShapeAnnotation shape;

private:
    const uint8_t maxZoom;
    mapbox::util::geojsonvt::ProjectedFeatureType type;
    std::unique_ptr<mapbox::util::geojsonvt::GeoJSONVT> shapeTiler;
};

} // namespace mbgl

#endif