[core] Ignore placement for symbol annotations

This commit is contained in:
Bruno de Oliveira Abinader
2016-10-07 13:46:42 +03:00
parent 22b7436acf
commit efc1bff65f
2 changed files with 26 additions and 0 deletions

View File

@@ -341,3 +341,28 @@ TEST(Annotations, QueryRenderedFeatures) {
EXPECT_TRUE(!!features2[0].id);
EXPECT_EQ(*features2[0].id, 1);
}
TEST(Annotations, QueryFractionalZoomLevels) {
AnnotationTest test;
auto viewSize = test.view.getSize();
auto box = ScreenBox { {}, { double(viewSize[0]), double(viewSize[1]) } };
test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
test.map.addAnnotationIcon("default_marker", namedMarker("default_marker.png"));
std::vector<mbgl::AnnotationID> ids;
for (int longitude = 0; longitude < 10; ++longitude) {
for (int latitude = 0; latitude < 10; ++latitude) {
ids.push_back(test.map.addAnnotation(SymbolAnnotation { { double(latitude), double(longitude) }, "default_marker" }));
}
}
test.map.setLatLngZoom({ 5, 5 }, 0);
for (uint16_t zoomSteps = 0; zoomSteps <= 20; ++zoomSteps) {
test.map.setZoom(zoomSteps / 10.0);
test::render(test.map);
auto features = test.map.queryRenderedFeatures(box);
EXPECT_EQ(features.size(), ids.size());
}
}