summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-04-25 12:56:59 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-02 08:45:09 -0700
commitc2b00378b78b55d50968a9b11ed75bb4edf62ec9 (patch)
tree12a164d821dcdeb84d8a88dc231b3f2f9bef8ffd /src
parenta2350320988bd881e261f92930b2d3359ff2071e (diff)
downloadqtlocation-mapboxgl-c2b00378b78b55d50968a9b11ed75bb4edf62ec9.tar.gz
[all] Push querySourceFeatures back out to Map
Once Source and RendererSource are split, Source will no longer have access to tiles.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/map.cpp11
-rw-r--r--src/mbgl/style/source.cpp4
-rw-r--r--src/mbgl/style/source_impl.cpp1
-rw-r--r--src/mbgl/style/source_impl.hpp2
-rw-r--r--src/mbgl/tile/geojson_tile.cpp4
-rw-r--r--src/mbgl/tile/geojson_tile.hpp2
-rw-r--r--src/mbgl/tile/geometry_tile.cpp3
-rw-r--r--src/mbgl/tile/geometry_tile.hpp4
-rw-r--r--src/mbgl/tile/tile.cpp3
-rw-r--r--src/mbgl/tile/tile.hpp4
10 files changed, 20 insertions, 18 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index b5a1af172a..696dca1872 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -7,7 +7,7 @@
#include <mbgl/map/transform_state.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/style/style.hpp>
-#include <mbgl/style/source.hpp>
+#include <mbgl/style/source_impl.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/light.hpp>
#include <mbgl/style/observer.hpp>
@@ -868,6 +868,15 @@ std::vector<Feature> Map::queryRenderedFeatures(const ScreenBox& box, const Rend
);
}
+std::vector<Feature> Map::querySourceFeatures(const std::string& sourceID, const SourceQueryOptions& options) {
+ if (!impl->style) return {};
+
+ const style::Source* source = impl->style->getSource(sourceID);
+ if (!source) return {};
+
+ return source->baseImpl->querySourceFeatures(options);
+}
+
AnnotationIDs Map::queryPointAnnotations(const ScreenBox& box) {
RenderedQueryOptions options;
options.layerIDs = {{ AnnotationManager::PointLayerID }};
diff --git a/src/mbgl/style/source.cpp b/src/mbgl/style/source.cpp
index f10fc6916b..51863f8eba 100644
--- a/src/mbgl/style/source.cpp
+++ b/src/mbgl/style/source.cpp
@@ -22,9 +22,5 @@ optional<Range<uint8_t>> Source::getZoomRange() const {
return baseImpl->getZoomRange();
}
-std::vector<Feature> Source::querySourceFeatures(const SourceQueryOptions& options) {
- return baseImpl->querySourceFeatures(options);
-}
-
} // namespace style
} // namespace mbgl
diff --git a/src/mbgl/style/source_impl.cpp b/src/mbgl/style/source_impl.cpp
index 7a65dd1ded..19138bd781 100644
--- a/src/mbgl/style/source_impl.cpp
+++ b/src/mbgl/style/source_impl.cpp
@@ -10,7 +10,6 @@
#include <mbgl/util/tile_cover.hpp>
#include <mbgl/util/enum.hpp>
#include <mbgl/map/query.hpp>
-#include <mbgl/style/query.hpp>
#include <mbgl/algorithm/update_renderables.hpp>
#include <mbgl/algorithm/generate_clip_ids.hpp>
diff --git a/src/mbgl/style/source_impl.hpp b/src/mbgl/style/source_impl.hpp
index 387428ec59..132d1b97f8 100644
--- a/src/mbgl/style/source_impl.hpp
+++ b/src/mbgl/style/source_impl.hpp
@@ -7,7 +7,7 @@
#include <mbgl/tile/tile.hpp>
#include <mbgl/tile/tile_cache.hpp>
#include <mbgl/style/types.hpp>
-#include <mbgl/style/query.hpp>
+#include <mbgl/map/query.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/mat4.hpp>
diff --git a/src/mbgl/tile/geojson_tile.cpp b/src/mbgl/tile/geojson_tile.cpp
index 00e10d148a..f989bc2ce6 100644
--- a/src/mbgl/tile/geojson_tile.cpp
+++ b/src/mbgl/tile/geojson_tile.cpp
@@ -1,6 +1,6 @@
#include <mbgl/tile/geojson_tile.hpp>
#include <mbgl/tile/geometry_tile_data.hpp>
-#include <mbgl/style/query.hpp>
+#include <mbgl/map/query.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/style/update_parameters.hpp>
@@ -98,7 +98,7 @@ void GeoJSONTile::setNecessity(Necessity) {}
void GeoJSONTile::querySourceFeatures(
std::vector<Feature>& result,
- const style::SourceQueryOptions& options) {
+ const SourceQueryOptions& options) {
// Ignore the sourceLayer, there is only one
auto layer = getData()->getLayer({});
diff --git a/src/mbgl/tile/geojson_tile.hpp b/src/mbgl/tile/geojson_tile.hpp
index e1d269a9a7..f8cde75106 100644
--- a/src/mbgl/tile/geojson_tile.hpp
+++ b/src/mbgl/tile/geojson_tile.hpp
@@ -21,7 +21,7 @@ public:
void querySourceFeatures(
std::vector<Feature>& result,
- const style::SourceQueryOptions&) override;
+ const SourceQueryOptions&) override;
};
} // namespace mbgl
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp
index 6b768d9d5b..6ac4a2e3aa 100644
--- a/src/mbgl/tile/geometry_tile.cpp
+++ b/src/mbgl/tile/geometry_tile.cpp
@@ -18,7 +18,6 @@
#include <mbgl/map/query.hpp>
#include <mbgl/util/run_loop.hpp>
#include <mbgl/style/filter_evaluator.hpp>
-#include <mbgl/style/query.hpp>
#include <mbgl/util/logging.hpp>
#include <iostream>
@@ -191,7 +190,7 @@ void GeometryTile::queryRenderedFeatures(
void GeometryTile::querySourceFeatures(
std::vector<Feature>& result,
- const style::SourceQueryOptions& options) {
+ const SourceQueryOptions& options) {
// Data not yet available
if (!data) {
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index 8aedd67060..227e774e9d 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -19,11 +19,11 @@ class GeometryTileData;
class FeatureIndex;
class CollisionTile;
class RenderLayer;
+class SourceQueryOptions;
namespace style {
class Style;
class UpdateParameters;
-class SourceQueryOptions;
} // namespace style
class GeometryTile : public Tile, public GlyphRequestor, IconRequestor {
@@ -58,7 +58,7 @@ public:
void querySourceFeatures(
std::vector<Feature>& result,
- const style::SourceQueryOptions&) override;
+ const SourceQueryOptions&) override;
void cancel() override;
diff --git a/src/mbgl/tile/tile.cpp b/src/mbgl/tile/tile.cpp
index 4fb8331aeb..0adc151a64 100644
--- a/src/mbgl/tile/tile.cpp
+++ b/src/mbgl/tile/tile.cpp
@@ -4,7 +4,6 @@
#include <mbgl/util/string.hpp>
#include <mbgl/util/logging.hpp>
#include <mbgl/map/query.hpp>
-#include <mbgl/style/query.hpp>
namespace mbgl {
@@ -38,6 +37,6 @@ void Tile::queryRenderedFeatures(
void Tile::querySourceFeatures(
std::vector<Feature>&,
- const style::SourceQueryOptions&) {}
+ const SourceQueryOptions&) {}
} // namespace mbgl
diff --git a/src/mbgl/tile/tile.hpp b/src/mbgl/tile/tile.hpp
index 6c2c78967f..795fd62140 100644
--- a/src/mbgl/tile/tile.hpp
+++ b/src/mbgl/tile/tile.hpp
@@ -22,10 +22,10 @@ class TransformState;
class TileObserver;
class PlacementConfig;
class RenderedQueryOptions;
+class SourceQueryOptions;
class RenderLayer;
namespace style {
-class SourceQueryOptions;
} // namespace style
class Tile : private util::noncopyable {
@@ -60,7 +60,7 @@ public:
virtual void querySourceFeatures(
std::vector<Feature>& result,
- const style::SourceQueryOptions&);
+ const SourceQueryOptions&);
void setTriedOptional();