summaryrefslogtreecommitdiff
path: root/test/api
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-10-22 13:11:25 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-10-22 15:27:53 -0700
commitc46a8254c46acb0da3719e20e99c87b11e998da2 (patch)
tree635f8c3e3d878ff3e025a8175a3509a1ec4d6df7 /test/api
parent4f509288b7c671db96555a24a4f490311adfc13a (diff)
downloadqtlocation-mapboxgl-c46a8254c46acb0da3719e20e99c87b11e998da2.tar.gz
[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.
Diffstat (limited to 'test/api')
-rw-r--r--test/api/annotations.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp
index 415b2ddb69..a9667c4343 100644
--- a/test/api/annotations.cpp
+++ b/test/api/annotations.cpp
@@ -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);