summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/api/annotations.cpp42
-rw-r--r--test/fixtures/annotations/antimeridian_annotation_large/expected.pngbin0 -> 1579 bytes
-rw-r--r--test/fixtures/annotations/antimeridian_annotation_small/expected.pngbin0 -> 1652 bytes
3 files changed, 42 insertions, 0 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp
index 9ec4497588..b6f861f900 100644
--- a/test/api/annotations.cpp
+++ b/test/api/annotations.cpp
@@ -79,6 +79,48 @@ TEST(Annotations, FillAnnotation) {
test.checkRendering("fill_annotation_max_zoom");
}
+TEST(Annotations, AntimeridianAnnotationSmall) {
+ AnnotationTest test;
+
+ double antimeridian = 180;
+ test.map.setLatLngZoom(mbgl::LatLng(0, antimeridian), 0);
+ test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
+
+ LineString<double> line = {{ { antimeridian, 20 }, { antimeridian, -20 } }};
+ LineAnnotation lineAnnotation { line };
+ lineAnnotation.color = { { 255, 0, 0, 1 } };
+ lineAnnotation.width = { 2 };
+ test.map.addAnnotation(lineAnnotation);
+
+ Polygon<double> polygon = {{ {{ { antimeridian+10, 0 }, { antimeridian - 10, 10 }, { antimeridian-10, -10 } }} }};
+ FillAnnotation polygonAnnotation { polygon };
+ polygonAnnotation.color = { { 0, 0, 255, 1 } };
+ test.map.addAnnotation(polygonAnnotation);
+
+ test.checkRendering("antimeridian_annotation_small");
+}
+
+TEST(Annotations, AntimeridianAnnotationLarge) {
+ AnnotationTest test;
+
+ double antimeridian = 180;
+ test.map.setLatLngZoom(mbgl::LatLng(0, antimeridian), 0);
+ test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
+
+ LineString<double> line = {{ { antimeridian, 20 }, { antimeridian, -20 } }};
+ LineAnnotation lineAnnotation { line };
+ lineAnnotation.color = { { 255, 0, 0, 1 } };
+ lineAnnotation.width = { 2 };
+ test.map.addAnnotation(lineAnnotation);
+
+ Polygon<double> polygon = {{ {{ { antimeridian-10, 0 }, { -antimeridian+10, 10 }, { -antimeridian+10, -10 } }} }};
+ FillAnnotation polygonAnnotation { polygon };
+ polygonAnnotation.color = { { 0, 0, 255, 1 } };
+ test.map.addAnnotation(polygonAnnotation);
+
+ test.checkRendering("antimeridian_annotation_large");
+}
+
TEST(Annotations, OverlappingFillAnnotation) {
AnnotationTest test;
diff --git a/test/fixtures/annotations/antimeridian_annotation_large/expected.png b/test/fixtures/annotations/antimeridian_annotation_large/expected.png
new file mode 100644
index 0000000000..3e8de0b38c
--- /dev/null
+++ b/test/fixtures/annotations/antimeridian_annotation_large/expected.png
Binary files differ
diff --git a/test/fixtures/annotations/antimeridian_annotation_small/expected.png b/test/fixtures/annotations/antimeridian_annotation_small/expected.png
new file mode 100644
index 0000000000..cfe564feab
--- /dev/null
+++ b/test/fixtures/annotations/antimeridian_annotation_small/expected.png
Binary files differ