Skip to content

Commit f61819c

Browse files
Merge pull request #89 from PDOK/wr/fix-styling-conversion
styling conversion fix
2 parents 6b91af8 + 4a7e7b3 commit f61819c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

api/v2beta1/wms_conversion.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ package v2beta1
2727
import (
2828
"errors"
2929
"log"
30+
"slices"
3031
"strconv"
3132
"strings"
3233

@@ -153,6 +154,16 @@ func (src *WMS) ToV3(target *pdoknlv3.WMS) error {
153154
Keys: cm.Keys,
154155
})
155156
}
157+
158+
if len(src.Spec.Service.StylingAssets.ConfigMapRefs) == 1 {
159+
for _, layer := range src.Spec.Service.Layers {
160+
for _, style := range layer.Styles {
161+
if style.Visualization != nil && !slices.Contains(src.Spec.Service.StylingAssets.ConfigMapRefs[0].Keys, *style.Visualization) {
162+
src.Spec.Service.StylingAssets.ConfigMapRefs[0].Keys = append(src.Spec.Service.StylingAssets.ConfigMapRefs[0].Keys, *style.Visualization)
163+
}
164+
}
165+
}
166+
}
156167
}
157168

158169
dst.Spec.Service = service

0 commit comments

Comments
 (0)