diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-14 18:08:02 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-20 13:54:19 -0700 |
commit | c5b95032a5cb9d3c7c39a7a74656f33de1c68d6e (patch) | |
tree | 6c73190d5f86b40c55e810bc244d30766051acdc /src/mbgl/annotation/annotation_tile.hpp | |
parent | 597b2b48511b68c7a6494386b414da479c436bd7 (diff) | |
download | qtlocation-mapboxgl-c5b95032a5cb9d3c7c39a7a74656f33de1c68d6e.tar.gz |
[core] Annotation refactor
Diffstat (limited to 'src/mbgl/annotation/annotation_tile.hpp')
-rw-r--r-- | src/mbgl/annotation/annotation_tile.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mbgl/annotation/annotation_tile.hpp b/src/mbgl/annotation/annotation_tile.hpp new file mode 100644 index 0000000000..bb7ec5d047 --- /dev/null +++ b/src/mbgl/annotation/annotation_tile.hpp @@ -0,0 +1,43 @@ +#ifndef MBGL_ANNOTATION_TILE +#define MBGL_ANNOTATION_TILE + +#include <mbgl/map/geometry_tile.hpp> +#include <mbgl/map/tile_id.hpp> + +#include <map> +#include <unordered_map> + +namespace mbgl { + +class AnnotationTileFeature : public GeometryTileFeature { +public: + AnnotationTileFeature(FeatureType, GeometryCollection, + std::unordered_map<std::string, std::string> properties = {{}}); + + FeatureType getType() const override { return type; } + mapbox::util::optional<Value> getValue(const std::string&) const override; + GeometryCollection getGeometries() const override { return geometries; } + + const FeatureType type; + const std::unordered_map<std::string, std::string> properties; + const GeometryCollection geometries; +}; + +class AnnotationTileLayer : public GeometryTileLayer { +public: + std::size_t featureCount() const override { return features.size(); } + util::ptr<const GeometryTileFeature> getFeature(std::size_t i) const override { return features[i]; } + + std::vector<util::ptr<const AnnotationTileFeature>> features; +}; + +class AnnotationTile : public GeometryTile { +public: + util::ptr<GeometryTileLayer> getLayer(const std::string&) const override; + + std::map<std::string, util::ptr<AnnotationTileLayer>> layers; +}; + +} + +#endif |