diff options
author | Gali Nelle <galinelle.mapbox@gmail.com> | 2020-04-15 18:15:29 +0300 |
---|---|---|
committer | Gali Nelle <galinelle.mapbox@gmail.com> | 2020-04-17 19:08:43 +0300 |
commit | 33465df0002e2c61fe5c39d4aeb7a674ce0147da (patch) | |
tree | 335cdeb03d3b2edd06ed8465dcfbc9d11f5ee694 /src/mbgl/geometry/feature_index.hpp | |
parent | b190e12f5b565cd87ab528910bf9dcd7878596ec (diff) | |
download | qtlocation-mapboxgl-upstream/galinelle_locationIndicatorPicking.tar.gz |
Introduce a mean to add render features in layers with no sourcesupstream/galinelle_locationIndicatorPicking
This change also uses the support in the LocationIndicator layer, to
return a point feature when queried in correspondence of the location
indicator.
Diffstat (limited to 'src/mbgl/geometry/feature_index.hpp')
-rw-r--r-- | src/mbgl/geometry/feature_index.hpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/mbgl/geometry/feature_index.hpp b/src/mbgl/geometry/feature_index.hpp index 24f36d98a0..dc6aa55f5e 100644 --- a/src/mbgl/geometry/feature_index.hpp +++ b/src/mbgl/geometry/feature_index.hpp @@ -3,8 +3,9 @@ #include <mbgl/style/types.hpp> #include <mbgl/tile/geometry_tile_data.hpp> #include <mbgl/tile/tile_id.hpp> -#include <mbgl/util/grid_index.hpp> #include <mbgl/util/feature.hpp> +#include <mbgl/util/geo.hpp> +#include <mbgl/util/grid_index.hpp> #include <mbgl/util/mat4.hpp> #include <vector> @@ -53,6 +54,24 @@ public: using FeatureSortOrder = std::shared_ptr<const std::vector<size_t>>; +class DynamicFeatureIndex { +public: + ~DynamicFeatureIndex(); + void query(std::unordered_map<std::string, std::vector<Feature>>& result, + const mbgl::ScreenLineString& queryGeometry, + const TransformState& state) const; + + void insert(std::shared_ptr<Feature> feature, std::shared_ptr<mapbox::geometry::polygon<int64_t>> envelope); + +protected: + struct FeatureRecord { + std::shared_ptr<Feature> feature; + std::shared_ptr<mapbox::geometry::polygon<int64_t>> envelope; + }; + + std::vector<FeatureRecord> features; +}; + class FeatureIndex { public: FeatureIndex(std::unique_ptr<const GeometryTileData> tileData_); |