1 | meta { |
---|
2 | title: "Basic MapCSS tests"; |
---|
3 | } |
---|
4 | |
---|
5 | /** |
---|
6 | * test different symbols |
---|
7 | */ |
---|
8 | node[ test:fill ] |
---|
9 | { |
---|
10 | symbol-size: 50; |
---|
11 | symbol-fill-color: purple; |
---|
12 | } |
---|
13 | node[ test:fill = circle ] { symbol-shape : circle ; } /* whitespace at all possible places */ |
---|
14 | node[test:fill=square]{symbol-shape:square;} /* no whitespace at all */ |
---|
15 | node[ test:fill = triangle ] { symbol-shape: triangle; } |
---|
16 | node[ test:fill = pentagon ] { symbol-shape: pentagon } |
---|
17 | node[ test:fill = hexagon ] { symbol-shape: hexagon; } |
---|
18 | node[ test:fill = heptagon ] { symbol-shape: heptagon; } |
---|
19 | node[ test:fill = octagon ] { symbol-shape: octagon; } |
---|
20 | node[ test:fill = nonagon ] {symbol-shape: nonagon; } |
---|
21 | node[ test:fill = decagon ] { symbol-shape: decagon; } |
---|
22 | |
---|
23 | node[ test:stroke ] |
---|
24 | { |
---|
25 | symbol-size: 50; |
---|
26 | symbol-stroke-color: purple; |
---|
27 | } |
---|
28 | node[ test:stroke = circle ] { symbol-shape: circle; } |
---|
29 | node[ test:stroke = square ] { symbol-shape: square; } |
---|
30 | node[ test:stroke = triangle ] { symbol-shape: triangle; } |
---|
31 | node[ test:stroke = triangle ] { symbol-shape: triangle; } |
---|
32 | node[ test:stroke = pentagon ] { symbol-shape: pentagon; } |
---|
33 | node[ test:stroke = hexagon ] { symbol-shape: hexagon; } |
---|
34 | node[ test:stroke = heptagon ] { symbol-shape: heptagon; } |
---|
35 | node[ test:stroke = octagon ] { symbol-shape: octagon; } |
---|
36 | node[ test:stroke = nonagon ] { symbol-shape: nonagon; } |
---|
37 | node[ test:stroke = decagon ] { symbol-shape: decagon; } |
---|
38 | |
---|
39 | /** |
---|
40 | * Test default values. |
---|
41 | * This should display a circle although neither size nor color are specified |
---|
42 | */ |
---|
43 | node[test=circle] |
---|
44 | { |
---|
45 | symbol-shape: circle; |
---|
46 | } |
---|
47 | |
---|
48 | /** |
---|
49 | * 3 Tests: relative symbol-stroke-width, alignment and stacking of stroke & fill for shapes |
---|
50 | */ |
---|
51 | node[test=pentagon1] |
---|
52 | { |
---|
53 | symbol-shape: pentagon; |
---|
54 | symbol-size: 50; |
---|
55 | symbol-stroke-color: gold; |
---|
56 | symbol-stroke-opacity: 0.9; |
---|
57 | symbol-stroke-width: 10; |
---|
58 | } |
---|
59 | node[test=pentagon1]::stroke-casing |
---|
60 | { |
---|
61 | symbol-shape: pentagon; |
---|
62 | symbol-size: 50; |
---|
63 | symbol-stroke-color: #ddd; |
---|
64 | symbol-stroke-opacity: 0.6; |
---|
65 | symbol-stroke-width: +8; |
---|
66 | z-index: -10; |
---|
67 | } |
---|
68 | node[test=pentagon1]::fill |
---|
69 | { |
---|
70 | symbol-shape: pentagon; |
---|
71 | symbol-size: 50; |
---|
72 | symbol-fill-color: darkblue; |
---|
73 | symbol-fill-opacity: 1.0; |
---|
74 | z-index: -15; |
---|
75 | } |
---|
76 | node[test=pentagon2] |
---|
77 | { |
---|
78 | symbol-shape: pentagon; |
---|
79 | symbol-size: 50; |
---|
80 | symbol-stroke-color: blue; |
---|
81 | symbol-stroke-opacity: 0.9; |
---|
82 | symbol-stroke-width: 10; |
---|
83 | } |
---|
84 | node[test=pentagon2]::fill-above |
---|
85 | { |
---|
86 | symbol-shape: pentagon; |
---|
87 | symbol-size: 50; |
---|
88 | symbol-fill-color: white; |
---|
89 | symbol-fill-opacity: 0.3; |
---|
90 | z-index: 2; |
---|
91 | } |
---|
92 | node[test=pentagon3] |
---|
93 | { |
---|
94 | symbol-shape: pentagon; |
---|
95 | symbol-size: 50; |
---|
96 | symbol-fill-color: darkgreen; |
---|
97 | } |
---|
98 | node[test=pentagon3]::stroke-above |
---|
99 | { |
---|
100 | symbol-shape: pentagon; |
---|
101 | symbol-size: 50; |
---|
102 | symbol-stroke-color: yellow; |
---|
103 | symbol-stroke-width: 1.0; |
---|
104 | z-index: 1; |
---|
105 | } |
---|
106 | |
---|
107 | /** |
---|
108 | * Dashes Test |
---|
109 | * 1. Basic test - pattern should not be broken at way nodes |
---|
110 | * 2. Transparent and with background color. The foreground and background dashes must not overlap. |
---|
111 | * 3. Dashes offset - cuts off the first dash segment |
---|
112 | */ |
---|
113 | way[test=dash1] { |
---|
114 | width: 10; |
---|
115 | color: blue; |
---|
116 | dashes: 30,4,17,14; |
---|
117 | } |
---|
118 | way[test=dash2] { |
---|
119 | width: 10; |
---|
120 | color: blue; |
---|
121 | opacity: 0.3; |
---|
122 | dashes: 30,4,17,14; |
---|
123 | dashes-background-color: gold; |
---|
124 | dashes-background-opacity: 0.3; |
---|
125 | } |
---|
126 | way[test=dash3] { |
---|
127 | width: 10; |
---|
128 | color: blue; |
---|
129 | dashes: 30,4,17,14; |
---|
130 | dashes-background-color: gold; |
---|
131 | dashes-offset:30; |
---|
132 | } |
---|
133 | |
---|
134 | /** |
---|
135 | * Casing test |
---|
136 | * Absolute and relative casing. Both should look the same. |
---|
137 | */ |
---|
138 | way[test="casing1"] { |
---|
139 | width: 8; |
---|
140 | color: #0a0; |
---|
141 | casing-color: #bbb; |
---|
142 | casing-width: 12; |
---|
143 | } |
---|
144 | way[test="casing2"] { |
---|
145 | width: 8; |
---|
146 | color: #0a0; |
---|
147 | casing-color: #bbb; |
---|
148 | casing-width: +4; |
---|
149 | } |
---|
150 | |
---|
151 | /** |
---|
152 | * Text placement test |
---|
153 | */ |
---|
154 | node[test=text-placement]::* { |
---|
155 | font-size: 10; |
---|
156 | text: auto; |
---|
157 | symbol-shape: square; |
---|
158 | symbol-size: 50; |
---|
159 | symbol-fill-opacity: 0.0; |
---|
160 | } |
---|
161 | node[test=text-placement]::above_center { |
---|
162 | text-anchor-vertical: above; |
---|
163 | text-anchor-horizontal: center; |
---|
164 | text-color: gold; |
---|
165 | } |
---|
166 | node[test=text-placement]::top_left { |
---|
167 | text-anchor-vertical: top; |
---|
168 | text-anchor-horizontal: left; |
---|
169 | text-color: yellow; |
---|
170 | } |
---|
171 | node[test=text-placement]::top_right { |
---|
172 | text-anchor-vertical: top; |
---|
173 | text-anchor-horizontal: right; |
---|
174 | text-color: green; |
---|
175 | } |
---|
176 | node[test=text-placement]::center_center { |
---|
177 | text-anchor-vertical: center; |
---|
178 | text-anchor-horizontal: center; |
---|
179 | text-color: white; |
---|
180 | } |
---|
181 | node[test=text-placement]::center_right { |
---|
182 | text-anchor-vertical: center; |
---|
183 | text-anchor-horizontal: right; |
---|
184 | text-color: magenta; |
---|
185 | } |
---|
186 | node[test=text-placement]::bottom_left { |
---|
187 | text-anchor-vertical: bottom; |
---|
188 | text-anchor-horizontal: left; |
---|
189 | text-color: blue; |
---|
190 | } |
---|
191 | node[test=text-placement]::bottom_right { |
---|
192 | text-anchor-vertical: bottom; |
---|
193 | text-anchor-horizontal: right; |
---|
194 | text-color: lime; |
---|
195 | } |
---|
196 | node[test=text-placement]::below_center { |
---|
197 | text-anchor-vertical: below; |
---|
198 | text-anchor-horizontal: center; |
---|
199 | text-color: red; |
---|
200 | } |
---|
201 | node[test=text-placement] { |
---|
202 | symbol-fill-color: blue; |
---|
203 | symbol-fill-opacity: 0.4; |
---|
204 | } |
---|
205 | way[test=text-along-path] { |
---|
206 | text: auto; |
---|
207 | text-position: line; |
---|
208 | width: 6; |
---|
209 | color: #00f; |
---|
210 | } |
---|
211 | way[test=text-along-path2] { |
---|
212 | text: auto; |
---|
213 | text-position: line; |
---|
214 | text-offset: 8; |
---|
215 | font-size: 12; |
---|
216 | width: 1; |
---|
217 | color: #f0f; |
---|
218 | dashes: 10; |
---|
219 | } |
---|
220 | |
---|