@@ -2,6 +2,7 @@ package geoscript.style.io
22
33import geoscript.style.Composite
44import geoscript.style.Icon
5+ import geoscript.style.Label
56import geoscript.style.Style
67import org.junit.jupiter.api.Test
78import org.junit.jupiter.api.io.TempDir
@@ -83,6 +84,23 @@ class SimpleStyleReaderTest {
8384 assertEquals style. toString(), " Composite (Shape(color = #7e7e7e, size = 6, type = triangle), Label(property = NAME))"
8485 }
8586
87+ @Test void polygonWithAlign () {
88+ SimpleStyleReader styleReader = new SimpleStyleReader ()
89+ Style style = styleReader. read(" fill=#555555 fill-opacity=0.6 stroke=#555555 stroke-width=0.5 label=name label-polygonalign=mbr" )
90+ assertEquals style. toString(), " Composite (Fill(color = #555555, opacity = 0.6), Stroke(color = #555555, width = 0.5), Label(property = name))"
91+ Composite composite = style as Composite
92+ assertEquals (" mbr" , composite. parts[2 ]. options[" polygonAlign" ])
93+ }
94+
95+ @Test void labelMaxDisplacementAndMaxAngleDelta () {
96+ SimpleStyleReader styleReader = new SimpleStyleReader ()
97+ Style style = styleReader. read(" fill=#555555 fill-opacity=0.6 stroke=#555555 stroke-width=0.5 label=name label-maxdisplacement=10 label-maxangledelta=45" )
98+ assertEquals style. toString(), " Composite (Fill(color = #555555, opacity = 0.6), Stroke(color = #555555, width = 0.5), Label(property = name))"
99+ Composite composite = style as Composite
100+ assertEquals (" 45.0" , composite. parts[2 ]. options[" maxAngleDelta" ])
101+ assertEquals (" 10.0" , composite. parts[2 ]. options[" maxDisplacement" ])
102+ }
103+
86104 @Test void readFromMap () {
87105 SimpleStyleReader styleReader = new SimpleStyleReader ()
88106 Style style = styleReader. read([fill : ' wheat' , ' stroke-width' : 1.2 ])
0 commit comments