#ifndef MBGL_MAP_ANNOTATIONS #define MBGL_MAP_ANNOTATIONS #include #include #include #include #include #include #include #include #include #include #include namespace mbgl { class Annotation; class Map; typedef std::vector AnnotationSegment; enum class AnnotationType : uint8_t { Point, Shape }; class AnnotationManager : private util::noncopyable { public: AnnotationManager(); void setDefaultPointAnnotationSymbol(std::string& symbol) { defaultPointAnnotationSymbol = symbol; } std::pair, std::vector> addPointAnnotations(std::vector, std::vector& symbols, const Map&); std::vector removeAnnotations(std::vector); std::vector getAnnotationsInBounds(LatLngBounds, const Map&) const; LatLngBounds getBoundsForAnnotations(std::vector) const; const std::unique_ptr& getTile(Tile::ID const& id); private: uint32_t nextID() { return nextID_++; } static vec2 projectPoint(LatLng& point); private: std::mutex mtx; std::string defaultPointAnnotationSymbol; std::map> annotations; std::map, std::unique_ptr>> annotationTiles; std::unique_ptr nullTile; uint32_t nextID_ = 0; }; class Annotation : private util::noncopyable { friend class AnnotationManager; public: Annotation(AnnotationType, std::vector); private: LatLng getPoint() const; LatLngBounds getBounds() const { return bounds; } private: const AnnotationType type = AnnotationType::Point; const std::vector geometry; std::map>> tileFeatures; LatLngBounds bounds; }; } #endif