diff --git a/src/store/modules/layers.store.js b/src/store/modules/layers.store.js index 28ca5c768..e4b9bc30c 100644 --- a/src/store/modules/layers.store.js +++ b/src/store/modules/layers.store.js @@ -338,6 +338,7 @@ const actions = { const clone = layerConfig.clone() clone.visible = layer.visible clone.opacity = layer.opacity + clone.customAttributes = layer.customAttributes if (layer.timeConfig) { clone.timeConfig.updateCurrentTimeEntry( clone.timeConfig.getTimeEntryForYear(layer.timeConfig.currentYear) diff --git a/tests/cypress/tests-e2e/layers.cy.js b/tests/cypress/tests-e2e/layers.cy.js index e0e8135ec..d77b36fc6 100644 --- a/tests/cypress/tests-e2e/layers.cy.js +++ b/tests/cypress/tests-e2e/layers.cy.js @@ -1368,4 +1368,20 @@ describe('Test of layer handling', () => { cy.wait('@geojson-data', { timeout: 5000 }) }) }) + context('Custom url attributes', () => { + it('Keep custom attributes when changing language', () => { + cy.goToMapView({ + lang: 'fr', + }) + cy.wait(['@routeChange', '@layers', '@topics', '@topic-ech']) + cy.goToMapView({ + lang: 'en', + bgLayer: 'ch.swisstopo.pixelkarte-farbe', + topic: 'ech', + layers: 'WMS|https://wms.geo.admin.ch/?item=2024-10-30t103151|test.background.layer@item=2024-10-30t103151', + }) + cy.wait(['@routeChange', '@layers', '@topics', '@topic-ech']) + cy.url().should('contain', 'item=2024-10-30t103151') + }) + }) })