Skip to content

Commit 7f10203

Browse files
committed
Re-added bounding box config
1 parent e092bc0 commit 7f10203

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

api/v2beta1/wms_conversion.go

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import (
2828
"errors"
2929
sharedModel "github.com/pdok/smooth-operator/model"
3030
"log"
31-
"strconv"
32-
3331
"sigs.k8s.io/controller-runtime/pkg/conversion"
32+
"strconv"
33+
"strings"
3434

3535
pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
3636
)
@@ -299,11 +299,27 @@ func (v2Service WMSService) MapLayersToV3() pdoknlv3.Layer {
299299
// it needs to be created with defaults from the service
300300
// and in this case the middleLayers are all layers without a group
301301
if topLayer == nil {
302+
boundingBoxes := make([]pdoknlv3.WMSBoundingBox, 0)
303+
if v2Service.Extent != nil {
304+
bboxStringList := strings.Split(*v2Service.Extent, " ")
305+
bbox := pdoknlv3.WMSBoundingBox{
306+
CRS: v2Service.DataEPSG,
307+
BBox: sharedModel.BBox{
308+
MinX: bboxStringList[0],
309+
MaxX: bboxStringList[2],
310+
MinY: bboxStringList[1],
311+
MaxY: bboxStringList[3],
312+
},
313+
}
314+
boundingBoxes = append(boundingBoxes, bbox)
315+
}
316+
302317
topLayer = &pdoknlv3.Layer{
303-
Title: &v2Service.Title,
304-
Abstract: &v2Service.Abstract,
305-
Keywords: v2Service.Keywords,
306-
Layers: &[]pdoknlv3.Layer{},
318+
Title: &v2Service.Title,
319+
Abstract: &v2Service.Abstract,
320+
Keywords: v2Service.Keywords,
321+
Layers: &[]pdoknlv3.Layer{},
322+
BoundingBoxes: boundingBoxes,
307323
}
308324

309325
// adding the bottom layers to the middle layers they are grouped by

0 commit comments

Comments
 (0)