summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/annotation')
-rw-r--r--src/mbgl/annotation/annotation_tile.cpp7
-rw-r--r--src/mbgl/annotation/annotation_tile.hpp2
2 files changed, 3 insertions, 6 deletions
diff --git a/src/mbgl/annotation/annotation_tile.cpp b/src/mbgl/annotation/annotation_tile.cpp
index 74a7dad682..d22e1ca9b3 100644
--- a/src/mbgl/annotation/annotation_tile.cpp
+++ b/src/mbgl/annotation/annotation_tile.cpp
@@ -47,12 +47,9 @@ FeatureType AnnotationTileFeature::getType() const {
return data->type;
}
-optional<Value> AnnotationTileFeature::getValue(const std::string& key) const {
+Value AnnotationTileFeature::getValue(const std::string& key) const {
auto it = data->properties.find(key);
- if (it != data->properties.end()) {
- return optional<Value>(it->second);
- }
- return optional<Value>();
+ return it != data->properties.cend() ? it->second : NullValue();
}
FeatureIdentifier AnnotationTileFeature::getID() const {
diff --git a/src/mbgl/annotation/annotation_tile.hpp b/src/mbgl/annotation/annotation_tile.hpp
index 7757f0b0ce..cc5a3dfb52 100644
--- a/src/mbgl/annotation/annotation_tile.hpp
+++ b/src/mbgl/annotation/annotation_tile.hpp
@@ -26,7 +26,7 @@ public:
~AnnotationTileFeature() override;
FeatureType getType() const override;
- optional<Value> getValue(const std::string&) const override;
+ Value getValue(const std::string&) const override;
FeatureIdentifier getID() const override;
const PropertyMap& getProperties() const override;
GeometryCollection getGeometries() const override;