summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation/annotation_tile.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-10-14 18:08:02 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-10-20 13:54:19 -0700
commitc5b95032a5cb9d3c7c39a7a74656f33de1c68d6e (patch)
tree6c73190d5f86b40c55e810bc244d30766051acdc /src/mbgl/annotation/annotation_tile.cpp
parent597b2b48511b68c7a6494386b414da479c436bd7 (diff)
downloadqtlocation-mapboxgl-c5b95032a5cb9d3c7c39a7a74656f33de1c68d6e.tar.gz
[core] Annotation refactor
Diffstat (limited to 'src/mbgl/annotation/annotation_tile.cpp')
-rw-r--r--src/mbgl/annotation/annotation_tile.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mbgl/annotation/annotation_tile.cpp b/src/mbgl/annotation/annotation_tile.cpp
new file mode 100644
index 0000000000..71a6870cdb
--- /dev/null
+++ b/src/mbgl/annotation/annotation_tile.cpp
@@ -0,0 +1,28 @@
+#include <mbgl/annotation/annotation_tile.hpp>
+#include <mbgl/util/constants.hpp>
+
+namespace mbgl {
+
+AnnotationTileFeature::AnnotationTileFeature(FeatureType type_, GeometryCollection geometries_,
+ std::unordered_map<std::string, std::string> properties_)
+ : type(type_),
+ properties(properties_),
+ geometries(geometries_) {}
+
+mapbox::util::optional<Value> AnnotationTileFeature::getValue(const std::string& key) const {
+ auto it = properties.find(key);
+ if (it != properties.end()) {
+ return mapbox::util::optional<Value>(it->second);
+ }
+ return mapbox::util::optional<Value>();
+}
+
+util::ptr<GeometryTileLayer> AnnotationTile::getLayer(const std::string& name) const {
+ auto it = layers.find(name);
+ if (it != layers.end()) {
+ return it->second;
+ }
+ return nullptr;
+}
+
+}