summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-06-17 15:04:10 +0300
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-07-09 11:43:46 +0300
commit57402314e1be3180ce6f67d8ba29c17aceba6b60 (patch)
treeefe5a01b6a2ced775726c0407528230166365a71 /src/mbgl/annotation
parentd6c1c838eb0c612aa971740fc58cc2a2e1086f77 (diff)
downloadqtlocation-mapboxgl-57402314e1be3180ce6f67d8ba29c17aceba6b60.tar.gz
[core] Improve performance for query rendered features
- query rendered symbols only from layers that support it - remove unnecessary iterations over vectors
Diffstat (limited to 'src/mbgl/annotation')
-rw-r--r--src/mbgl/annotation/render_annotation_source.cpp2
-rw-r--r--src/mbgl/annotation/render_annotation_source.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/annotation/render_annotation_source.cpp b/src/mbgl/annotation/render_annotation_source.cpp
index 123a776754..903825d5f5 100644
--- a/src/mbgl/annotation/render_annotation_source.cpp
+++ b/src/mbgl/annotation/render_annotation_source.cpp
@@ -46,7 +46,7 @@ void RenderAnnotationSource::update(Immutable<style::Source::Impl> baseImpl_,
std::unordered_map<std::string, std::vector<Feature>>
RenderAnnotationSource::queryRenderedFeatures(const ScreenLineString& geometry,
const TransformState& transformState,
- const std::vector<const RenderLayer*>& layers,
+ const std::unordered_map<std::string, const RenderLayer*>& layers,
const RenderedQueryOptions& options,
const mat4& projMatrix) const {
return tilePyramid.queryRenderedFeatures(geometry, transformState, layers, options, projMatrix);
diff --git a/src/mbgl/annotation/render_annotation_source.hpp b/src/mbgl/annotation/render_annotation_source.hpp
index 948a0b0d8d..c920d760c2 100644
--- a/src/mbgl/annotation/render_annotation_source.hpp
+++ b/src/mbgl/annotation/render_annotation_source.hpp
@@ -18,7 +18,7 @@ public:
std::unordered_map<std::string, std::vector<Feature>>
queryRenderedFeatures(const ScreenLineString& geometry,
const TransformState& transformState,
- const std::vector<const RenderLayer*>& layers,
+ const std::unordered_map<std::string, const RenderLayer*>& layers,
const RenderedQueryOptions& options,
const mat4& projMatrix) const final;