Loading a map context with custom background layers works as expected, showing the list of foreground and background layers.
However, downloading the map context does not include the background layers, except the osm layer.
A map context to reproduce the issue is as follows:
<ows-context:OWSContext xmlns:ows-context="http://www.opengis.net/ows-context"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows"
version="0.3.1" id="ows-context-ex-1-v3">
<ows-context:General>
<ows:BoundingBox crs="EPSG:3857">
<ows:LowerCorner>712121.224491284 7050676.922226553</ows:LowerCorner>
<ows:UpperCorner>3297443.244757944 8111570.962937008</ows:UpperCorner>
</ows:BoundingBox>
</ows-context:General>
<ows-context:ResourceList>
<ows-context:Layer name="{type=osm}" group="Background layers" hidden="false"
opacity="1">
<ows:Title>OpenStreetMap
</ows:Title>
</ows-context:Layer>
<ows-context:Layer name="{type=tms,name=gm}" group="Background layers" hidden="true"
opacity="1">
<ows:Title xmlns:ows="http://www.opengis.net/ows">Google Maps
</ows:Title>
<ows-context:Server service="urn:ogc:serviceType:WMTS">
<ows-context:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://mt2.google.com/vt/lyrs=s@0&hl=en&x={x}&y={y}&z={z}" />
</ows-context:Server>
</ows-context:Layer>
<ows-context:Layer name="coastal_wetlands_2023" hidden="false" opacity="0.5">
<ows-context:Server service="urn:ogc:serviceType:WMS" version="1.3.0">
<ows-context:OnlineResource
xlink:href="https://ows.emodnet-seabedhabitats.eu/geoserver/emodnet_open/ows?SERVICE=WMS&" />
</ows-context:Server>
<ows-context:Extension>{}</ows-context:Extension>
</ows-context:Layer>
</ows-context:ResourceList>
</ows-context:OWSContext>
After downloading it again, it looks like this; note the missing Google Maps layer:
<ows-context:OWSContext xmlns:ows-context="http://www.opengis.net/ows-context"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows"
version="0.3.1" id="ows-context-ex-1-v3">
<ows-context:General>
<ows:BoundingBox crs="EPSG:3857">
<ows:LowerCorner>712121.224491284 7050676.922226553</ows:LowerCorner>
<ows:UpperCorner>3297443.244757944 8111570.962937008</ows:UpperCorner>
</ows:BoundingBox>
</ows-context:General>
<ows-context:ResourceList>
<ows-context:Layer name="{type=osm}" group="Background layers" hidden="true" opacity="1">
<ows:Title>OpenStreetMap
</ows:Title>
</ows-context:Layer>
<ows-context:Layer name="coastal_wetlands_2023" hidden="false" opacity="0.5">
<ows-context:Server service="urn:ogc:serviceType:WMS" version="1.3.0">
<ows-context:OnlineResource
xlink:href="https://ows.emodnet-seabedhabitats.eu/geoserver/emodnet_open/ows?SERVICE=WMS&" />
</ows-context:Server>
<ows-context:Extension>{}</ows-context:Extension>
</ows-context:Layer>
</ows-context:ResourceList>
</ows-context:OWSContext>
Is there something wrong with the initial context file, or is downloading this type of layer not implemented in GeoNetwork? The map context displays fine though, and the Google Maps layer is rendered correctly:
Tested with GeoNetwork 4.2.8 using docker compose. The compose file:
networks:
gn-network:
driver: bridge
services:
my-es-host:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.15
healthcheck:
test: ["CMD-SHELL", "curl -s -f http://localhost:9200/_cat/health >/dev/null || exit 1"]
interval: 30s
timeout: 10s
retries: 10
environment:
discovery.type: single-node
networks:
gn-network:
geonetwork-host:
image: geonetwork:4.2.8
ports:
- 8080:8080
depends_on:
my-es-host:
condition: service_healthy
environment:
ES_HOST: my-es-host
ES_PROTOCOL: http
ES_PORT: 9200
networks:
gn-network: