Skip to content

Commit 4a7e7b3

Browse files
committed
styling conversion fix
1 parent 6b91af8 commit 4a7e7b3

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)