#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_, MapData& data_) : tileID(tileID_), data(data_) { } AnnotationTileMonitor::~AnnotationTileMonitor() { data.getAnnotationManager()->removeTileMonitor(*this); } std::unique_ptr AnnotationTileMonitor::monitorTile(const GeometryTileMonitor::Callback& callback_) { callback = callback_; data.getAnnotationManager()->addTileMonitor(*this); return nullptr; } void AnnotationTileMonitor::update(std::unique_ptr tile) { callback(nullptr, std::move(tile), {}, {}); } } // namespace mbgl