diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-19 15:24:22 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-22 09:34:40 -0700 |
commit | 3afc8b4a2939da70c76dc5b2eb5d007fc917d348 (patch) | |
tree | 176372e3631a81303f379f30de235996f22212f2 /test/api | |
parent | df89de5cc5bf043ca2fe57ef4dd9a7b5d25464cb (diff) | |
download | qtlocation-mapboxgl-3afc8b4a2939da70c76dc5b2eb5d007fc917d348.tar.gz |
[core] Introduce StyleLayer subclasses
Diffstat (limited to 'test/api')
-rw-r--r-- | test/api/annotations.cpp | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp index 907f0446b6..415b2ddb69 100644 --- a/test/api/annotations.cpp +++ b/test/api/annotations.cpp @@ -48,14 +48,11 @@ TEST(Annotations, LineAnnotation) { AnnotationSegments segments = {{ {{ { 0, 0 }, { 45, 45 } }} }}; - LinePaintProperties lineProperties; - lineProperties.color = {{ 255, 0, 0, 1 }}; - lineProperties.width = 5; + LinePaintProperties properties; + properties.color = {{ 255, 0, 0, 1 }}; + properties.width = 5; - StyleProperties styleProperties; - styleProperties.set<LinePaintProperties>(lineProperties); - - map.addShapeAnnotation(ShapeAnnotation(segments, styleProperties)); + map.addShapeAnnotation(ShapeAnnotation(segments, properties)); util::write_file("test/output/line_annotation.png", renderPNG(map)); } @@ -70,13 +67,10 @@ TEST(Annotations, FillAnnotation) { AnnotationSegments segments = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }}; - FillPaintProperties fillProperties; - fillProperties.fill_color = {{ 255, 0, 0, 1 }}; - - StyleProperties styleProperties; - styleProperties.set<FillPaintProperties>(fillProperties); + FillPaintProperties properties; + properties.fill_color = {{ 255, 0, 0, 1 }}; - map.addShapeAnnotation(ShapeAnnotation(segments, styleProperties)); + map.addShapeAnnotation(ShapeAnnotation(segments, properties)); util::write_file("test/output/fill_annotation.png", renderPNG(map)); } @@ -109,13 +103,10 @@ TEST(Annotations, NonImmediateAdd) { AnnotationSegments segments = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }}; - FillPaintProperties fillProperties; - fillProperties.fill_color = {{ 255, 0, 0, 1 }}; + FillPaintProperties properties; + properties.fill_color = {{ 255, 0, 0, 1 }}; - StyleProperties styleProperties; - styleProperties.set<FillPaintProperties>(fillProperties); - - map.addShapeAnnotation(ShapeAnnotation(segments, styleProperties)); + map.addShapeAnnotation(ShapeAnnotation(segments, properties)); util::write_file("test/output/non_immediate_add.png", renderPNG(map)); } @@ -143,16 +134,13 @@ TEST(Annotations, RemoveShape) { AnnotationSegments segments = {{ {{ { 0, 0 }, { 45, 45 } }} }}; - LinePaintProperties lineProperties; - lineProperties.color = {{ 255, 0, 0, 1 }}; - lineProperties.width = 5; - - StyleProperties styleProperties; - styleProperties.set<LinePaintProperties>(lineProperties); + LinePaintProperties properties; + properties.color = {{ 255, 0, 0, 1 }}; + properties.width = 5; Map map(view, fileSource, MapMode::Still); map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), ""); - uint32_t shape = map.addShapeAnnotation(ShapeAnnotation(segments, styleProperties)); + uint32_t shape = map.addShapeAnnotation(ShapeAnnotation(segments, properties)); renderPNG(map); |