diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-07 15:23:24 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-13 10:57:46 -0700 |
commit | 078392eda96e5232d7f4e9e486ee33782ed4487e (patch) | |
tree | d256149d32b2375f24d56a2df8f7b5f2a3bb8b12 /src/mbgl/annotation | |
parent | 0035eb0122445c1405ce67f0f21b96fb45749d90 (diff) | |
download | qtlocation-mapboxgl-078392eda96e5232d7f4e9e486ee33782ed4487e.tar.gz |
[core] Merge annotation_tile_data.{hpp,cpp} into annotation_tile.{hpp,cpp}
Diffstat (limited to 'src/mbgl/annotation')
-rw-r--r-- | src/mbgl/annotation/annotation_manager.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/annotation/annotation_tile.cpp | 15 | ||||
-rw-r--r-- | src/mbgl/annotation/annotation_tile.hpp | 20 |
3 files changed, 35 insertions, 1 deletions
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 <mbgl/annotation/fill_annotation_impl.hpp> #include <mbgl/annotation/style_sourced_annotation_impl.hpp> #include <mbgl/style/source.hpp> -#include <mbgl/tile/annotation_tile_data.hpp> #include <mbgl/style/style.hpp> #include <mbgl/style/layers/symbol_layer.hpp> #include <mbgl/style/layers/symbol_layer_impl.hpp> 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 <mbgl/annotation/annotation_manager.hpp> #include <mbgl/util/constants.hpp> #include <mbgl/storage/file_source.hpp> +#include <mbgl/style/update_parameters.hpp> #include <utility> 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<std::string, std::string> 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 <mbgl/tile/geometry_tile.hpp> +#include <mbgl/tile/geometry_tile_data.hpp> 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, |