Skip to content

Commit 6d5812a

Browse files
committed
Add wms endpoint for FAO zones
1 parent fc91f8d commit 6d5812a

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

.github/workflows/cicd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ jobs:
304304
name: Push to registry
305305
needs: [version, e2e_test, e2e_multi_windows_test]
306306
runs-on: ubuntu-22.04
307-
if: needs.version.outputs.IS_RELEASE && !contains(github.ref, 'dependabot')
307+
if: !contains(github.ref, 'dependabot')
308308
env:
309309
IS_RELEASE: ${{ needs.version.outputs.IS_RELEASE }}
310310
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

frontend/src/features/AdministrativeZone/layers/AdministrativeLayers.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FAO_LAYER } from '@features/AdministrativeZone/layers/constants'
12
import React, { useEffect } from 'react'
23

34
import {
@@ -7,6 +8,7 @@ import {
78
layersNotInCurrentOLMap,
89
layersNotInShowedLayers
910
} from '../../../domain/entities/layers'
11+
import { LayerProperties } from '../../../domain/entities/layers/constants'
1012
import { useMainAppSelector } from '../../../hooks/useMainAppSelector'
1113
import { monitorfishMap } from '../../map/monitorfishMap'
1214
import { getVectorOLLayer } from '../useCases/showAdministrativeZone'
@@ -30,6 +32,13 @@ function UnmemoizedAdministrativeLayers() {
3032
if (!layerToInsert) {
3133
return
3234
}
35+
36+
if (layerToInsert.type === LayerProperties.FAO.code) {
37+
olLayers.push(FAO_LAYER)
38+
39+
return
40+
}
41+
3342
const VectorLayer = getVectorOLLayer(layerToInsert.type, layerToInsert.zone, isBackoffice)
3443
olLayers.push(VectorLayer)
3544
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import TileLayer from 'ol/layer/Tile'
2+
import { TileWMS } from 'ol/source'
3+
4+
export const FAO_LAYER = new TileLayer({
5+
source: new TileWMS({
6+
params: { FORMAT: 'image/png', LAYERS: 'monitorfish:fao_areas', STYLES: 'monitorfish:FAO style', TILED: true },
7+
serverType: 'geoserver',
8+
// Countries have transparency, so do not fade tiles:
9+
transition: 0,
10+
11+
url: `${import.meta.env.FRONTEND_GEOSERVER_REMOTE_URL}/geoserver/monitorfish/wms`
12+
})
13+
})

frontend/src/features/AdministrativeZone/layers/styles/administrativeLayer.style.ts

-17
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,6 @@ export function getAdministrativeLayerStyle(type: string) {
2929
}`
3030
})
3131
})
32-
case LayerProperties.FAO.code:
33-
return (feature: Feature | undefined) =>
34-
new Style({
35-
stroke: new Stroke({
36-
color: '#767AB2',
37-
width: 1
38-
}),
39-
text: new Text({
40-
fill: new Fill({ color: THEME.color.gunMetal }),
41-
font: '12px Marianne',
42-
overflow: true,
43-
stroke: new Stroke({ color: 'rgba(255,255,255,0.4)', width: 2 }),
44-
text: `${
45-
(LayerProperties.FAO.zoneNamePropertyKey && feature?.get(LayerProperties.FAO.zoneNamePropertyKey)) || ''
46-
}`
47-
})
48-
})
4932
case LayerProperties.AEM.code:
5033
return (feature: Feature | undefined) =>
5134
new Style({

0 commit comments

Comments
 (0)