summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-05-26 13:12:23 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-05-26 13:12:23 -0700
commit8ace0d37d10e8174268f259dec38cf88e2494ef0 (patch)
tree40fa3e7f2de753583d959418595fe4afdd52c398 /test
parent27f9a85feaab2cb075c88e5cca73a2267a858444 (diff)
downloadqtlocation-mapboxgl-8ace0d37d10e8174268f259dec38cf88e2494ef0.tar.gz
[core] AnnotationTileLayer vends its own name (#5163)
Fixes #5159.
Diffstat (limited to 'test')
-rw-r--r--test/api/annotations.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp
index 8640ce9dbe..f7554fb65e 100644
--- a/test/api/annotations.cpp
+++ b/test/api/annotations.cpp
@@ -259,3 +259,23 @@ TEST(Annotations, SwitchStyle) {
checkRendering(map, "switch_style");
}
+
+TEST(Annotations, QueryRenderedFeatures) {
+ util::RunLoop loop;
+
+ auto display = std::make_shared<mbgl::HeadlessDisplay>();
+ HeadlessView view(display, 1);
+ StubFileSource fileSource;
+
+ Map map(view, fileSource, MapMode::Still);
+ map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
+ map.addAnnotationIcon("default_marker", namedMarker("default_marker.png"));
+ const LatLng latLng(0, 0);
+ map.addPointAnnotation(PointAnnotation(latLng, "default_marker"));
+
+ test::render(map);
+
+ auto point = map.pixelForLatLng(latLng);
+ auto features = map.queryRenderedFeatures(point);
+ EXPECT_EQ(features.size(), 1);
+}