Skip to content

Problems with GeoStory map configurations merge process #10489

@allyoucanmap

Description

@allyoucanmap

Description

Legacy geostories used following configuration to store the difference between original resources and changes made to a map in a specific section:

original map resource

{
    "groups": [
        {
            "id": "group-02",
            "title": "over",
            "expanded": false
        },
        {
            "id": "group-01",
            "title": "base",
            "expanded": true
        }
    ],
    "layers": [
        {
            "id": "layer-01",
            "group": "group-01",
            "source": "osm",
            "name": "mapnik",
            "title": "Open Street Map",
            "type": "osm",
            "visibility": true
        },
        {
            "id": "layer-02",
            "format": "image/jpeg",
            "group": "group-02",
            "name": "workspace:layer",
            "opacity": 1,
            "title": "Layer",
            "type": "wms",
            "url": "/geoserver/wms",
            "visibility": false
        }
    ]
}

diff section map configuration

{
    "groups": [
        null,
        {
            "expanded": false
        }
    ],
    "layers": [
        null,
        {
            "visibility": true
        }
    ]
}

The merging process of these two configuration has two steps:

  • the diff configuration was cleaned by replacing null layers with undefined
  • then the createMapObject method was merging the two configuration so layers and groups array items were merged by index

This process had a problem in the step 1 because only null layers were converted but not group layers.

With the introduction of the new TOC the diff configuration for layers and groups was removed and this two field are cloned as soon there is a modification in the section. This introduced another problem described in this comment:

#10426 (comment)

In conclusin we need to solve the issues described above:

  • legacy geostory diff configuration should work also when groups are null
  • new geostory diff configuration should not use the merge method for layers and groups becouse this two field are cloned using the new TOC

How to reproduce

Expected Result

The geostory should be visible and working

Current Result

The application show the error message on full screen

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions