[core] AnnotationTileLayer vends its own name (#5163)

Fixes #5159.
This commit is contained in:
Minh Nguyễn
2016-05-26 13:12:23 -07:00
parent 27f9a85fea
commit 8ace0d37d1
5 changed files with 31 additions and 3 deletions

View File

@@ -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);
}