summaryrefslogtreecommitdiff
path: root/platform/glfw/glfw_view.cpp
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-04-15 18:15:29 +0300
committerGali Nelle <galinelle.mapbox@gmail.com>2020-04-17 19:08:43 +0300
commit33465df0002e2c61fe5c39d4aeb7a674ce0147da (patch)
tree335cdeb03d3b2edd06ed8465dcfbc9d11f5ee694 /platform/glfw/glfw_view.cpp
parentb190e12f5b565cd87ab528910bf9dcd7878596ec (diff)
downloadqtlocation-mapboxgl-33465df0002e2c61fe5c39d4aeb7a674ce0147da.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 'platform/glfw/glfw_view.cpp')
-rw-r--r--platform/glfw/glfw_view.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index 06f435e4dd..0ff208586e 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -294,6 +294,11 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
case GLFW_KEY_Q: {
auto result = view->rendererFrontend->getRenderer()->queryPointAnnotations({ {}, { double(view->getSize().width), double(view->getSize().height) } });
printf("visible point annotations: %lu\n", result.size());
+ auto features = view->rendererFrontend->getRenderer()->queryRenderedFeatures(
+ mbgl::ScreenBox{{double(view->getSize().width * 0.5), double(view->getSize().height * 0.5)},
+ {double(view->getSize().width * 0.5 + 1), double(view->getSize().height * 0.5 + 1)}},
+ {});
+ printf("Rendered features at the center of the screen: %lu\n", features.size());
} break;
case GLFW_KEY_P:
view->pauseResumeCallback();