Commit 138e0a8
authored
Signals: support multiple icons per feature (#657)
Part of #545
Requires decoupling the icon from the signal "feature".
Goal: instead of duplicating the same signal features because they have
similar tags but need different icons:
```yaml
- description: 1ª categoria quadro (Avvio & Avanzamento) (1 light)
country: IT
icon:
match: 'railway:signal:main:states'
cases:
- { any: ['(Y)', 'Y'], value: 'it/main-s-1v-AVV-AVA-Y' }
- { exact: 'G', value: 'it/main-s-1v-AVV-AVA-G' }
default: 'it/main-s-1v-AVV-AVA-R'
tags:
- { tag: 'railway:signal:main', value: 'IT:1V' }
- { tag: 'railway:signal:main:form', value: 'light' }
- { tag: 'railway:signal:main:shape', value: 'square' }
- { tag: 'railway:signal:main:substitute_signal', all: ['IT:AVA', 'IT:AVV'] }
- description: 1ª categoria quadro (Avanzamento) (1 light)
country: IT
icon:
match: 'railway:signal:main:states'
cases:
- { any: ['(Y)', 'Y'], value: 'it/main-s-1v-AVA-Y' }
- { exact: 'G', value: 'it/main-s-1v-AVA-G' }
default: 'it/main-s-1v-AVA-R'
tags:
- { tag: 'railway:signal:main', value: 'IT:1V' }
- { tag: 'railway:signal:main:form', value: 'light' }
- { tag: 'railway:signal:main:shape', value: 'square' }
- { tag: 'railway:signal:main:substitute_signal', value: 'IT:AVA' }
```
instead, allow multiple icons, composed with each other:
```yaml
- description: 1ª categoria quadro (1 light)
country: IT
icon:
- default: 'it/main-1v-s'
- match: 'railway:signal:main:states'
cases:
- { any: ['(Y)', 'Y'], value: 'it/1v-Y' }
- { exact: 'G', value: 'it/1v-G' }
- { exact: 'R', value: 'it/1v-R' }
- match: 'railway:signal:main:substitute_signal'
cases:
- { all: ['IT:AVA', 'IT:AVV'], value: 'it/AVV-AVA', description: 'Avvio & Avanzamento' }
- { exact: 'IT:AVA', value: 'it/AVA', description: 'Avanzamento' }
- { exact: 'IT:AVV', value: 'it/AVV', description: 'Avvio' }
tags:
- { tag: 'railway:signal:main', value: 'IT:1V' }
- { tag: 'railway:signal:main:form', value: 'light' }
- { tag: 'railway:signal:main:shape', value: 'square' }
```
(this example is only combining 2 signals, the Italian signals will have
more variants composed together)
For a full example, see
#639 which has
huge duplication because of the large variety in tagging. (A good thing,
but currently the YAML configuration does not support such use cases
well.)
This requires changes in many different places:
- [x] UI icon map rendering #656
- [x] Icon size determination
- [x] Signal feature SQL
- [x] YAML signal configuration
- [x] Taginfo
- [x] JOSM preset
- [x] Documentation
- [x] Signal feature performance
- [x] Duplicated features in popup
- [x] Make offsets work
- [x] Split off commit
66a7eae
into separate PR --> #6591 parent e3bfc37 commit 138e0a8
File tree
8 files changed
+2483
-2123
lines changed- features
- import/sql
- proxy
- js
8 files changed
+2483
-2123
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
142 | 186 | | |
143 | 187 | | |
144 | 188 | | |
145 | 189 | | |
146 | | - | |
| 190 | + | |
147 | 191 | | |
148 | 192 | | |
149 | 193 | | |
150 | 194 | | |
151 | | - | |
| 195 | + | |
152 | 196 | | |
153 | 197 | | |
154 | 198 | | |
| |||
0 commit comments