Add test for removeAnnotation

This commit is contained in:
John Firebaugh
2015-09-28 14:14:45 -07:00
parent af392b9434
commit 0156ac7c8c

View File

@@ -120,6 +120,22 @@ TEST(Annotations, NonImmediateAdd) {
util::write_file("test/output/non_immediate_add.png", renderPNG(map));
}
TEST(Annotations, Remove) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
DefaultFileSource fileSource(nullptr);
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
uint32_t point = map.addPointAnnotation(PointAnnotation({ 0, 0 }, "default_marker"));
renderPNG(map);
map.removeAnnotation(point);
util::write_file("test/output/remove.png", renderPNG(map));
}
TEST(Annotations, SwitchStyle) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);