[core] Style-sourced shape annotation properties

This introduces the possibility to source the type and style properties
of a shape annotation from a designated layer in the style.
This commit is contained in:
John Firebaugh
2015-10-22 13:11:25 -07:00
parent 4f509288b7
commit c46a8254c4
6 changed files with 129 additions and 67 deletions

View File

@@ -75,6 +75,21 @@ TEST(Annotations, FillAnnotation) {
util::write_file("test/output/fill_annotation.png", renderPNG(map));
}
TEST(Annotations, StyleSourcedShapeAnnotation) {
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/annotation.json"), "");
AnnotationSegments segments = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }};
map.addShapeAnnotation(ShapeAnnotation(segments, "annotation"));
util::write_file("test/output/style_sourced_shape_annotation.png", renderPNG(map));
}
TEST(Annotations, AddMultiple) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);