@@ -2,6 +2,7 @@ package geoscript.style.io
2
2
3
3
import geoscript.style.Composite
4
4
import geoscript.style.Icon
5
+ import geoscript.style.Label
5
6
import geoscript.style.Style
6
7
import org.junit.jupiter.api.Test
7
8
import org.junit.jupiter.api.io.TempDir
@@ -83,6 +84,23 @@ class SimpleStyleReaderTest {
83
84
assertEquals style. toString(), " Composite (Shape(color = #7e7e7e, size = 6, type = triangle), Label(property = NAME))"
84
85
}
85
86
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
+
86
104
@Test void readFromMap () {
87
105
SimpleStyleReader styleReader = new SimpleStyleReader ()
88
106
Style style = styleReader. read([fill : ' wheat' , ' stroke-width' : 1.2 ])
0 commit comments