From e147887e357f537a5c625fd3edda7b13d64142b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 12 Aug 2016 15:45:18 -0700 Subject: [core, android, ios, macos] Replaced getPointAnnotationsInBounds() w/ queryPointAnnotations() (#5165) queryPointAnnotations() accepts a screen rectangle instead of a geographic bounding box, so marker hit testing works at the edges of a rotated, tilted map view. Fixes #5151. --- test/api/annotations.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp index a1e67b29c4..336e36ab99 100644 --- a/test/api/annotations.cpp +++ b/test/api/annotations.cpp @@ -217,9 +217,17 @@ TEST(Annotations, QueryRenderedFeatures) { test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json")); test.map.addAnnotationIcon("default_marker", namedMarker("default_marker.png")); test.map.addAnnotation(SymbolAnnotation { Point { 0, 0 }, "default_marker" }); + test.map.addAnnotation(SymbolAnnotation { Point { 0, 50 }, "default_marker" }); test::render(test.map); auto features = test.map.queryRenderedFeatures(test.map.pixelForLatLng({ 0, 0 })); EXPECT_EQ(features.size(), 1u); + EXPECT_TRUE(!!features[0].id); + EXPECT_EQ(*features[0].id, 0); + + auto features2 = test.map.queryRenderedFeatures(test.map.pixelForLatLng({ 50, 0 })); + EXPECT_EQ(features2.size(), 1); + EXPECT_TRUE(!!features2[0].id); + EXPECT_EQ(*features2[0].id, 1); } -- cgit v1.2.1