From 078392eda96e5232d7f4e9e486ee33782ed4487e Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 7 Jun 2016 15:23:24 -0700 Subject: [core] Merge annotation_tile_data.{hpp,cpp} into annotation_tile.{hpp,cpp} --- src/mbgl/annotation/annotation_manager.cpp | 1 - src/mbgl/annotation/annotation_tile.cpp | 15 +++++++++++++++ src/mbgl/annotation/annotation_tile.hpp | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) (limited to 'src/mbgl/annotation') diff --git a/src/mbgl/annotation/annotation_manager.cpp b/src/mbgl/annotation/annotation_manager.cpp index f52cf860cf..5b87b41f61 100644 --- a/src/mbgl/annotation/annotation_manager.cpp +++ b/src/mbgl/annotation/annotation_manager.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/src/mbgl/annotation/annotation_tile.cpp b/src/mbgl/annotation/annotation_tile.cpp index dd2afca127..48415c4f34 100644 --- a/src/mbgl/annotation/annotation_tile.cpp +++ b/src/mbgl/annotation/annotation_tile.cpp @@ -2,11 +2,26 @@ #include #include #include +#include #include namespace mbgl { +AnnotationTileData::AnnotationTileData(const OverscaledTileID& overscaledTileID, + std::string sourceID, + const style::UpdateParameters& parameters) + : GeometryTileData(overscaledTileID, sourceID, parameters.style, parameters.mode), + annotationManager(parameters.annotationManager) { + annotationManager.addTileData(*this); +} + +AnnotationTileData::~AnnotationTileData() { + annotationManager.removeTileData(*this); +} + +void AnnotationTileData::setNecessity(Necessity) {} + AnnotationTileFeature::AnnotationTileFeature(FeatureType type_, GeometryCollection geometries_, std::unordered_map properties_) : type(type_), diff --git a/src/mbgl/annotation/annotation_tile.hpp b/src/mbgl/annotation/annotation_tile.hpp index 8e8d76286e..0046253665 100644 --- a/src/mbgl/annotation/annotation_tile.hpp +++ b/src/mbgl/annotation/annotation_tile.hpp @@ -1,9 +1,29 @@ #pragma once #include +#include namespace mbgl { +class AnnotationManager; + +namespace style { +class UpdateParameters; +} + +class AnnotationTileData : public GeometryTileData { +public: + AnnotationTileData(const OverscaledTileID&, + std::string sourceID, + const style::UpdateParameters&); + ~AnnotationTileData(); + + void setNecessity(Necessity) final; + +private: + AnnotationManager& annotationManager; +}; + class AnnotationTileFeature : public GeometryTileFeature { public: AnnotationTileFeature(FeatureType, GeometryCollection, -- cgit v1.2.1