#ifndef MBGL_MAP_ANNOTATIONS #define MBGL_MAP_ANNOTATIONS #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace mbgl { class Annotation; class PointAnnotation; class ShapeAnnotation; class LiveTile; class Style; using GeoJSONVT = mapbox::util::geojsonvt::GeoJSONVT; class AnnotationManager : private util::noncopyable { public: AnnotationManager(); ~AnnotationManager(); void setDefaultPointAnnotationSymbol(const std::string& symbol); AnnotationIDs addPointAnnotations(const std::vector&, const uint8_t maxZoom); AnnotationIDs addShapeAnnotations(const std::vector&, const uint8_t maxZoom); void removeAnnotations(const AnnotationIDs&, const uint8_t maxZoom); AnnotationIDs getAnnotationsInBounds(const LatLngBounds&, const uint8_t maxZoom, const AnnotationType& = AnnotationType::Any) const; LatLngBounds getBoundsForAnnotations(const AnnotationIDs&) const; void updateStyle(Style&); const LiveTile* getTile(const TileID& id); static const std::string PointSourceID; static const std::string ShapeSourceID; private: inline uint32_t nextID(); static vec2 projectPoint(const LatLng& point); uint32_t addShapeAnnotation(const ShapeAnnotation&, const uint8_t maxZoom); uint32_t addPointAnnotation(const PointAnnotation&, const uint8_t maxZoom); std::string defaultPointAnnotationSymbol; std::unordered_map> annotations; std::vector orderedShapeAnnotations; std::unordered_map, std::unique_ptr>, TileID::Hash> tiles; std::unordered_map> shapeTilers; std::unordered_set stalePointTileIDs; uint32_t nextID_ = 0; }; } #endif