summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/map/map.hpp5
-rw-r--r--include/mbgl/util/feature.hpp19
2 files changed, 22 insertions, 2 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 41f34c102b..3200484ec1 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -7,6 +7,7 @@
#include <mbgl/map/update.hpp>
#include <mbgl/map/mode.hpp>
#include <mbgl/util/geo.hpp>
+#include <mbgl/util/feature.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/style/types.hpp>
@@ -159,8 +160,8 @@ public:
void removeCustomLayer(const std::string& id);
// Feature queries
- std::vector<std::string> queryRenderedFeatures(const ScreenCoordinate&, const optional<std::vector<std::string>>& layerIDs = {});
- std::vector<std::string> queryRenderedFeatures(const std::array<ScreenCoordinate, 2>&, const optional<std::vector<std::string>>& layerIDs = {});
+ std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate&, const optional<std::vector<std::string>>& layerIDs = {});
+ std::vector<Feature> queryRenderedFeatures(const std::array<ScreenCoordinate, 2>&, const optional<std::vector<std::string>>& layerIDs = {});
// Memory
void setSourceTileCacheSize(size_t);
diff --git a/include/mbgl/util/feature.hpp b/include/mbgl/util/feature.hpp
new file mode 100644
index 0000000000..c9dbc31769
--- /dev/null
+++ b/include/mbgl/util/feature.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <mbgl/util/optional.hpp>
+
+#include <mapbox/geometry/feature.hpp>
+
+namespace mbgl {
+
+using Value = mapbox::geometry::value;
+
+class Feature : public mapbox::geometry::feature<double> {
+public:
+ Feature(geometry_type&& geometry_)
+ : mapbox::geometry::feature<double> { std::move(geometry_) } {}
+
+ optional<Value> id {};
+};
+
+} // namespace mbgl