#include #include #include #include #include namespace mbgl { AnnotationTileFeature::AnnotationTileFeature(FeatureType type_, GeometryCollection geometries_, std::unordered_map properties_) : type(type_), properties(std::move(properties_)), geometries(std::move(geometries_)) {} optional AnnotationTileFeature::getValue(const std::string& key) const { auto it = properties.find(key); if (it != properties.end()) { return optional(it->second); } return optional(); } util::ptr AnnotationTile::getLayer(const std::string& name) const { auto it = layers.find(name); if (it != layers.end()) { return it->second; } return nullptr; } AnnotationTileMonitor::AnnotationTileMonitor(const TileID& tileID_, AnnotationManager& annotationManager_) : tileID(tileID_), annotationManager(annotationManager_) { } AnnotationTileMonitor::~AnnotationTileMonitor() { annotationManager.removeTileMonitor(*this); } std::unique_ptr AnnotationTileMonitor::monitorTile(const GeometryTileMonitor::Callback& callback_) { callback = callback_; annotationManager.addTileMonitor(*this); return nullptr; } void AnnotationTileMonitor::update(std::unique_ptr tile) { callback(nullptr, std::move(tile), {}, {}); } } // namespace mbgl